UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

57 lines (56 loc) 1.04 kB
import { PhysicsBody } from "./physics-body.js"; import { PhysicsJoint } from "./physics-joint.js"; class PhysicsWorld { contactListener = null; nativeWorld = null; constructor(options = {}) { this.contactListener = options.contactListener ?? null; } destroy() { } setGravity(gravity) { } step(dt, maxSubSteps, fixedTimeStep) { } flushContacts() { } createBody(desc) { const body = new PhysicsBody(); body.entity = desc.entity ?? null; return body; } destroyBody(body) { } addBody(body, group, mask) { } removeBody(body) { } createShape(desc) { return {}; } destroyShape(shape) { } addCompoundChild(compound, child, position, rotation) { } updateCompoundChild(compound, child, position, rotation) { } removeCompoundChild(compound, child) { } getCompoundChildCount(compound) { return 0; } createJoint(desc) { return new PhysicsJoint(); } destroyJoint(joint) { } raycastFirst(start, end, options) { return null; } raycastAll(start, end, options) { return []; } } export { PhysicsWorld };