Skip to content

Physics

Narta Xaymar Dirks edited this page Nov 5, 2026 · 1 revision

Physics

A physics body is an entity, so it can be moved, hidden and freed like any other, but it is not a collider: a body is never part of Collisions, EntityType on it is an error, and the picks of LinePick and EntityPick do not see it. The two worlds are separate on purpose, so a program pays for physics only when it creates a body.

Bodies

CreatePhysicsBody makes a body in the shape of a box, sphere, ellipsoid, capsule, cylinder or tapered capsule. CreatePhysicsBodyFromEntity makes a new body from the vertices of an entity (a box, a convex hull or, for static bodies, the mesh), and leaves that entity as it was. Parent the visible mesh to the body with EntityParent mesh, body, True to make it follow.

A body is static (does not move), kinematic (moved by the program, pushes others) or dynamic (moved by the simulation). PhysicsBodyMotion changes it. A mesh can be static or kinematic, never dynamic.

Stepping

PhysicsUpdate moves time forward by the seconds that are given (or by the time since its last call). UpdateWorld does not step physics. PhysicsMode 0 (default) simulates in steps of 1 / PhysicsRate seconds, at most PhysicsMaxSteps per call, and RenderWorld draws bodies between the last two steps, so motion is smooth at any frame rate. Mode 1 does one step with the time that is given, without smoothing.

Moving a body entity with PositionEntity or RotateEntity teleports the body to the new pose at the next PhysicsUpdate.

Solver

PhysicsSolver picks a preset: 0 balanced, 1 fast, 2 accurate (continuous collision on) and 3 custom, which any single setting such as PhysicsVelocityIterations selects. The simulation is deterministic for the same inputs on every thread count.

Worlds

CreatePhysicsWorld makes another world that has its own gravity, settings and bodies, and every command that takes a world has a trailing world argument, where 0 is the default world.

Turning commands such as PhysicsApplyTorque use degrees and the turning sense of TurnEntity; vectors are in the space of the body unless global is true.

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

Clone this wiki locally