‹›
Introduction

About JoltPhysics

A native 3D physics extension that brings Jolt Physics to GameMaker.

JoltPhysics combines a Windows x64 native bridge with a GML high-level runtime. It exposes rigid bodies, collision shapes, constraints, layers, sensors, contacts, raycasts, characters, cloth, and debug drawing through GameMaker-friendly managed values.

What it provides#

  • Dynamic, Static, and Kinematic rigid bodies.
  • Primitive, convex, mesh, heightfield, compound, and reusable shape resources.
  • Material and motion properties, forces, impulses, and transform access.
  • Collision layers, sensors, contact events, and filtered raycasts.
  • Constraints, paths, virtual characters, cloth simulation, and debug visualization.
  • A managed default world with fixed-step updates and safe generational handles.

Architecture#

LayerResponsibility
Jolt Physics 5.6.0Native simulation, collision detection, constraints, and queries.
JoltBridge_x64.dllValidated C++ boundary and safe numeric handles.
jolt_apiLow-level GML functions closely matching the native bridge.
jolt_high_levelManaged JoltBody/JoltLayer resources, errors, fixed timing, contacts, and convenience creators.
GameMaker projectGameplay state, rendering, input, ownership, and explicit synchronization.

Current platform#

The present native extension targets Windows x64. Other GameMaker targets are not currently supported by the packaged bridge. Platform coverage may expand later, but projects should not assume cross-platform compatibility yet.

High-level and low-level API#

Most games should begin with jolt_start(), high-level body creators such as jolt_box_create_dynamic(), and jolt_update(). The low-level world/handle functions remain available for advanced ownership or diagnostics, but they require manual lifecycle and error handling.

What JoltPhysics does not do automatically#

  • It does not render bodies as game art.
  • It does not automatically bind every GameMaker instance to a body.
  • It does not automatically synchronize instance transforms each frame.
  • It does not choose gameplay units, collision layers, or ownership rules for your game.
  • It does not replace GameMaker objects, rooms, events, or input handling.

Core lifecycle#

GML
jolt_start();

var ground = jolt_box_create_static(0, 0, -0.5, 20, 20, 1);
var body = jolt_box_create_dynamic(0, 0, 4, 1, 1, 1);

jolt_update();
var position = body.get_position();

jolt_stop();

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
jolt_bbmod_camera_follow_characterjolt_bbmod_camera_follow_character(camera, character, yaw, pitch)Camera exposing Position/Target/Up.Set, live Character, yaw/pitch° → Boolean. Copies character.get_view_transform; apply after Character movement.
jolt_get_physics_qualityjolt_get_physics_quality()DEFAULT/HIGH in a running world; setter Boolean, getter enum/undefined. Opt-in HIGH raises minimum substeps/iterations and tightens CCD; DEFAULT preserves ordinary settings.
jolt_managed_body_countjolt_managed_body_count()Reads managed state without stepping: started Boolean / world handle / fixed_dt s / cumulative step count / valid body-wrapper count. Wrapper count is not a validation of every native handle.
jolt_managed_character_countjolt_managed_character_count()Count of wrappers with valid=true in the managed registry. Not an additional validation of each native handle.
jolt_quaternion_from_eulerjolt_quaternion_from_euler(x_degrees, y_degrees, z_degrees)XYZ angles in degrees → new {x, y, z, w} quaternion, order qZ*qY*qX. Pure calculation without a world; does not validate nonnumeric input.
jolt_set_physics_qualityjolt_set_physics_quality(quality)DEFAULT/HIGH in a running world; setter Boolean, getter enum/undefined. Opt-in HIGH raises minimum substeps/iterations and tightens CCD; DEFAULT preserves ordinary settings.