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
This commit is contained in:
@@ -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];
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user