#include <Contact.h>
Public Member Functions | |
| ~Contact (void) | |
| Contact (const Contact &rhs) | |
| Contact & | operator= (const Contact &rhs) |
| Contact (RigidBody *body, const ml7::Vector2 &point, const ml7::Vector2 &normal, const float penetration, const float restitution, const float static_friction, const float kinetic_friction) | |
| Contact (RigidBody *body1, RigidBody *body2, const ml7::Vector2 &point, const ml7::Vector2 &normal, const float penetration, const float restitution, const float static_friction, const float kinetic_friction) | |
| Contact (void) | |
| const RigidBody * | get_body1 () const |
| const RigidBody * | get_body2 () const |
| const ml7::Vector2 & | get_point () const |
| const ml7::Vector2 & | get_normal () const |
| float | get_penetration () const |
| float | get_restitution () const |
| float | get_static_friction () const |
| float | get_kinetic_friction () const |
| void | swap_bodies () |
| void | match_states () |
| void | resolve (const float time, const float restitution_cutoff) |
| void | resolve_velocity (const float time, ml7::Vector2 velocity_change[2], float rotation_change[2]) |
| void | resolve_position (const float time, ml7::Vector2 velocity_change[2], float rotation_change[2], const float angular_limit=0.0f) |
| bl7::rigidbodies2::Contact::~Contact | ( | void | ) | [inline] |
Destructor.
| bl7::rigidbodies2::Contact::Contact | ( | const Contact & | rhs | ) | [inline] |
Copy constructor.
| bl7::rigidbodies2::Contact::Contact | ( | RigidBody * | body, | |
| const ml7::Vector2 & | point, | |||
| const ml7::Vector2 & | normal, | |||
| const float | penetration, | |||
| const float | restitution, | |||
| const float | static_friction, | |||
| const float | kinetic_friction | |||
| ) | [inline] |
Explicit constructor with parameters for the rigid body colliding with the scenery, the contact point and normal in world coordinates, the interpenetration depth, the coefficient of restitution and the lateral friction coefficient.
| bl7::rigidbodies2::Contact::Contact | ( | RigidBody * | body1, | |
| RigidBody * | body2, | |||
| const ml7::Vector2 & | point, | |||
| const ml7::Vector2 & | normal, | |||
| const float | penetration, | |||
| const float | restitution, | |||
| const float | static_friction, | |||
| const float | kinetic_friction | |||
| ) | [inline] |
Explicit constructor with parameters for the two rigid bodies colliding with each other, the contact point and normal in world coordinates, the interpenetration depth, the coefficient of restitution and the lateral friction coefficient.
| bl7::rigidbodies2::Contact::Contact | ( | void | ) | [inline] |
Default constructor.
| const RigidBody* bl7::rigidbodies2::Contact::get_body1 | ( | ) | const [inline] |
Returns the (first) rigid body involved in the contact with another rigid body or the scenery.
| const RigidBody* bl7::rigidbodies2::Contact::get_body2 | ( | ) | const [inline] |
Returns the second rigid body involved in the contact. May be NULL if the (first) rigid body collides with the scenery.
| float bl7::rigidbodies2::Contact::get_kinetic_friction | ( | ) | const [inline] |
Returns the lateral kinetic friction coefficient at the contact.
| const ml7::Vector2& bl7::rigidbodies2::Contact::get_normal | ( | ) | const [inline] |
Returns the direction of the contact normal in world coordinates.
| float bl7::rigidbodies2::Contact::get_penetration | ( | ) | const [inline] |
Returns the amount of interpenetration at the contact.
| const ml7::Vector2& bl7::rigidbodies2::Contact::get_point | ( | ) | const [inline] |
Returns the position of the contact point in world coordinates.
| float bl7::rigidbodies2::Contact::get_restitution | ( | ) | const [inline] |
Returns the normal restitution coefficient (bounciness) at the contact.
| float bl7::rigidbodies2::Contact::get_static_friction | ( | ) | const [inline] |
Returns the lateral static friction coefficient at the contact.
| void bl7::rigidbodies2::Contact::match_states | ( | ) |
Matches the active states of the rigid bodies, waking that one that sleeps.
Copy assignment operator.
| void bl7::rigidbodies2::Contact::resolve | ( | const float | time, | |
| const float | restitution_cutoff | |||
| ) |
Resolves this contact for both velocity and interpenetration. Handles both the impulse calculations and interpenetration resolution for this contact.
Resolves this contact for both velocity and interpenetration.
| void bl7::rigidbodies2::Contact::resolve_position | ( | const float | time, | |
| ml7::Vector2 | velocity_change[2], | |||
| float | rotation_change[2], | |||
| const float | angular_limit = 0.0f | |||
| ) |
Resolves this contact for interpenetration. Handles the interpenetration resolution for this contact.
Handles the interpenetration resolution for this contact.
| void bl7::rigidbodies2::Contact::resolve_velocity | ( | const float | time, | |
| ml7::Vector2 | velocity_change[2], | |||
| float | rotation_change[2] | |||
| ) |
Resolves this contact for velocity. Handles the impulse calculations for this contact.
Handles the impulse calculations for this contact.
| void bl7::rigidbodies2::Contact::swap_bodies | ( | ) |
Swaps the rigid bodies and inverts the contact normal.
Swaps the bodies and inverts the contact normal.
The two rigid bodies involved in the contact as array.
The (first) rigid body involved in the contact with another rigid body or the scenery.
The second rigid body involved in the contact. May be NULL if the (first) rigid body collides with the scenery.
1.7.1