Physics3DRuntime
Physics3DRuntime:
ResourceDef<Physics3DRuntime>
Defined in: physics3d/Physics3DPlugin.ts:26
index.ts
ESEngine 3D physics module — standalone Jolt WASM integration.
Details
Section titled “Details”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.
Example
Section titled “Example”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 });});