![]() |
My Project
|
Collision event between 2 game objects. More...
#include <AnnEvents.hpp>
Public Member Functions | |
AnnCollisionEvent (AnnGameObject *first, AnnGameObject *second, AnnVect3 position, AnnVect3 normal) | |
Event constructor. More... | |
bool | hasObject (AnnGameObject *obj) const |
Check if this event is about that object. More... | |
AnnGameObject * | getA () const |
Get first object. More... | |
AnnGameObject * | getB () const |
Get second object. More... | |
AnnVect3 | getPosition () const |
Get the position of the "contact point" from that collision. More... | |
AnnVect3 | getNormal () const |
Get the normal on the "B" body at the "contact point". More... | |
bool | isWallCollision (float scalarApprox=0.0125) const |
bool | isGroundCollision (float scalarApprox=0.125) const |
bool | isCeilingCollision (float scalarApprox=0.125) const |
![]() | |
AnnEvent () | |
Event constructor. More... | |
AnnEventType | getType () const |
Private Attributes | |
AnnGameObject * | a |
Some naked pointers. More... | |
AnnGameObject * | b |
const AnnVect3 | position |
const AnnVect3 | normal |
Additional Inherited Members | |
![]() | |
AnnEventType | type |
Collision event between 2 game objects.
Definition at line 362 of file AnnEvents.hpp.
AnnCollisionEvent::AnnCollisionEvent | ( | AnnGameObject * | first, |
AnnGameObject * | second, | ||
AnnVect3 | position, | ||
AnnVect3 | normal | ||
) |
Event constructor.
Definition at line 403 of file AnnEvents.cpp.
AnnGameObject * AnnCollisionEvent::getA | ( | ) | const |
Get first object.
Definition at line 419 of file AnnEvents.cpp.
AnnGameObject * AnnCollisionEvent::getB | ( | ) | const |
Get second object.
Definition at line 424 of file AnnEvents.cpp.
AnnVect3 AnnCollisionEvent::getNormal | ( | ) | const |
Get the normal on the "B" body at the "contact point".
Definition at line 434 of file AnnEvents.cpp.
AnnVect3 AnnCollisionEvent::getPosition | ( | ) | const |
Get the position of the "contact point" from that collision.
Definition at line 429 of file AnnEvents.cpp.
bool AnnCollisionEvent::hasObject | ( | AnnGameObject * | obj | ) | const |
Check if this event is about that object.
Definition at line 412 of file AnnEvents.cpp.
bool AnnCollisionEvent::isCeilingCollision | ( | float | scalarApprox = 0.125 | ) | const |
Return true if the collision occured with an horizontal plane above the object. See isGroundCollision, it's the same thing, but testing for a negative y on the normal
scalarApprox | Approximation threshold to consider when testing the equality of the dotProuct and 0.0f |
Definition at line 444 of file AnnEvents.cpp.
bool AnnCollisionEvent::isGroundCollision | ( | float | scalarApprox = 0.125 | ) | const |
Return true if the collision occurred with an horizontal plane below the object. This is computed by taking !isWallCollision(approx) && normal.y > 0
scalarApprox | Approximation threshold to consider when testing the equality of the dotProuct and 0.0f |
Definition at line 439 of file AnnEvents.cpp.
bool AnnCollisionEvent::isWallCollision | ( | float | scalarApprox = 0.0125 | ) | const |
Return true if the collision occurred with a vertical plane. Computed with testing the dot product of +Y and the normal.
scalarApprox | Approximation threshold to consider when testing the equality of the dotProuct and 0.0f |
Definition at line 449 of file AnnEvents.cpp.
|
private |
Some naked pointers.
Definition at line 390 of file AnnEvents.hpp.
|
private |
Definition at line 390 of file AnnEvents.hpp.
|
private |
Definition at line 391 of file AnnEvents.hpp.
|
private |
Definition at line 391 of file AnnEvents.hpp.