True Axis Physics SDK 1.2.0.1 Beta Documentation
www.trueaxis.com

void TA::Physics::SetPreProcessCollisionCallBack (
PreProcessCollisionCallBack   pFnPreProcessCollision  ) [inline]
 

Call this function to the the preprocess collision call back.

The function provided by the user through this method will be called for each collision that occurs, before its affects are applied to the simulation. By returning false, users can choose to ignore a particular collision. Users may also modify the values contained in the collision changing the affect it will have.

Users may also set a callback after a collision is applied. See TA::Physics::SetPostProcessCollisionCallBack. During the postprocess call back, collision.fImpulse will be valid.

Note:
For an efficient way to ignore all collisions between 2 objects, see SetDynamicVsDynamicCollisionTestCallBack.
Parameters:
pFnPreProcessCollision
A pointer to the function that will be called for each collision. Set to 0 to disable the call back.
Example use
Defining the function.
    bool TA_CALL_BACK PreProcessCollision(TA::PreCollision& collision)
    {
        return true;
    }
Setting the function.
    TA::Physics::GetInstance().SetPreProcessCollisionCallBack(
        PreProcessCollision);
Warning:
Modifying DynamicObjects or calling Physics functions during the callback may potentially confuse the solver. It is recommended that this is avoided, however, users are free to experiment if the wish.
See also:
TA::Physics::GetPreProcessCollisionCallBack() and TA::Physics::PreProcessCollisionCallBack.



© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.