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

void TA::Physics::SetDynamicVsDynamicCollisionTestCallBack (
DynamicVsDynamicCollisionTestCallBack   pFnDynamicVsDynamicCollisionTest  ) [inline]
 

This function allows users to provide their own function to be called before each collision test between 2 dynamic objects is performed during TA::Physics::Update. The provided function will only be called when at least one of the objects are moving and it has been determined that the objects are in close proximity.

Users can use this functionality as flexible way to disallow collisions between objects if they so wish before full and more computationally expensive collision testing is done. If the callback returns 0, the collision test will be skipped.

Alternatively, uses can use collision groups for a fast way to disallow collisions. See TA::DynamicObject::DisallowCollisionWithUserGroupItemId(). Although this is fast, it is not as flexible.

Parameters:
pFnDynamicVsDynamicCollisionTest
A pointer to the function that will be called before the collision test. Set to 0 to disable the call back.
    bool TA_CALL_BACK OnDynamicVsDynamicCollisionTest(DynamicObject& objectA, StaticObject& objectB)
    {
        return true;
    }
Setting the function.
    TA::Physics::GetInstance().SetOnDynamicVsDynamicCollisionTestCallBack(
        OnDynamicVsDynamicCollisionTest);
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::GetDynamicVsDynamicCollisionTestCallBack() and TA::Physics::DynamicVsDynamicCollisionTestCallBack.



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