git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@110 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
84145e5b98
commit
3e2ea5acd9
|
@ -26,8 +26,7 @@
|
|||
using namespace reactphysics3d;
|
||||
|
||||
// Constructor of the class Simulation
|
||||
Simulation::Simulation()
|
||||
:world(new DynamicWorld(Vector3D(0.0, -9.81, 0.0))), engine(world, Time(0.01)){
|
||||
Simulation::Simulation() :world(new DynamicWorld(Vector3D(0.0, -9.81, 0.0))), engine(world, Time(0.01)) {
|
||||
simRunning = false;
|
||||
mouseButtonPressed = false;
|
||||
nbFrame = 0;
|
||||
|
@ -52,7 +51,7 @@ void Simulation::start() {
|
|||
// Add every rigid body to the dynamic world
|
||||
for (int i=0; i<context.getNbObjects(); ++i) {
|
||||
world->addBody(context.getObject(i).getRigidBody());
|
||||
}
|
||||
}
|
||||
|
||||
// Activation of the simulation
|
||||
simRunning = true;
|
||||
|
@ -73,6 +72,7 @@ void Simulation::start() {
|
|||
|
||||
double time = SDL_GetTicks()/1000.0;
|
||||
std::cout << "Time : " << time << std::endl;
|
||||
|
||||
// Update the display time
|
||||
engine.updateDisplayTime(Time(time));
|
||||
|
||||
|
@ -86,6 +86,7 @@ void Simulation::start() {
|
|||
computeFps();
|
||||
std::cout << "FPS : " << fps << std::endl;
|
||||
|
||||
/*
|
||||
BodyState state = context.getObject(0).getRigidBody()->getInterpolatedState();
|
||||
Vector3D velocity = context.getObject(0).getRigidBody()->getInterpolatedState().getAngularVelocity();
|
||||
//std::cout << "Velocity 0 : " << velocity.getX() << ", " << velocity.getY() << ", " << velocity.getZ() << ")" << std::endl;
|
||||
|
@ -112,6 +113,7 @@ void Simulation::start() {
|
|||
double z2 = state2.getPosition().getZ();
|
||||
std::cout << "Position Cube 2: (" << x2 << ", " << y2 << ", " << z2 << ")" << std::endl;
|
||||
std::cout << "quaternion orientation 2 : " << velocity2.getX() << ", " << velocity2.getY() << ", " << velocity2.getZ() << ", " << velocity2.getW() << ")" << std::endl;;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user