Physics3DPlugin
此内容尚不支持你的语言。
Defined in: physics3d/Physics3DPlugin.ts:43
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 });});Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Physics3DPlugin(
wasmUrl,config?,factory?):Physics3DPlugin
Defined in: physics3d/Physics3DPlugin.ts:50
Parameters
Section titled “Parameters”wasmUrl
Section titled “wasmUrl”string
config?
Section titled “config?”Partial<Physics3DConfig> = {}
factory?
Section titled “factory?”Returns
Section titled “Returns”Physics3DPlugin
Properties
Section titled “Properties”name:
string='physics3d'
Defined in: physics3d/Physics3DPlugin.ts:44
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”build()
Section titled “build()”build(
app):void
Defined in: physics3d/Physics3DPlugin.ts:57
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”cleanup()
Section titled “cleanup()”cleanup():
void
Defined in: physics3d/Physics3DPlugin.ts:100
Tear the world down, so a re-init does not inherit the last one’s bodies.
Returns
Section titled “Returns”void