Remove particle forces if it gets destroyed

This commit is contained in:
Irlan
2019-06-05 13:49:40 -03:00
parent 5ee66d645e
commit 07ee080310
3 changed files with 24 additions and 2 deletions

View File

@ -46,6 +46,9 @@ public:
//
b3Force* GetNext();
//
virtual bool HasParticle(const b3Particle* particle) const = 0;
protected:
friend class b3List2<b3Force>;
friend class b3Cloth;

View File

@ -67,6 +67,8 @@ public:
float32 GetDampingStiffness() const;
b3Vec3 GetActionForce() const;
bool HasParticle(const b3Particle* particle) const;
private:
friend class b3Force;
friend class b3Cloth;
@ -127,4 +129,9 @@ inline b3Vec3 b3SpringForce::GetActionForce() const
return m_f;
}
inline bool b3SpringForce::HasParticle(const b3Particle* particle) const
{
return m_p1 == particle || m_p2 == particle;
}
#endif