physics3dPlugin
此内容尚不支持你的语言。
physics3dPlugin(
wasmUrl,config?,factory?):Physics3DPlugin
Defined in: physics3d/Physics3DPlugin.ts:106
Parameters
Section titled “Parameters”wasmUrl
Section titled “wasmUrl”string
config?
Section titled “config?”Partial<Physics3DConfig> = {}
factory?
Section titled “factory?”Returns
Section titled “Returns”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 });});