Changeset 1562 for trunk/test/BtPhysTest.cpp
- Timestamp:
- Jul 2, 2012, 12:58:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/BtPhysTest.cpp
r1556 r1562 229 229 for(int i=0;i<gNumObjects;i++) 230 230 { 231 btScalar m[16];232 btMatrix3x3 rot; rot.setIdentity();233 btCollisionObject* colObj =m_bt_world->getCollisionObjectArray()[i];234 btRigidBody* body =btRigidBody::upcast(colObj);235 if(body &&body->getMotionState())231 mat4 m(1.0f); 232 btMatrix3x3 rot; rot.setIdentity(); 233 btCollisionObject* colObj = m_bt_world->getCollisionObjectArray()[i]; 234 btRigidBody* body = btRigidBody::upcast(colObj); 235 if(body && body->getMotionState()) 236 236 { 237 237 btDefaultMotionState* myMotionState = (btDefaultMotionState*)body->getMotionState(); 238 myMotionState->m_graphicsWorldTrans.getOpenGLMatrix( m);239 rot =myMotionState->m_graphicsWorldTrans.getBasis();238 myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(&m[0][0]); 239 rot = myMotionState->m_graphicsWorldTrans.getBasis(); 240 240 } 241 241 else 242 242 { 243 colObj->getWorldTransform().getOpenGLMatrix(m); 244 rot=colObj->getWorldTransform().getBasis(); 245 } 246 mat4 NewMx = mat4(1.0f); 247 for (int i = 0; i < 16; ++i) 248 NewMx[i / 4][i % 4] = (float)m[i]; 249 m_rigid_mesh.Render(NewMx); 243 colObj->getWorldTransform().getOpenGLMatrix(&m[0][0]); 244 rot = colObj->getWorldTransform().getBasis(); 245 } 246 m_rigid_mesh.Render(m); 250 247 } 251 248 } … … 259 256 //cleanup in the reverse order of creation/initialization 260 257 //remove the rigidbodies from the dynamics world and delete them 261 int i; 262 for (i = m_bt_world->getNumCollisionObjects() - 1; i >= 0 ;i--) 258 for (int i = m_bt_world->getNumCollisionObjects() - 1; i >= 0 ;i--) 263 259 { 264 260 btCollisionObject* obj = m_bt_world->getCollisionObjectArray()[i]; … … 280 276 281 277 delete m_bt_world; 282 283 278 delete m_bt_solver; 284 285 279 delete m_bt_broadphase; 286 287 280 delete m_bt_dispatcher; 288 289 281 delete m_bt_collision_config; 290 282 }
Note: See TracChangeset
for help on using the changeset viewer.