Revision: 1234
http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=1234&view=rev
Author: hikerstk
Date: 2007-09-09 17:36:50 -0700 (Sun, 09 Sep 2007)
Log Message:
-----------
Bullet only: fixed --history function for bullet physics.
Modified Paths:
--------------
trunk/supertuxkart/src/kart.cpp
Modified: trunk/supertuxkart/src/kart.cpp
===================================================================
--- trunk/supertuxkart/src/kart.cpp 2007-09-09 21:18:18 UTC (rev 1233)
+++ trunk/supertuxkart/src/kart.cpp 2007-09-10 00:36:50 UTC (rev 1234)
@@ -1508,25 +1508,29 @@
// We don't have to call Moveable::placeModel, since it does only setTransform
#ifdef BULLET
- btTransform t;
- if(m_rescue)
+ // Only transfer the bullet data to the plib tree if no history is being
+ // replayed.
+ if(!user_config->m_replay_history)
{
- t=m_kart_body->getCenterOfMassTransform();
- // m_motion_state->getWorldTransform(t);
- }
- else
- {
- m_motion_state->getWorldTransform(t);
+ btTransform t;
+ if(m_rescue)
+ {
+ t=m_kart_body->getCenterOfMassTransform();
+ // m_motion_state->getWorldTransform(t);
+ }
+ else
+ {
+ m_motion_state->getWorldTransform(t);
+ }
+ float m[4][4];
+ t.getOpenGLMatrix((float*)&m);
+
+ //printf(" is %f %f %f\n",t.getOrigin().x(),t.getOrigin().y(),t.getOrigin().z());
+ // Transfer the new position and hpr to m_curr_pos
+ sgSetCoord(&m_curr_pos, m);
+ const btVector3 &v=m_kart_body->getLinearVelocity();
+ sgSetVec3(m_velocity.xyz, v.x(), v.y(), v.z());
}
- float m[4][4];
- t.getOpenGLMatrix((float*)&m);
-
- //printf(" is %f %f %f\n",t.getOrigin().x(),t.getOrigin().y(),t.getOrigin().z());
- // Transfer the new position and hpr to m_curr_pos
- sgSetCoord(&m_curr_pos, m);
- const btVector3 &v=m_kart_body->getLinearVelocity();
- sgSetVec3(m_velocity.xyz, v.x(), v.y(), v.z());
-
sgCoord c ;
sgCopyCoord ( &c, &m_curr_pos ) ;
// c.hpr[1] += m_wheelie_angle ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|