44 return b2Sqrt(friction1 * friction2);
51 return restitution1 > restitution2 ? restitution1 : restitution2;
57 return threshold1 < threshold2 ? threshold1 : threshold2;
101 bool IsTouching()
const;
106 void SetEnabled(
bool flag);
109 bool IsEnabled()
const;
120 int32 GetChildIndexA()
const;
127 int32 GetChildIndexB()
const;
131 void SetFriction(
float friction);
134 float GetFriction()
const;
137 void ResetFriction();
141 void SetRestitution(
float restitution);
144 float GetRestitution()
const;
147 void ResetRestitution();
151 void SetRestitutionThreshold(
float threshold);
154 float GetRestitutionThreshold()
const;
157 void ResetRestitutionThreshold();
160 void SetTangentSpeed(
float speed);
163 float GetTangentSpeed()
const;
179 e_islandFlag = 0x0001,
182 e_touchingFlag = 0x0002,
185 e_enabledFlag = 0x0004,
188 e_filterFlag = 0x0008,
191 e_bulletHitFlag = 0x0010,
198 void FlagForFiltering();
202 static void InitializeRegisters();
207 b2Contact() : m_fixtureA(nullptr), m_fixtureB(nullptr) {}
256 const b2Body* bodyA = m_fixtureA->GetBody();
257 const b2Body* bodyB = m_fixtureB->GetBody();
258 const b2Shape* shapeA = m_fixtureA->GetShape();
259 const b2Shape* shapeB = m_fixtureB->GetShape();
268 m_flags |= e_enabledFlag;
272 m_flags &= ~e_enabledFlag;
278 return (m_flags & e_enabledFlag) == e_enabledFlag;
283 return (m_flags & e_touchingFlag) == e_touchingFlag;
328 m_flags |= e_filterFlag;
378 m_tangentSpeed = speed;
383 return m_tangentSpeed;
const b2Transform & GetTransform() const
void Initialize(const b2Manifold *manifold, const b2Transform &xfA, float radiusA, const b2Transform &xfB, float radiusB)
void Create(b2BlockAllocator *allocator, b2Body *body, const b2FixtureDef *def)
A rigid body. These are created via b2World::CreateBody.
void Destroy(b2BlockAllocator *allocator)
float m_restitutionThreshold
This is used to compute the current state of a contact manifold.