Cyclone | Cyclone: cyclone::Contact Class Reference |
#include <contacts.h>
Collaboration diagram for cyclone::Contact:
Public Member Functions | |
void | setBodyData (RigidBody *one, RigidBody *two, real friction, real restitution) |
Sets the data that doesn't normally depend on the position of the contact (i.e. | |
Public Attributes | |
RigidBody * | body [2] |
Holds the bodies that are involved in the contact. | |
real | friction |
Holds the lateral friction coefficient at the contact. | |
real | restitution |
Holds the normal restitution coefficient at the contact. | |
Vector3 | contactPoint |
Holds the position of the contact in world coordinates. | |
Vector3 | contactNormal |
Holds the direction of the contact in world coordinates. | |
real | penetration |
Holds the depth of penetration at the contact point.ContactIntro. | |
Protected Member Functions | |
void | calculateInternals (real duration) |
Calculates internal data from state data. | |
void | swapBodies () |
Reverses the contact.ContactCalculateInternals. | |
void | matchAwakeState () |
Updates the awake state of rigid bodies that are taking place in the given contact. | |
void | calculateDesiredDeltaVelocity (real duration) |
Calculates and sets the internal value for the desired delta velocity. | |
Vector3 | calculateLocalVelocity (unsigned bodyIndex, real duration) |
Calculates and returns the velocity of the contact point on the given body. | |
void | calculateContactBasis () |
Calculates an orthonormal basis for the contact point, based on the primary friction direction (for anisotropic friction) or a random orientation (for isotropic friction). | |
void | applyImpulse (const Vector3 &impulse, RigidBody *body, Vector3 *velocityChange, Vector3 *rotationChange) |
Applies an impulse to the given body, returning the change in velocities. | |
void | applyVelocityChange (Vector3 velocityChange[2], Vector3 rotationChange[2]) |
Performs an inertia-weighted impulse based resolution of this contact alone. | |
void | applyPositionChange (Vector3 velocityChange[2], Vector3 rotationDirection[2], real rotationAmount[2], real penetration) |
Performs an inertia weighted penetration resolution of this contact alone. | |
Protected Attributes | |
Matrix3 | contactToWorld |
A transform matrix that converts co-ordinates in the contact's frame of reference to world co-ordinates. | |
Vector3 | contactVelocity |
Holds the closing velocity at the point of contact. | |
real | desiredDeltaVelocity |
Holds the required change in velocity for this contact to be resolved. | |
Vector3 | relativeContactPosition [2] |
Holds the world space position of the contact point relative to centre of each body.ContactInternalData. |
Resolving a contact removes their interpenetration, and applies sufficient impulse to keep them apart. Colliding bodies may also rebound. Contacts can be used to represent positional joints, by making the contact constraint keep the bodies in their correct orientation. /<ContactIntro
It can be a good idea to create a contact object even when the contact isn't violated. Because resolving one contact can violate another, contacts that are close to being violated should be sent to the resolver; that way if one resolution moves the body, the contact may be violated, and can be resolved. If the contact is not violated, it will not be resolved, so you only loose a small amount of execution time.
The contact has no callable functions, it just holds the contact details. To resolve a set of contacts, use the contact resolver class. />ContactIntro
|
Applies an impulse to the given body, returning the change in velocities.
|
|
Performs an inertia weighted penetration resolution of this contact alone.
|
|
Performs an inertia-weighted impulse based resolution of this contact alone.
|
|
Calculates an orthonormal basis for the contact point, based on the primary friction direction (for anisotropic friction) or a random orientation (for isotropic friction).
|
|
Calculates and sets the internal value for the desired delta velocity.
|
|
Calculates internal data from state data. This is called before the resolution algorithm tries to do any resolution. It should never need to be called manually. |
|
Calculates and returns the velocity of the contact point on the given body.
|
|
Updates the awake state of rigid bodies that are taking place in the given contact. A body will be made awake if it is in contact with a body that is awake. |
|
Sets the data that doesn't normally depend on the position of the contact (i.e. the bodies, and their material properties). |
|
Reverses the contact.ContactCalculateInternals. This involves swapping the two rigid bodies and reversing the contact normal. The internal values should then be recalculated using calculateInternals (this is not done automatically). |
|
Holds the bodies that are involved in the contact. The second of these can be NULL, for contacts with the scenery. |
|
Holds the direction of the contact in world coordinates.
|
|
Holds the position of the contact in world coordinates.
|
|
A transform matrix that converts co-ordinates in the contact's frame of reference to world co-ordinates. The columns of this matrix form an orthonormal set of vectors. |
|
Holds the closing velocity at the point of contact. This is set when the calculateInternals function is run. |
|
Holds the required change in velocity for this contact to be resolved.
|
|
Holds the lateral friction coefficient at the contact.
|
|
Holds the depth of penetration at the contact point.ContactIntro. If both bodies are specified then the contact point should be midway between the inter-penetrating points. |
|
Holds the world space position of the contact point relative to centre of each body.ContactInternalData. This is set when the calculateInternals function is run. |
|
Holds the normal restitution coefficient at the contact.
|
© 2000-2003 Icosagon. All Rights Reserved.
Distributed under licence.
Cyclone Version 2.0.5 (Documentation generated Fri Nov 10 20:44:21 2006). |