Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Nov 08, 2012 10:26 pm 
Offline

Joined: Thu Nov 08, 2012 2:03 pm
Posts: 12
It's 1 AM here so don't judge me if I say anything stupid.

In the hello world demo,you get only 24 lines of text in the console? Why only 24?

Code:
for (i=0;i<100;i++)
   {
      dynamicsWorld->stepSimulation(1.f/60.f,10);
      
      //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()));
         }
      }
   }


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group