ios - Reproducing exact same physics simulation -
i'm running physics simulation on box. when node stops, change it's position, set it's rotation , apply force. 3 parameters always same, yet physics simulation different. difference in not big, surely noticeable. how avoid , reproduce exact same physics simulation every time? help
/// code gets executed repeatedly starnode.physicsbody?.velocity = scnvector3zero applyforce() ///always same starnode.eulerangles = scnvector3make(0, float(90*(m_pi)/180.0), 0) starnode.position = scnvector3make(-0.562, 5.578, -18.529)
there minute differences between timings of callings of applyforce() , when set velocity.
if have amount of drag, gravity or other force influencing physicsbody's velocity between when set velocity , when apply force, there'll slight difference in outcome because applying force object velocity additive.
so each time box slows down little bit more or less before force applied, different result in addition of force applied.
Comments
Post a Comment