SceneKit
Is there a way to get notified when dynamicBody
is in resting State ?
I want to remove dynamicBody
when it finished to fall to the ground and stopped moving completely - I presume that I will have quite large amount of those so I would like to use something event based rather than looping through all the bodies
and checking their velocities ?
SceneKit SCNPhysicsBody get notified of resting
348 views Asked by Coldsteel48 At
1
You could use Key-Value Observation on the
isResting
property. See Is key-value observation (KVO) available in Swift?.Or you could use the
SCNPhysicsContact
andSCNPhysicsContactDelegate
to detect collisions with the floor, and use that to trigger a check for velocity.