Caching impulses for b3BodyContact has been added. Also added some code for completeness.

This commit is contained in:
Irlan
2019-04-03 11:05:21 -03:00
parent 397a8eeee3
commit b4d3330579
5 changed files with 176 additions and 79 deletions

View File

@ -183,9 +183,6 @@ private:
// Pool of particles
b3BlockPool m_particleBlocks;
// Pool of body contacts
b3BlockPool m_bodyContactBlocks;
// Pool of particle contacts
b3BlockPool m_particleContactBlocks;
@ -195,9 +192,6 @@ private:
// List of forces
b3List2<b3Force> m_forceList;
// List of particle contacts
b3List2<b3BodyContact> m_bodyContactList;
// List of particle contacts
b3List2<b3ParticleContact> m_particleContactList;
};

View File

@ -71,6 +71,16 @@ public:
b3Particle* p1;
b3Shape* s2;
// Contact constraint
float32 s;
b3Vec3 p;
b3Vec3 n;
float32 fn0;
float32 fn;
float32 ft1, ft2;
bool t1Active;
bool t2Active;
// Contact constraint
b3Vec3 localPoint1;
b3Vec3 localPoint2;
@ -80,8 +90,7 @@ public:
b3Vec3 t1, t2;
b3Vec2 tangentImpulse;
b3BodyContact* m_prev;
b3BodyContact* m_next;
bool active;
};
struct b3BodyContactWorldPoint
@ -198,7 +207,7 @@ private:
// Applied external force
b3Vec3 m_force;
// Applied external translation
// Applied translation
b3Vec3 m_translation;
// Mass
@ -230,6 +239,9 @@ private:
//
b3Cloth* m_cloth;
//
b3BodyContact m_bodyContact;
//
b3Particle* m_prev;