diff options
author | Kent Mein <mein@cs.umn.edu> | 2002-12-02 19:30:13 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2002-12-02 19:30:13 +0300 |
commit | 73aef31b52e17d8bd2c74e861ca2b7d925bb37b8 (patch) | |
tree | b1520c6e52c122667bba5eb7a5df6b83808c69cf /source | |
parent | 644e4d7c1c2bf5f54f9cc3b736807c064b3abc54 (diff) |
I got this patch from sgefant Mostly its just casting floats as floats.
(also adding a couple of include pathes)
changes in Ode*.cpp to get it compile with gcc 2.95.4
to make it compile with ./configure --with-gameengine
--enable-gameplayer
Kent
--
mein@cs.umn.edu
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Physics/BlOde/OdePhysicsController.cpp | 16 | ||||
-rw-r--r-- | source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp | 20 |
2 files changed, 19 insertions, 17 deletions
diff --git a/source/gameengine/Physics/BlOde/OdePhysicsController.cpp b/source/gameengine/Physics/BlOde/OdePhysicsController.cpp index 6493caca25b..e14f0c9d2f4 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsController.cpp +++ b/source/gameengine/Physics/BlOde/OdePhysicsController.cpp @@ -261,7 +261,8 @@ bool ODEPhysicsController::SynchronizeMotionStates(float time) dQuaternion worldquat; float worldpos[3]; - m_MotionState->getWorldOrientation(worldquat[1],worldquat[2],worldquat[3],worldquat[0]); + m_MotionState->getWorldOrientation((float)worldquat[1], + (float)worldquat[2],(float)worldquat[3],(float)worldquat[0]); m_MotionState->getWorldPosition(worldpos[0],worldpos[1],worldpos[2]); float scaling[3]; @@ -329,10 +330,10 @@ bool ODEPhysicsController::SynchronizeMotionStates(float time) return false; } - const float* worldPos = dBodyGetPosition(m_bodyId); + const float* worldPos = (float *)dBodyGetPosition(m_bodyId); m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]); - const float* worldquat = dBodyGetQuaternion(m_bodyId); + const float* worldquat = (float *)dBodyGetQuaternion(m_bodyId); m_MotionState->setWorldOrientation(worldquat[1],worldquat[2],worldquat[3],worldquat[0]); } else { @@ -345,7 +346,8 @@ bool ODEPhysicsController::SynchronizeMotionStates(float time) dQuaternion worldquat; float worldpos[3]; - m_MotionState->getWorldOrientation(worldquat[1],worldquat[2],worldquat[3],worldquat[0]); + m_MotionState->getWorldOrientation((float)worldquat[1], + (float)worldquat[2],(float)worldquat[3],(float)worldquat[0]); m_MotionState->getWorldPosition(worldpos[0],worldpos[1],worldpos[2]); float scaling[3]; @@ -497,9 +499,9 @@ void ODEPhysicsController::applyImpulse(float attachX,float attachY,float attach newvel[2]=linvel[2]+impulseZ*massinv; dBodySetLinearVel(m_bodyId,newvel[0],newvel[1],newvel[2]); - const float* worldPos = dBodyGetPosition(m_bodyId); + const float* worldPos = (float *)dBodyGetPosition(m_bodyId); - const float* angvelc = dBodyGetAngularVel (m_bodyId); + const float* angvelc = (float *)dBodyGetAngularVel(m_bodyId); float angvel[3]; angvel[0]=angvelc[0]; angvel[1]=angvelc[1]; @@ -542,7 +544,7 @@ void ODEPhysicsController::GetLinearVelocity(float& linvX,float& linvY,float& li { if (m_OdeDyna) { - const float* vel = dBodyGetLinearVel(m_bodyId); + const float* vel = (float *)dBodyGetLinearVel(m_bodyId); linvX = vel[0]; linvY = vel[1]; linvZ = vel[2]; diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp index 5b6942c4fbb..7851a9f34f7 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp +++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp @@ -93,10 +93,10 @@ int ODEPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl dJointID jointid = dJointCreateBall (m_OdeWorld,m_JointGroup); struct dxBody* bodyid1 = dynactrl->GetOdeBodyId(); struct dxBody* bodyid2=0; - const float* pos = dBodyGetPosition(bodyid1); - const float* R = dBodyGetRotation(bodyid1); - float offset[3] = {pivotX,pivotY,pivotZ}; - float newoffset[3]; + const dReal* pos = dBodyGetPosition(bodyid1); + const dReal* R = dBodyGetRotation(bodyid1); + dReal offset[3] = {pivotX,pivotY,pivotZ}; + dReal newoffset[3]; dMULTIPLY0_331 (newoffset,R,offset); newoffset[0] += pos[0]; newoffset[1] += pos[1]; @@ -121,13 +121,13 @@ int ODEPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl dJointID jointid = dJointCreateHinge (m_OdeWorld,m_JointGroup); struct dxBody* bodyid1 = dynactrl->GetOdeBodyId(); struct dxBody* bodyid2=0; - const float* pos = dBodyGetPosition(bodyid1); - const float* R = dBodyGetRotation(bodyid1); - float offset[3] = {pivotX,pivotY,pivotZ}; - float axisset[3] = {axisX,axisY,axisZ}; + const dReal* pos = dBodyGetPosition(bodyid1); + const dReal* R = dBodyGetRotation(bodyid1); + dReal offset[3] = {pivotX,pivotY,pivotZ}; + dReal axisset[3] = {axisX,axisY,axisZ}; - float newoffset[3]; - float newaxis[3]; + dReal newoffset[3]; + dReal newaxis[3]; dMULTIPLY0_331 (newaxis,R,axisset); dMULTIPLY0_331 (newoffset,R,offset); |