My contact listener.
More...
#include <ContactListener.h>
|
b2Body * | m_pBodyA = nullptr |
| Pointer to body A.
|
|
b2Body * | m_pBodyB = nullptr |
| Pointer to body B.
|
|
◆ Count()
const UINT CMyListener::Count |
( |
eSprite |
t | ) |
const |
|
private |
Count number of bodies that have sprite type t.
Count the number of bodies out of *m_pBodyA and *m_pBodyB that have objects have a given sprite type. Returns 0, 1, or 2, of course.
- Parameters
-
- Returns
- Number of *m_pBodyA and *m_pBodyB that have type t.
◆ GetSpeed()
const float CMyListener::GetSpeed |
( |
const b2Vec2 & |
p | ) |
const |
|
private |
Get the collision speed.
Collision speed is proportional to the magnitude of the relative velocity.
- Parameters
-
- Returns
- Collision speed in Physics World units.
◆ PreSolve()
void CMyListener::PreSolve |
( |
b2Contact * |
c, |
|
|
const b2Manifold * |
m |
|
) |
| |
Presolve function.
Presolve function. Renders a colored star at each contact point and plays the appropriate sound, depending on what type of objects are contacting.
- Parameters
-
c | Pointer to the contact. |
m | Pointer to the old contact manifold as it was before this contact. |