Trigger objects
by Mike Lilligreen · in Torque 2D Professional · 05/25/2013 (2:54 am) · 2 replies
Looking through the trigger code, it is basically just a SceneObject with 3 extra callbacks added for when another object enters/stays/leaves.
Just out of curiosity, are there practical reasons for this to be a separate class (besides the fact that the name clearly lets you know what it is) instead of rolling those callbacks into SceneObjects? Then other objects like Sprites can directly be triggers without having to create 2 objects in a scene to get the same functionality.
Edit: perhaps better phrased, would there be interest in merging the trigger functionality into SceneObject or should they be kept separate?
Just out of curiosity, are there practical reasons for this to be a separate class (besides the fact that the name clearly lets you know what it is) instead of rolling those callbacks into SceneObjects? Then other objects like Sprites can directly be triggers without having to create 2 objects in a scene to get the same functionality.
Edit: perhaps better phrased, would there be interest in merging the trigger functionality into SceneObject or should they be kept separate?
About the author
#2
It is definitively working as it is now, could be a bit more friendly when it comes to sensor, but work.
06/03/2013 (1:27 am)
Just looked at the trigger class and it's indeed pretty badly designed and mostly useless now. But it could be a good idea to add a way to register trigger callback object to a scene object which in turn assign it to one of its collision shapes and thus not have to deal with box2d (ie any reference to it should really be abstracted away from any external calls) the callback object could then call a function pointer on the desired sim object signalling the event.It is definitively working as it is now, could be a bit more friendly when it comes to sensor, but work.
Torque Owner Richard Ranft
Roostertail Games