Log inGet started
World

Rolling Bones: Physics Dice, Cups, Towers and Trays Kit

README.md

diceKit.sim

Rolls dice with the engine's own rigid bodies (Physics dynamic bodies with hull colliders) and records them. Only the simulating peer calls Sim.start: it builds a copy of the tray's colliders far below the world, one lane per roll so nothing of the game touches the dice, drops the dice in with their launch state, steps them in the engine's physics (step hooks drive the cup), writes poses and sound cues to a recording at 30 frames a second, nudges a cocked die and reads the faces once every die is still. resume continues a roll from its last recorded frame when a new simulating peer takes over. Sim.result reads a recording's last frame into values and a total (a d100 counts as one value). Works in edit mode under Physics.advance, which is how the tests roll.