All contacts are detected and resolved locally within Pegasus.
There is pegasus::Debug::s_collisionDetectionCall callback hook allowing user code to process detected contacts for debug purposes only
Use case
Trigger some events upon any contact selected Primitive is a part of.
Examples:
play some sound whenever Primitive collides with anything
create particle effect whenever Primitive collides with anything
Points to consider
Meta information regarding collision can also be interesting. Not only Primitive handles that are in contact, but also calculations about their collision.
Example: relative velocities can be used to determine the volume of the sound or amount of particle effects.
I will test existing pegasus::Debug::s_collisionDetectionCall callback to see how handy this model would be if this information was exposed via some public interface as opposed to debug hook. Ultimately triggers/logic based on these contacts is inside user code so as long as traversing contact collection does not result in some huge overhead, it would be a viable solution.
Sidenotes:
these use cases apply only to physical objects; logical contacts/collisions can be (and probably should be) processed externally using Arion itself
callback/trigger mechanisms are not a part of this feature; data about collisions shall suffice
it's hard to completely account for possible scenarios; it is possible that number of triggerless objects in the scene would be far greater than the ones that have some actions associated with contacts
Current state
All contacts are detected and resolved locally within Pegasus. There is
pegasus::Debug::s_collisionDetectionCall
callback hook allowing user code to process detected contacts for debug purposes onlyUse case
Trigger some events upon any contact selected
Primitive
is a part of. Examples:Primitive
collides with anythingPrimitive
collides with anythingPoints to consider
Meta information regarding collision can also be interesting. Not only
Primitive
handles that are in contact, but also calculations about their collision. Example: relative velocities can be used to determine the volume of the sound or amount of particle effects.I will test existing
pegasus::Debug::s_collisionDetectionCall
callback to see how handy this model would be if this information was exposed via some public interface as opposed to debug hook. Ultimately triggers/logic based on these contacts is inside user code so as long as traversing contact collection does not result in some huge overhead, it would be a viable solution.Sidenotes:
Arion
itself