Thanks for the reply. But what I don't know is where/how to set my target frame or time. For instance, I'm looking at the HelloWorld demo as reference, and I see:
Code: Select all
for (i=0;i<100;i++)
{
dynamicsWorld->stepSimulation(1.f/60);
//print positions of all objects
for (int j=dynamicsWorld->getNumCollisionObjects()-1; j>=0 ;j--)
{
btCollisionObject* obj = dynamicsWorld->getCollisionObjectArray()[j];
btRigidBody* body = btRigidBody::upcast(obj);
if (body && body->getMotionState())
{
btTransform trans;
body->getMotionState()->getWorldTransform(trans);
//printf("world pos = %f,%f,%f\n",float(trans.getOrigin().getX()),float(trans.getOrigin().getY()),float(trans.getOrigin().getZ()));
}
}
}
When running this app, I type "time ./AppHelloWorld" in the command line and receive .004s for real time it took to run this sim, but I can't make the connection between this and the number of iterations and timestep. Does this mean that the simulation runs for a total of 100*(1/60) seconds? I looked at the stepSimulation code but am still lost. Could you be more specific please?