![]() |
Colliding Shapes
Ian Parberry's "Introduction to Game Physics"
|
Contact descriptor. More...
#include <Contact.h>
Public Member Functions | |
CContactDesc (CShape *, CDynamicCircle *) | |
Constructor. More... | |
CContactDesc () | |
Default constructor. More... | |
Public Attributes | |
CShape * | m_pShape = nullptr |
Pointer to static or kinematic shape. | |
CDynamicCircle * | m_pCircle = nullptr |
Pointer to dynamic circle. | |
Vector2 | m_vPOI |
POI. | |
Vector2 | m_vNorm |
Normal to collision. | |
float | m_fSetback = 0.0f |
Setback distance. | |
float | m_fSpeed = 0.0f |
Collision speed. | |
A record of contact between a shape (which may be static, kinematic, or dynamic) and a dynamic circle. Collision detection functions take as input a contact descriptor with the pointers to the shapes, and it fills in the details of the contact if there is one. This filled-out contact descriptor is then passed to the collision response function.
CContactDesc::CContactDesc | ( | CShape * | p0, |
CDynamicCircle * | p1 | ||
) |
This constructor constructs a contact descriptor given a pointer to a shape and a pointer to a dynamic circle. No attempt is made to determine whether these shapes are indeed in contact, and the pointers may be null.
CContactDesc::CContactDesc | ( | ) |
The default constructor constructs a contact descriptor whose pointers are null. What could possibly go wrong?