Colliders and Constraints in glTF Physics Extensions

Emerging glTF physics extensions, primarily developed under the Khronos Group’s draft KHR_physics_rigid_bodies specification, introduce standardized real-time physics metadata directly into 3D asset transmission. This article outlines the specific collider geometries and kinematic constraints supported by these emerging specifications, detailing how analytical shapes, arbitrary meshes, and mechanical joints are structured to enable consistent physics simulation across diverse game engines and runtimes.

Supported Colliders

Colliders in glTF define the collision geometry independent of the visual render mesh. The specification categorizes colliders into elementary analytical primitives and arbitrary mesh representations.

  • Box: Defined by half-extents along the local X, Y, and Z axes. Boxes are computationally inexpensive and ideal for structural elements, crates, and boundaries.
  • Sphere: Defined by a single radius parameter. Like boxes, spheres allow for closed-form mathematical collision tests without mesh deformation costs.
  • Capsule: Defined by a radius and a cylinder height along a designated axis (typically the Y or Z axis depending on coordinate orientation), terminated by hemispherical ends. Capsules are widely used for character controllers and rounded limbs.
  • Cylinder: Defined by a radius and height. Unlike capsules, cylinders feature flat circular end-caps, useful for wheels, barrels, and mechanical pins.
  • Convex Hull: Defined by referencing a standard glTF mesh primitive or explicit vertex stream, wrapped in a computed convex envelope. Convex hulls allow custom geometric approximation with high collision performance and stability.
  • Triangle Mesh (Concave Trimesh): References standard indexed triangle geometry directly. Typically limited to static terrain or immobile environment obstacles because non-convex dynamic mesh-to-mesh collisions are computationally prohibitive in standard physics engines.

Supported Kinematic Constraints

Kinematic constraints (often termed joints) restrict relative translation and rotation between two rigid bodies, or between a single rigid body and the world space. Rather than relying solely on engine-specific joint names, the glTF specification utilizes a generalized six-degree-of-freedom (6-DOF) framework alongside common specialized constraints.

  • Fixed (Weld) Constraints: Locks all three linear degrees of freedom (X, Y, Z) and all three angular degrees of freedom (pitch, yaw, roll), rigidly securing two bodies together at an offset.
  • Revolute (Hinge) Constraints: Permits rotation along a single designated axis while locking all translational movement and the remaining two rotational axes. These constraints support angular limits (minimum and maximum angles), drive motors, and friction settings.
  • Prismatic (Slider) Constraints: Allows linear translation along a single axis while constraining all angular movement and the other two linear dimensions. These are defined with linear travel limits and optional linear drive targets.
  • Spherical (Ball-and-Socket) Constraints: Allows free rotation across all three angular axes while fixing the anchor points together, restricting all translation. Rotational motion can be constrained using cone-limit or twist-limit parameters.
  • Generic 6-DOF Constraints: A fully configurable constraint where each of the three linear and three angular axes can be individually designated as locked, free, or limited. This allows complex mechanical behaviors—such as universal joints, cylindrical joints, or suspension setups—to be modeled within a single unified structure.

Each constraint definition specifies the local frames of reference (anchor points and orientations) on both connected bodies, along with spring, damping, and motor properties to replicate mechanical resistance and actuated movement.