- Code: Select all
#define PLAYER_CALL_FERRY_DRIVER 4
#define PLAYER_BOARDED_FERRY_DRIVER 5
/*ADDED*/static int OnAABBOverlap (const NewtonMaterial* const material, const NewtonBody* const body0, const NewtonBody* const body1, int threadIndex) {
/*ADDED*/ return 0;
/*ADDED*/}
/*ADDED*/static void OnContactsProcess (const NewtonJoint* const contactJoint, dFloat timestep, int threadIndex) {
/*ADDED*/}
class PlaformEntityEntity;
class AdvancePlayerControllerManager;
// this demo use a trigger and player controller to automate the operation of a mini game environment
class TriggerManager: public CustomTriggerManager
{
public:
TriggerManager(NewtonWorld* const world, AdvancePlayerControllerManager* const playerManager)
:CustomTriggerManager(world)
,m_playerManager(playerManager)
{
/*ADDED*/ int material = NewtonMaterialGetDefaultGroupID (world);
/*ADDED*/ NewtonMaterialSetCollisionCallback (world, material, material, nullptr, OnAABBOverlap, OnContactsProcess);
}
virtual void EventCallback (const CustomTriggerController* const me, TriggerEventType event, NewtonBody* const visitor) const
{
It's a very simple test, but I assume it should prevent contacts between everything (character still works fine because it uses convex casting, I guess).
As one would expect, in older revisions, this is what happens, and the triggers atop the ramps do not work. However, If I apply this change in the latest revision, the trigger turns on but then it turns off if the character is moved within the trigger.
I guess it is a good example of the weird behaviour I was trying to describe (I don't know if it's the best way to test it for debugging, but this is as far as I have been able to get today with the sandbox).