# World

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

The physics world steps all bodies together at the fixed rate, 60 times a second by default, never with the frame time. This page describes how it moves bodies and what the material values mean.

## Steps

Each step finds contacts once, then solves in substeps, 4 by default. A substep applies gravity, pushes overlapping shapes apart, moves the bodies and settles the push so it does not turn into a bounce. More substeps give stiffer contacts; see [Settings](/physics/settings.md).

A body moves at most a set distance and angle per step. Small fast bodies should set `Bullet`: their contacts look ahead by the distance they travel in one step.

Every body and shape is checked when it is made. Invalid numbers, negative sizes, concave polygons and zero-length segments are rejected with an error, and the world stays as it was.

## Materials

| Material | Meaning | When two shapes touch |
|---|---|---|
| `Friction` | 0 is ice, 1 is rubber | `sqrt(a·b)` |
| `Restitution` | 0 stops, 1 bounces back at full speed | `max(a, b)` |
| `Density` | mass per square unit | — |

Very slow bounces are not restituted, so resting bodies stay at rest.

## Sleep

A group of touching bodies falls asleep when all of them have moved slowly for a while. A contact with an awake body, a force, an impulse, a teleport or a new joint wakes the group.

## Determinism

The same game on the same CPU with the same input gives the same result every time. Rewinding Play in the editor relies on this.
