FIX: use btScalar instead of float, otherwise double precision build breaks
FIX: make Maya plugin compile for Maya 8.0 FIX: btDbvt SSE doesn't compile for double precision builds
This commit is contained in:
@@ -170,7 +170,7 @@ void SpuContactResult::writeDoubleBufferedManifold(btPersistentManifold* lsManif
|
||||
//no, the swapBuffers does the wait
|
||||
}
|
||||
|
||||
void SpuContactResult::addContactPoint(const btVector3& normalOnBInWorld,const btPoint3& pointInWorld,float depth)
|
||||
void SpuContactResult::addContactPoint(const btVector3& normalOnBInWorld,const btPoint3& pointInWorld,btScalar depth)
|
||||
{
|
||||
//spu_printf("*** SpuContactResult::addContactPoint: depth = %f\n",depth);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class SpuContactResult : public btDiscreteCollisionDetectorInterface::Result
|
||||
|
||||
void writeDoubleBufferedManifold(btPersistentManifold* lsManifold, btPersistentManifold* mmManifold);
|
||||
|
||||
virtual void addContactPoint(const btVector3& normalOnBInWorld,const btPoint3& pointInWorld,float depth);
|
||||
virtual void addContactPoint(const btVector3& normalOnBInWorld,const btPoint3& pointInWorld,btScalar depth);
|
||||
|
||||
void flush();
|
||||
};
|
||||
|
||||
@@ -492,7 +492,12 @@ void rigidBodyArrayNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
|
||||
|
||||
m_rigid_bodies[i]->set_transform(newpos, newrot);
|
||||
|
||||
hInitPos.set3Float(ipos[0] + mtranslation.x, ipos[1] + mtranslation.y, ipos[2] + mtranslation.z);
|
||||
float3 &ihpos=hInitPos.asFloat3();
|
||||
//hInitPos.set3Float(ipos[0] + mtranslation.x, ipos[1] + mtranslation.y, ipos[2] + mtranslation.z);
|
||||
ihpos[0] = ipos[0] + mtranslation.x;
|
||||
ihpos[1] = ipos[1] + mtranslation.y;
|
||||
ihpos[2] = ipos[2] + mtranslation.z;
|
||||
|
||||
|
||||
hInitPosArray.next();
|
||||
}
|
||||
|
||||
@@ -447,8 +447,20 @@ void rigidBodyNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
|
||||
MVector newipos(ipos[0] + deltapos.x, ipos[1] + deltapos.y, ipos[2] + deltapos.z);
|
||||
MEulerRotation newirot((iquat * deltarot).asEulerRotation());
|
||||
|
||||
hInitPos.set3Float(newipos.x, newipos.y, newipos.z);
|
||||
hInitRot.set3Float(rad2deg(newirot.x), rad2deg(newirot.y), rad2deg(newirot.z));
|
||||
float3 &ihpos = hInitPos.asFloat3();
|
||||
//hInitPos.set3Float(newipos.x, newipos.y, newipos.z);
|
||||
//for Maya 8.5
|
||||
ihpos[0] = newipos.x;
|
||||
ihpos[1] = newipos.y;
|
||||
ihpos[2] = newipos.z;
|
||||
|
||||
float3 &ihrot = hInitRot.asFloat3();
|
||||
//hInitRot.set3Float(rad2deg(newirot.x), rad2deg(newirot.y), rad2deg(newirot.z));
|
||||
//for Maya 8.5
|
||||
ihrot[0] = rad2deg(newirot.x);
|
||||
ihrot[1] = rad2deg(newirot.y);
|
||||
ihrot[2] = rad2deg(newirot.z);
|
||||
|
||||
|
||||
m_rigid_body->set_transform(vec3f(mtranslation.x, mtranslation.y, mtranslation.z),
|
||||
quatf(mrotation.w, mrotation.x, mrotation.y, mrotation.z));
|
||||
|
||||
@@ -62,7 +62,7 @@ subject to the following restrictions:
|
||||
// Specific methods implementation
|
||||
|
||||
//SSE gives errors on a MSVC 7.1
|
||||
#if (defined (WIN32) && (_MSC_VER) && _MSC_VER >= 1400)
|
||||
#if (defined (WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined (BT_USE_DOUBLE_PRECISION))
|
||||
#define DBVT_SELECT_IMPL DBVT_IMPL_SSE
|
||||
#define DBVT_MERGE_IMPL DBVT_IMPL_SSE
|
||||
#define DBVT_INT0_IMPL DBVT_IMPL_SSE
|
||||
|
||||
@@ -226,9 +226,9 @@ void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[])
|
||||
a = btScalar(j)*(2*M__PI/m) + A[i0];
|
||||
if (a > M__PI) a -= 2*M__PI;
|
||||
btScalar maxdiff=1e9,diff;
|
||||
#if defined(DEBUG) || defined (_DEBUG)
|
||||
*iret = i0; // iret is not allowed to keep this value
|
||||
#endif
|
||||
|
||||
*iret = i0; // iret is not allowed to keep this value, but it sometimes does, when diff=#QNAN0
|
||||
|
||||
for (i=0; i<n; i++) {
|
||||
if (avail[i]) {
|
||||
diff = btFabs (A[i]-a);
|
||||
|
||||
Reference in New Issue
Block a user