Skip to content
Konjure / spatial intelligence

RigidBody

← Builtin reference

Physical-body configuration for a Sphere or Box entity.

Signature

type RigidBody {
  kind: Str = "dynamic";
  mass: Number = 1;
  velocity: Vec3 = Vec3 {};
  angular_velocity: Vec3 = Vec3 {};
  restitution: Number = 0.3;
  friction: Number = 0.5;
}

kind must be dynamic, fixed, or kinematic. Only dynamic bodies accept Force or Impulse; fixed bodies must have zero velocities.

Fields

kind: Str
dynamic, fixed, or kinematic; defaults to dynamic.
Default"dynamic"
mass: f64
Positive mass used by the collider; defaults to 1.
Default1
velocity: Vec3
Linear velocity in meters per second; defaults to zero.
DefaultVec3 {}
angular_velocity: Vec3
Angular velocity in radians per second; defaults to zero.
DefaultVec3 {}
restitution: f64
Bounciness in 0..=1; defaults to 0.3.
Default0.3
friction: f64
Contact friction in 0..=1; defaults to 0.5.
Default0.5

Examples

Advance a dynamic sphere

Systems run before physics in each fixed tick, so the second callback observes the position advanced by the first integration step.

Press Step 2 times to reach the checked result.

Tick 0 · 0.00 sThis device
main.kj⌘ / Ctrl + Enter
Loading…Drag to orbit · select to inspect
0 entities
Loading the language runtime…
Output 0
No output.
Expected output
true

Choose a fixed body

Fixed bodies keep zero velocity.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
fixed

Rust definition

Interpreter RecordValue physics schema consumed by the Rapier-backed spatial adapter.

See also