Jump to content

physicalTrigger


photo

Recommended Posts

Like collision handling of the body contact example, should not the physics trigger not modify the node within the callback function?

 So, I can't modify the node using the functions below in the callback function for modify node?

 

then, what does it usually do in a callback function?

 

 

Edited by dongju.jeong
Link to comment

Hi Dongju,

Right, you shouldn't modify nodes within a physical callback.

Please take note, that if you set any physics-based callbacks in the flush() or use PhysicalTrigger, they cannot be executed immediately, as the rendering process is already in action and they can violate it. If there is one more physics iteration to go, they are executed before the next flush(); if not, before the next world script update().

In a physical callback you normally operate with bodies, set velocities, add impulses, do the physical kind of things. If you want to reposition or transform, create or delete nodes that are returned by your physics callback, the workflow is as follows: put them into some array and then perform all necessary actions in update().

As for the functions listed by you actually do not modify a node, they're all just getters, so you can use any of them.

Thank you!

Link to comment
×
×
  • Create New...