use the old data structures for single precision serialization, to make it backwards compatible
So files created by the new double precision serialization of Bullet 2.82 cannot be read by old Bullet versions, but double precision serialized file generated by older Bullet versions can be read by Bullet 2.82 or newer.
This commit is contained in:
@@ -73,25 +73,19 @@ typedef struct bInvalidHandle {
|
||||
class btTypedConstraintFloatData;
|
||||
class btTypedConstraintData;
|
||||
class btTypedConstraintDoubleData;
|
||||
class btPoint2PointConstraintFloatData2;
|
||||
class btPoint2PointConstraintDoubleData2;
|
||||
class btPoint2PointConstraintFloatData;
|
||||
class btPoint2PointConstraintDoubleData2;
|
||||
class btPoint2PointConstraintDoubleData;
|
||||
class btHingeConstraintDoubleData;
|
||||
class btHingeConstraintFloatData;
|
||||
class btHingeConstraintDoubleData2;
|
||||
class btHingeConstraintFloatData2;
|
||||
class btConeTwistConstraintFloatData;
|
||||
class btConeTwistConstraintDoubleData;
|
||||
class btConeTwistConstraintData;
|
||||
class btGeneric6DofConstraintFloatData2;
|
||||
class btGeneric6DofConstraintData;
|
||||
class btGeneric6DofConstraintDoubleData2;
|
||||
class btGeneric6DofSpringConstraintFloatData2;
|
||||
class btGeneric6DofSpringConstraintData;
|
||||
class btGeneric6DofSpringConstraintDoubleData2;
|
||||
class btSliderConstraintData;
|
||||
class btSliderConstraintFloatData;
|
||||
class btSliderConstraintDoubleData;
|
||||
class btContactSolverInfoDoubleData;
|
||||
class btContactSolverInfoFloatData;
|
||||
@@ -726,10 +720,10 @@ typedef struct bInvalidHandle {
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPoint2PointConstraintFloatData2
|
||||
class btPoint2PointConstraintFloatData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintFloatData m_typeConstraintData;
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btVector3FloatData m_pivotInA;
|
||||
btVector3FloatData m_pivotInB;
|
||||
};
|
||||
@@ -745,16 +739,6 @@ typedef struct bInvalidHandle {
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPoint2PointConstraintFloatData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintData m_typeConstraintData;
|
||||
btVector3FloatData m_pivotInA;
|
||||
btVector3FloatData m_pivotInB;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btPoint2PointConstraintDoubleData
|
||||
{
|
||||
@@ -826,44 +810,6 @@ typedef struct bInvalidHandle {
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btHingeConstraintFloatData2
|
||||
{
|
||||
public:
|
||||
btTypedConstraintFloatData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
int m_useReferenceFrameA;
|
||||
int m_angularOnly;
|
||||
int m_enableAngularMotor;
|
||||
float m_motorTargetVelocity;
|
||||
float m_maxMotorImpulse;
|
||||
float m_lowerLimit;
|
||||
float m_upperLimit;
|
||||
float m_limitSoftness;
|
||||
float m_biasFactor;
|
||||
float m_relaxationFactor;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConeTwistConstraintFloatData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintFloatData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
float m_swingSpan1;
|
||||
float m_swingSpan2;
|
||||
float m_twistSpan;
|
||||
float m_limitSoftness;
|
||||
float m_biasFactor;
|
||||
float m_relaxationFactor;
|
||||
float m_damping;
|
||||
char m_pad[4];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btConeTwistConstraintDoubleData
|
||||
{
|
||||
@@ -899,22 +845,6 @@ typedef struct bInvalidHandle {
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGeneric6DofConstraintFloatData2
|
||||
{
|
||||
public:
|
||||
btTypedConstraintFloatData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
btVector3FloatData m_linearUpperLimit;
|
||||
btVector3FloatData m_linearLowerLimit;
|
||||
btVector3FloatData m_angularUpperLimit;
|
||||
btVector3FloatData m_angularLowerLimit;
|
||||
int m_useLinearReferenceFrameA;
|
||||
int m_useOffsetForConstraintFrame;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGeneric6DofConstraintData
|
||||
{
|
||||
@@ -947,18 +877,6 @@ typedef struct bInvalidHandle {
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGeneric6DofSpringConstraintFloatData2
|
||||
{
|
||||
public:
|
||||
btGeneric6DofConstraintFloatData2 m_6dofData;
|
||||
int m_springEnabled[6];
|
||||
float m_equilibriumPoint[6];
|
||||
float m_springStiffness[6];
|
||||
float m_springDamping[6];
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btGeneric6DofSpringConstraintData
|
||||
{
|
||||
@@ -999,22 +917,6 @@ typedef struct bInvalidHandle {
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btSliderConstraintFloatData
|
||||
{
|
||||
public:
|
||||
btTypedConstraintFloatData m_typeConstraintData;
|
||||
btTransformFloatData m_rbAFrame;
|
||||
btTransformFloatData m_rbBFrame;
|
||||
float m_linearUpperLimit;
|
||||
float m_linearLowerLimit;
|
||||
float m_angularUpperLimit;
|
||||
float m_angularLowerLimit;
|
||||
int m_useLinearReferenceFrameA;
|
||||
int m_useOffsetForConstraintFrame;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------- //
|
||||
class btSliderConstraintDoubleData
|
||||
{
|
||||
|
||||
@@ -747,7 +747,7 @@ void btWorldImporter::convertConstraintFloat(btTypedConstraintFloatData* constra
|
||||
{
|
||||
case POINT2POINT_CONSTRAINT_TYPE:
|
||||
{
|
||||
btPoint2PointConstraintFloatData2* p2pData = (btPoint2PointConstraintFloatData2*)constraintData;
|
||||
btPoint2PointConstraintFloatData* p2pData = (btPoint2PointConstraintFloatData*)constraintData;
|
||||
if (rbA&& rbB)
|
||||
{
|
||||
btVector3 pivotInA,pivotInB;
|
||||
@@ -792,7 +792,7 @@ void btWorldImporter::convertConstraintFloat(btTypedConstraintFloatData* constra
|
||||
}
|
||||
case CONETWIST_CONSTRAINT_TYPE:
|
||||
{
|
||||
btConeTwistConstraintFloatData* coneData = (btConeTwistConstraintFloatData*)constraintData;
|
||||
btConeTwistConstraintData* coneData = (btConeTwistConstraintData*)constraintData;
|
||||
btConeTwistConstraint* coneTwist = 0;
|
||||
|
||||
if (rbA&& rbB)
|
||||
@@ -817,7 +817,7 @@ void btWorldImporter::convertConstraintFloat(btTypedConstraintFloatData* constra
|
||||
case D6_SPRING_CONSTRAINT_TYPE:
|
||||
{
|
||||
|
||||
btGeneric6DofSpringConstraintFloatData2* dofData = (btGeneric6DofSpringConstraintFloatData2*)constraintData;
|
||||
btGeneric6DofSpringConstraintData* dofData = (btGeneric6DofSpringConstraintData*)constraintData;
|
||||
// int sz = sizeof(btGeneric6DofSpringConstraintData);
|
||||
btGeneric6DofSpringConstraint* dof = 0;
|
||||
|
||||
@@ -864,7 +864,7 @@ void btWorldImporter::convertConstraintFloat(btTypedConstraintFloatData* constra
|
||||
}
|
||||
case D6_CONSTRAINT_TYPE:
|
||||
{
|
||||
btGeneric6DofConstraintFloatData2* dofData = (btGeneric6DofConstraintFloatData2*)constraintData;
|
||||
btGeneric6DofConstraintData* dofData = (btGeneric6DofConstraintData*)constraintData;
|
||||
btGeneric6DofConstraint* dof = 0;
|
||||
|
||||
if (rbA&& rbB)
|
||||
@@ -905,7 +905,7 @@ void btWorldImporter::convertConstraintFloat(btTypedConstraintFloatData* constra
|
||||
}
|
||||
case SLIDER_CONSTRAINT_TYPE:
|
||||
{
|
||||
btSliderConstraintFloatData* sliderData = (btSliderConstraintFloatData*)constraintData;
|
||||
btSliderConstraintData* sliderData = (btSliderConstraintData*)constraintData;
|
||||
btSliderConstraint* slider = 0;
|
||||
if (rbA&& rbB)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user