Sable drives sub-level motion through an abstractedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ryanhcode/sable/llms.txt
Use this file to discover all available pages before exploring further.
PhysicsPipeline interface backed by Rapier, a Rust physics engine. Physics runs server-side only, at 20 ticks per second with a configurable number of substeps per tick. The pipeline treats each sub-level as a rigid body with mass and inertia derived from its blocks, and exposes a clean Java API for applying forces, reading velocities, teleporting bodies, and adding constraints between them.
The Rapier integration is implemented in Rust. Building Sable from source requires Docker to compile the native library. Pre-built binaries are distributed with release artifacts, so you only need Docker if you are modifying the physics backend itself. See the installation guide for details.
The PhysicsPipeline interface
PhysicsPipeline is the entry point for all physics operations. You do not instantiate it directly; Sable creates and attaches an implementation to each ServerSubLevelContainer at world load time. Access it through the container:
Tick lifecycle
Each game tick, the pipeline runs through three phases:prePhysicsTicks()— prepares the simulation state for the current tick.physicsTick(double timeStep)— advances the simulation by one substep. This is called multiple times per tick; each call receives atimeStepof1.0 / 20.0 / substepsseconds.postPhysicsTicks()— finalizes the tick and makes the updated poses available for reading.
tick() call handles data tracking and other logic that should run even when physics is paused.
Reading pose
AfterpostPhysicsTicks(), you can read the current pose of any sub-level’s physics body:
Teleportation
To move a body instantly without simulation, useteleport:
Applying forces
applyImpulse
Applies a force at a specific world position on the body. The resulting torque is calculated automatically from the offset between the application point and the center of mass.
force is in Newtons [N].applyLinearAndAngularImpulse
Applies a linear force and a torque directly to the body’s center of mass. Pass
wakeUp = true to resume a sleeping body.torque is in Newton-meters [Nm].Reading velocity
addLinearAndAngularVelocity, or zero everything out with resetVelocity.
Waking up bodies
Rapier puts bodies to sleep when they stop moving to save CPU. If you change a body’s environment (e.g. by adding or removing blocks) without applying a force, callwakeUp to resume simulation:
Constraints
Constraints create joints between two sub-levels (or between a sub-level and the world). Passnull for either sub-level argument to pin the other to the world:
configuration parameter is a PhysicsConstraintConfiguration that describes the joint type and its parameters. Hold the returned PhysicsConstraintHandle to remove or update the constraint later.
Block physics properties
The mass, inertia tensor, volume, restitution, and friction of a sub-level’s rigid body are derived from the blocks it contains. Sable reads physics properties from each block and accumulates them into the body’sMassData. You can configure per-block physics properties using the block physics properties data-driven system.
