Skip to content

physics3dPlugin

physics3dPlugin(wasmUrl, config?, factory?): Physics3DPlugin

Defined in: physics3d/Physics3DPlugin.ts:106

string

Partial<Physics3DConfig> = {}

Physics3DModuleFactory

Physics3DPlugin

index.ts

ESEngine 3D physics module — standalone Jolt WASM integration.

The flat world’s twin, entry for entry: esengine/physics hands a game the plugin, the world resource and the contact events, and until this file existed the solid world handed it none of them. Its components reached the main entry, so a scene could hold a body and a collider — and nothing a system could import could cast a ray at one or hear it land.

import { Physics3DPlugin, Physics3D } from 'esengine/physics3d';
app.addPlugin(new Physics3DPlugin('physics3d.js', { gravity: { x: 0, y: -9.81, z: 0 } }));
defineSystem([Res(Physics3D)], (queries) => {
const hit = queries?.raycast({ x: 0, y: 100, z: 0 }, { x: 0, y: -200, z: 0 });
});