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
371 views Asked by Coldsteel48 At
1
You could use Key-Value Observation on the
isRestingproperty. See Is key-value observation (KVO) available in Swift?.Or you could use the
SCNPhysicsContactandSCNPhysicsContactDelegateto detect collisions with the floor, and use that to trigger a check for velocity.