#include <SIM_Collider.h>

Public Types | |
| enum | SIM_ImpactApplyType { SIM_IMPACTAPPLY_NONE, SIM_IMPACTAPPLY_ONEWAY, SIM_IMPACTAPPLY_MUTUAL, SIM_IMPACTAPPLY_FEEDBACK } |
| Defines the possible affector types when doing collision detection. More... | |
Public Member Functions | |
| GETSET_DATA_FUNCS_B (SIM_NAME_REVERSEOBJECTROLES, ReverseObjectRoles) | |
| bool | collideObjects (SIM_Engine &engine, SIM_Object &object, SIM_Object &affector, const SIM_Time &starttime, const SIM_Time &endtime, SIM_ImpactApplyType impactapplytype, int impactflags) const |
Protected Member Functions | |
| SIM_Collider (const SIM_DataFactory *factory) | |
| The SIM_Collider constructor. | |
| virtual | ~SIM_Collider () |
| The SIM_Collider destructor. | |
| SIM_Impacts * | getObjectImpactData (SIM_Object &object, SIM_ImpactApplyType impactapplytype) const |
| SIM_Impacts * | getAffectorImpactData (SIM_Object &affector, SIM_ImpactApplyType impactapplytype) const |
| bool | getAffectorInterpolatedToEndTime () const |
| virtual bool | collideObjectsSubclass (SIM_Engine &engine, SIM_Object &object, SIM_Object &affector, const SIM_Time &starttime, const SIM_Time &endtime, SIM_ImpactApplyType impactapplytype, int impactflags) const |
| virtual bool | getAffectorInterpolatedToEndTimeSubclass () const |
Definition at line 31 of file SIM_Collider.h.
Defines the possible affector types when doing collision detection.
Definition at line 53 of file SIM_Collider.h.
| SIM_Collider::SIM_Collider | ( | const SIM_DataFactory * | factory | ) | [explicit, protected] |
The SIM_Collider constructor.
| virtual SIM_Collider::~SIM_Collider | ( | ) | [protected, virtual] |
The SIM_Collider destructor.
| bool SIM_Collider::collideObjects | ( | SIM_Engine & | engine, | |
| SIM_Object & | object, | |||
| SIM_Object & | affector, | |||
| const SIM_Time & | starttime, | |||
| const SIM_Time & | endtime, | |||
| SIM_ImpactApplyType | impactapplytype, | |||
| int | impactflags | |||
| ) | const |
Perform the collision detection for a pair of objects. This function calls the collideObjectsSubclass() function. This also attempts to do collision response.
| virtual bool SIM_Collider::collideObjectsSubclass | ( | SIM_Engine & | engine, | |
| SIM_Object & | object, | |||
| SIM_Object & | affector, | |||
| const SIM_Time & | starttime, | |||
| const SIM_Time & | endtime, | |||
| SIM_ImpactApplyType | impactapplytype, | |||
| int | impactflags | |||
| ) | const [protected, virtual] |
Override this method to implement your custom collision detection. This function can access any data on the main object or affector object. It can also add any extra data structures it needs to the object for efficiency (rather than recalculating the extra data each time this function is called).
Reimplemented in RBD_ColliderSDF, SIM_ColliderNone, and SIM_ColliderPoint.
| SIM_Impacts* SIM_Collider::getAffectorImpactData | ( | SIM_Object & | affector, | |
| SIM_ImpactApplyType | impactapplytype | |||
| ) | const [protected] |
Finds or creates the impact data on the affector that is appropriate for the given affector type. It also takes into account the value of the ReverseObjectRoles flag.
| bool SIM_Collider::getAffectorInterpolatedToEndTime | ( | ) | const [protected] |
Returns true if the collideObjects function should always be called with the affector object interpolated to the endtime. This function just calls getAffectorInterpolatedToEndTimeSubclass().
| virtual bool SIM_Collider::getAffectorInterpolatedToEndTimeSubclass | ( | ) | const [protected, virtual] |
Returns true if the collideObjects function should always be called with the affector object interpolated to the endtime. The default implementation returns true.
Reimplemented in SIM_ColliderNone.
| SIM_Impacts* SIM_Collider::getObjectImpactData | ( | SIM_Object & | object, | |
| SIM_ImpactApplyType | impactapplytype | |||
| ) | const [protected] |
Finds or creates the impact data on the affector that is appropriate for the given affector type. It also takes into account the value of the ReverseObjectRoles flag.
| SIM_Collider::GETSET_DATA_FUNCS_B | ( | SIM_NAME_REVERSEOBJECTROLES | , | |
| ReverseObjectRoles | ||||
| ) |
Specifies whether the object and affector need to be reversed to perform collision detection. This flag is useful for colliders that make assumptions about the makeup of the object and affector are in the call to collideObjectsSubclass(). For example, the point collider (SIM_ColliderPoint) always treats the object as a particle system, using ray casting to follow the trajectory of each particle. But suppose an RBD Solver has a particle system as an affector object. The RBD Solver would find that the best collider to use is a point collider. Rather than requiring that the RBD Solver then somehow discover that the particle object must always be sent as the "object" parameter, the collider can have the reverse object roles flag turned on. Then when the RBD Solver calls the collider with the RBD object first and the particle object second, the collider itself will reverse the objects before passing them on to collideObjectSubclass().
1.5.9