Engine API Reference - v2.23.0-beta.23
    Preparing search index...

    Class JoltPhysicsWorldAlpha

    The Jolt Physics backend, built on JoltPhysics.js - the WebAssembly port of the Jolt Physics engine. JoltPhysics.js is an ES module that creates no global, so the initialized module is passed to the constructor. Load the library first, then supply the backend to the application:

    import initJolt from 'jolt-physics/wasm';

    const Jolt = await initJolt();

    const options = new AppOptions();
    options.physicsWorld = new JoltPhysicsWorld(Jolt);

    The single-threaded flavors of the library (wasm, wasm-compat and asm) are supported.

    Physics components behave as they do with the Ammo backend, apart from these differences:

    • Fast dynamic bodies use continuous collision detection, so they do not pass through thin colliders the way they can with Ammo.
    • Rolling friction is not supported.
    • Linear and angular factors can only lock an axis: any factor other than 0 leaves the axis free.
    • Angular velocity is limited to about 47 radians per second, Jolt's default.
    • Contact impulses are estimated from the speed at which the two bodies meet, as Jolt does not report the impulses its solver applies.

    Hierarchy (View Summary)

    Index
    nativeWorld: any