scaling physicsWorld.timeStep

Wrote a simple SceneKit app for rolling dice. To start w/ i just assumed the dice had a side dimension of 1 (though i did set a density to acrylic and did calculate and assign the mass to physicsBody!.mass). Simulation runs fine. Looks fine (pretty cool, actually).


Then decided to try to use a realistic size of dice (i.e. instead of 1 meter, said to use 0.02 meter). Now the dice are constantly jiggling around. If i try to roll the dice, they basically move so fast as they can escape the box (collision failure).


so then i decreased scene.physicsWolrd.timeStep from the default 1/60. However, as i go smaller and smaller on this value, the dice jitter even more (though they don't escape the box when rolled).


there appears to be 'stochastic' forces acting on the dice that do NOT scale with the mass of the dice.


any clue?

Accepted Reply

Best i could do is reduce the dice size from 1m to 100cm and reduced timeStep to 1/120 second. This combination makes the dice roll appear physical for a more typical dice size of 1.4cm.


Oh well.

Replies

Best i could do is reduce the dice size from 1m to 100cm and reduced timeStep to 1/120 second. This combination makes the dice roll appear physical for a more typical dice size of 1.4cm.


Oh well.