Cyclone | Cyclone: cyclone::ContactResolver Class Reference |
#include <contacts.h>
Public Member Functions | |
ContactResolver (unsigned iterations, real velocityEpsilon=(real) 0.01, real positionEpsilon=(real) 0.01) | |
Creates a new contact resolver with the given number of iterations per resolution call, and optional epsilon values. | |
ContactResolver (unsigned velocityIterations, unsigned positionIterations, real velocityEpsilon=(real) 0.01, real positionEpsilon=(real) 0.01) | |
Creates a new contact resolver with the given number of iterations for each kind of resolution, and optional epsilon values. | |
bool | isValid () |
Returns true if the resolver has valid settings and is ready to go. | |
void | setIterations (unsigned velocityIterations, unsigned positionIterations) |
Sets the number of iterations for each resolution stage. | |
void | setIterations (unsigned iterations) |
Sets the number of iterations for both resolution stages. | |
void | setEpsilon (real velocityEpsilon, real positionEpsilon) |
Sets the tolerance value for both velocity and position. | |
void | resolveContacts (Contact *contactArray, unsigned numContacts, real duration) |
>ContactResolverBase ContactResolverBase | |
Public Attributes | |
unsigned | velocityIterationsUsed |
Stores the number of velocity iterations used in the last call to resolve contacts. | |
unsigned | positionIterationsUsed |
Stores the number of position iterations used in the last call to resolve contacts. | |
Protected Member Functions | |
void | prepareContacts (Contact *contactArray, unsigned numContacts, real duration) |
Sets up contacts ready for processing.PrepareContacts. | |
void | adjustVelocities (Contact *contactArray, unsigned numContacts, real duration) |
Resolves the velocity issues with the given array of constraints, using the given number of iterations. | |
void | adjustPositions (Contact *contacts, unsigned numContacts, real duration) |
Resolves the positional issues with the given array of constraints, using the given number of iterations. | |
Protected Attributes | |
unsigned | velocityIterations |
Holds the number of iterations to perform when resolving velocity. | |
unsigned | positionIterations |
Holds the number of iterations to perform when resolving position. | |
real | velocityEpsilon |
To avoid instability velocities smaller than this value are considered to be zero. | |
real | positionEpsilon |
To avoid instability penetrations smaller than this value are considered to be not interpenetrating. |
One resolver instance can be shared for the whole simulation, as long as you need roughly the same parameters each time (which is normal). /<ContactResolver
Many global algorithms are unstable under high friction, this approach is very robust indeed for high friction and low restitution values.
The algorithm produces visually believable behaviour. Tradeoffs have been made to err on the side of visual realism rather than computational expense or numerical accuracy.
Another issue with the resolution mechanism is that resolving one contact may make another contact move sideways against friction, because each contact is handled independently, this friction is not taken into account. If one object is pushing against another, the pushed object may move across its support without friction, even though friction is set between those bodies.
In general this resolver is not suitable for stacks of bodies, but is perfect for handling impact, explosive, and flat resting situations. />ContactResolver
|
Creates a new contact resolver with the given number of iterations per resolution call, and optional epsilon values.
|
|
Creates a new contact resolver with the given number of iterations for each kind of resolution, and optional epsilon values.
|
|
Resolves the positional issues with the given array of constraints, using the given number of iterations.
|
|
Resolves the velocity issues with the given array of constraints, using the given number of iterations.
|
|
Returns true if the resolver has valid settings and is ready to go.
|
|
Sets up contacts ready for processing.PrepareContacts. This makes sure their internal data is configured correctly and the correct set of bodies is made alive. |
|
>ContactResolverBase ContactResolverBase /<ContactResolverBase Contacts that cannot interact with each other should be passed to separate calls to resolveContacts, as the resolution algorithm takes much longer for lots of contacts than it does for the same number of contacts in small sets.
|
|
Sets the tolerance value for both velocity and position.
|
|
Sets the number of iterations for both resolution stages.
|
|
Sets the number of iterations for each resolution stage.
|
|
To avoid instability penetrations smaller than this value are considered to be not interpenetrating. Too small and the simulation may be unstable, too large and the bodies may interpenetrate visually. A good starting point is the default of0.01. |
|
Holds the number of iterations to perform when resolving position.
|
|
Stores the number of position iterations used in the last call to resolve contacts.
|
|
To avoid instability velocities smaller than this value are considered to be zero. Too small and the simulation may be unstable, too large and the bodies may interpenetrate visually. A good starting point is the default of 0.01. |
|
Holds the number of iterations to perform when resolving velocity.
|
|
Stores the number of velocity iterations used in the last call to resolve contacts.
|
© 2000-2003 Icosagon. All Rights Reserved.
Distributed under licence.
Cyclone Version 2.0.5 (Documentation generated Fri Nov 10 20:44:21 2006). |