Coldwave Read the docs

Protocol: physics#

The physics commands a program sends to a running game, as the engine describes them: what each takes, what it answers and what it does. Back to all commands.

physics.read#

physics.read {} -> {step: integer, paused: value, shapes: [record], contacts: [record], joints: [record], vehicles: [record]} · read, read-only

Reads every collider's shape, every point where bodies touch, every joint and every vehicle's wheels, as the last step left them, in world units, each shape as large as its thing's scale makes it: what an editor draws over the game.

ResultTypeMeaning
stepintegerHow many fixed steps have run.
pausedvaluetrue while a script holds the simulation with physics.pause(true): nothing moves, and the answer stays as the last step that ran left it.
shapes[record]One {entity, body, points, radius, closed, sensor, one_way} per shape, in entity order. body is "static", "kinematic", "dynamic" or "mover". points are [x, y] pairs: one with a radius is a circle, two with a radius a capsule, more an outline that joins up when closed is true. In a 3D game (space = "3d") one {entity, body, shape, size, at, turn, sensor} instead: shape is "box", "sphere", "capsule" or "cylinder", size its width, height and depth, at its middle [x, y, z] and turn a quaternion [x, y, z, w]; contacts are empty there, and each joint is {entity, kind, a, b, axis}: where it holds what it is joined to and its own entity, [x, y, z] each, and a hinge's axle or a slider's line one long ([0, 0, 0] for the rest).
contacts[record]One {a, b, at, normal} per point where a moving body touches something: the two entities, the point, and the unit direction from a to b.
joints[record]One {entity, kind, a, b} per joint, in entity order: the entity that has the Joint, its kind, the point it holds on what it is joined to and the point it holds on its own entity. The two are the same point for every kind but "distance", unless the joint is being pulled apart.
vehicles[record]One {entity, wheels} per Vehicle of a 3D game, in entity order: the entity that has it, and its four wheels, front left, front right, back left, back right, each {x, y, z, qx, qy, qz, qw, touching}: its middle, its turn as a quaternion (the car's, then its steering, then its rolling: that of a wheel shaped in the car's own frame, its axle along x) and whether it is on something. Empty in a 2D game.

Generated from Coldwave 0.0.1 r289, 2026-11-30 by the binary itself: do not edit by hand.