add warmstart
This commit is contained in:
@@ -55,6 +55,7 @@ public:
|
||||
: m_userPersistentData(0),
|
||||
m_contactPointFlags(0),
|
||||
m_appliedImpulse(0.f),
|
||||
m_prevRHS(0.f),
|
||||
m_appliedImpulseLateral1(0.f),
|
||||
m_appliedImpulseLateral2(0.f),
|
||||
m_contactMotion1(0.f),
|
||||
@@ -79,6 +80,7 @@ public:
|
||||
m_userPersistentData(0),
|
||||
m_contactPointFlags(0),
|
||||
m_appliedImpulse(0.f),
|
||||
m_prevRHS(0.f),
|
||||
m_appliedImpulseLateral1(0.f),
|
||||
m_appliedImpulseLateral2(0.f),
|
||||
m_contactMotion1(0.f),
|
||||
@@ -114,7 +116,8 @@ public:
|
||||
int m_contactPointFlags;
|
||||
|
||||
btScalar m_appliedImpulse;
|
||||
btScalar m_appliedImpulseLateral1;
|
||||
btScalar m_prevRHS;
|
||||
btScalar m_appliedImpulseLateral1;
|
||||
btScalar m_appliedImpulseLateral2;
|
||||
btScalar m_contactMotion1;
|
||||
btScalar m_contactMotion2;
|
||||
|
||||
@@ -325,7 +325,8 @@ const char* btPersistentManifold::serialize(const class btPersistentManifold* ma
|
||||
{
|
||||
const btManifoldPoint& pt = manifold->getContactPoint(i);
|
||||
dataOut->m_pointCacheAppliedImpulse[i] = pt.m_appliedImpulse;
|
||||
dataOut->m_pointCacheAppliedImpulseLateral1[i] = pt.m_appliedImpulseLateral1;
|
||||
dataOut->m_pointCachePrevRHS[i] = pt.m_prevRHS;
|
||||
dataOut->m_pointCacheAppliedImpulseLateral1[i] = pt.m_appliedImpulseLateral1;
|
||||
dataOut->m_pointCacheAppliedImpulseLateral2[i] = pt.m_appliedImpulseLateral2;
|
||||
pt.m_localPointA.serialize(dataOut->m_pointCacheLocalPointA[i]);
|
||||
pt.m_localPointB.serialize(dataOut->m_pointCacheLocalPointB[i]);
|
||||
@@ -337,7 +338,6 @@ const char* btPersistentManifold::serialize(const class btPersistentManifold* ma
|
||||
dataOut->m_pointCacheFrictionCFM[i] = pt.m_frictionCFM;
|
||||
dataOut->m_pointCacheContactERP[i] = pt.m_contactERP;
|
||||
dataOut->m_pointCacheContactCFM[i] = pt.m_contactCFM;
|
||||
dataOut->m_pointCacheContactPointFlags[i] = pt.m_contactPointFlags;
|
||||
dataOut->m_pointCacheIndex0[i] = pt.m_index0;
|
||||
dataOut->m_pointCacheIndex1[i] = pt.m_index1;
|
||||
dataOut->m_pointCachePartId0[i] = pt.m_partId0;
|
||||
@@ -371,6 +371,7 @@ void btPersistentManifold::deSerialize(const struct btPersistentManifoldDoubleDa
|
||||
btManifoldPoint& pt = m_pointCache[i];
|
||||
|
||||
pt.m_appliedImpulse = manifoldDataPtr->m_pointCacheAppliedImpulse[i];
|
||||
pt.m_prevRHS = manifoldDataPtr->m_pointCachePrevRHS[i];
|
||||
pt.m_appliedImpulseLateral1 = manifoldDataPtr->m_pointCacheAppliedImpulseLateral1[i];
|
||||
pt.m_appliedImpulseLateral2 = manifoldDataPtr->m_pointCacheAppliedImpulseLateral2[i];
|
||||
pt.m_localPointA.deSerializeDouble(manifoldDataPtr->m_pointCacheLocalPointA[i]);
|
||||
@@ -416,6 +417,7 @@ void btPersistentManifold::deSerialize(const struct btPersistentManifoldFloatDat
|
||||
btManifoldPoint& pt = m_pointCache[i];
|
||||
|
||||
pt.m_appliedImpulse = manifoldDataPtr->m_pointCacheAppliedImpulse[i];
|
||||
pt.m_prevRHS = manifoldDataPtr->m_pointCachePrevRHS[i];
|
||||
pt.m_appliedImpulseLateral1 = manifoldDataPtr->m_pointCacheAppliedImpulseLateral1[i];
|
||||
pt.m_appliedImpulseLateral2 = manifoldDataPtr->m_pointCacheAppliedImpulseLateral2[i];
|
||||
pt.m_localPointA.deSerialize(manifoldDataPtr->m_pointCacheLocalPointA[i]);
|
||||
@@ -444,4 +446,4 @@ void btPersistentManifold::deSerialize(const struct btPersistentManifoldFloatDat
|
||||
pt.m_contactMotion1 = manifoldDataPtr->m_pointCacheContactMotion1[i];
|
||||
pt.m_contactMotion2 = manifoldDataPtr->m_pointCacheContactMotion2[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ public:
|
||||
//get rid of duplicated userPersistentData pointer
|
||||
m_pointCache[lastUsedIndex].m_userPersistentData = 0;
|
||||
m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f;
|
||||
m_pointCache[lastUsedIndex].m_prevRHS = 0.f;
|
||||
m_pointCache[lastUsedIndex].m_contactPointFlags = 0;
|
||||
m_pointCache[lastUsedIndex].m_appliedImpulseLateral1 = 0.f;
|
||||
m_pointCache[lastUsedIndex].m_appliedImpulseLateral2 = 0.f;
|
||||
@@ -195,6 +196,7 @@ public:
|
||||
#ifdef MAINTAIN_PERSISTENCY
|
||||
int lifeTime = m_pointCache[insertIndex].getLifeTime();
|
||||
btScalar appliedImpulse = m_pointCache[insertIndex].m_appliedImpulse;
|
||||
btScalar prevRHS = m_pointCache[insertIndex].m_prevRHS;
|
||||
btScalar appliedLateralImpulse1 = m_pointCache[insertIndex].m_appliedImpulseLateral1;
|
||||
btScalar appliedLateralImpulse2 = m_pointCache[insertIndex].m_appliedImpulseLateral2;
|
||||
|
||||
@@ -223,6 +225,7 @@ public:
|
||||
m_pointCache[insertIndex] = newPoint;
|
||||
m_pointCache[insertIndex].m_userPersistentData = cache;
|
||||
m_pointCache[insertIndex].m_appliedImpulse = appliedImpulse;
|
||||
m_pointCache[insertIndex].m_prevRHS = prevRHS;
|
||||
m_pointCache[insertIndex].m_appliedImpulseLateral1 = appliedLateralImpulse1;
|
||||
m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2;
|
||||
}
|
||||
@@ -276,7 +279,8 @@ struct btPersistentManifoldDoubleData
|
||||
btVector3DoubleData m_pointCacheLateralFrictionDir2[4];
|
||||
double m_pointCacheDistance[4];
|
||||
double m_pointCacheAppliedImpulse[4];
|
||||
double m_pointCacheCombinedFriction[4];
|
||||
double m_pointCachePrevRHS[4];
|
||||
double m_pointCacheCombinedFriction[4];
|
||||
double m_pointCacheCombinedRollingFriction[4];
|
||||
double m_pointCacheCombinedSpinningFriction[4];
|
||||
double m_pointCacheCombinedRestitution[4];
|
||||
@@ -322,6 +326,7 @@ struct btPersistentManifoldFloatData
|
||||
btVector3FloatData m_pointCacheLateralFrictionDir2[4];
|
||||
float m_pointCacheDistance[4];
|
||||
float m_pointCacheAppliedImpulse[4];
|
||||
float m_pointCachePrevRHS[4];
|
||||
float m_pointCacheCombinedFriction[4];
|
||||
float m_pointCacheCombinedRollingFriction[4];
|
||||
float m_pointCacheCombinedSpinningFriction[4];
|
||||
|
||||
Reference in New Issue
Block a user