Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/flo-bit/shadow-shmup. Fun and casual top-down, roguelike shoot 'em up browsergame with shadow elements and colorful neon effects
flo-bit.dev/shadow-shmup/
···11-var __defProp = Object.defineProperty;
22-var __export = (target, all) => {
33- for (var name in all)
44- __defProp(target, name, { get: all[name], enumerable: true });
55-};
66-77-// ../node_modules/@dimforge/rapier2d/exports.js
88-var exports_exports = {};
99-__export(exports_exports, {
1010- ActiveCollisionTypes: () => ActiveCollisionTypes,
1111- ActiveEvents: () => ActiveEvents,
1212- ActiveHooks: () => ActiveHooks,
1313- Ball: () => Ball,
1414- BroadPhase: () => BroadPhase,
1515- CCDSolver: () => CCDSolver,
1616- Capsule: () => Capsule,
1717- CharacterCollision: () => CharacterCollision,
1818- CoefficientCombineRule: () => CoefficientCombineRule,
1919- Collider: () => Collider,
2020- ColliderDesc: () => ColliderDesc,
2121- ColliderSet: () => ColliderSet,
2222- ColliderShapeCastHit: () => ColliderShapeCastHit,
2323- ConvexPolygon: () => ConvexPolygon,
2424- Cuboid: () => Cuboid,
2525- DebugRenderBuffers: () => DebugRenderBuffers,
2626- DebugRenderPipeline: () => DebugRenderPipeline,
2727- EventQueue: () => EventQueue,
2828- FeatureType: () => FeatureType,
2929- FixedImpulseJoint: () => FixedImpulseJoint,
3030- FixedMultibodyJoint: () => FixedMultibodyJoint,
3131- HalfSpace: () => HalfSpace,
3232- Heightfield: () => Heightfield,
3333- ImpulseJoint: () => ImpulseJoint,
3434- ImpulseJointSet: () => ImpulseJointSet,
3535- IntegrationParameters: () => IntegrationParameters,
3636- IslandManager: () => IslandManager,
3737- JointAxesMask: () => JointAxesMask,
3838- JointData: () => JointData,
3939- JointType: () => JointType,
4040- KinematicCharacterController: () => KinematicCharacterController,
4141- MassPropsMode: () => MassPropsMode,
4242- MotorModel: () => MotorModel,
4343- MultibodyJoint: () => MultibodyJoint,
4444- MultibodyJointSet: () => MultibodyJointSet,
4545- NarrowPhase: () => NarrowPhase,
4646- PhysicsPipeline: () => PhysicsPipeline,
4747- PointColliderProjection: () => PointColliderProjection,
4848- PointProjection: () => PointProjection,
4949- Polyline: () => Polyline,
5050- PrismaticImpulseJoint: () => PrismaticImpulseJoint,
5151- PrismaticMultibodyJoint: () => PrismaticMultibodyJoint,
5252- QueryFilterFlags: () => QueryFilterFlags,
5353- QueryPipeline: () => QueryPipeline,
5454- Ray: () => Ray,
5555- RayColliderHit: () => RayColliderHit,
5656- RayColliderIntersection: () => RayColliderIntersection,
5757- RayIntersection: () => RayIntersection,
5858- RevoluteImpulseJoint: () => RevoluteImpulseJoint,
5959- RevoluteMultibodyJoint: () => RevoluteMultibodyJoint,
6060- RigidBody: () => RigidBody,
6161- RigidBodyDesc: () => RigidBodyDesc,
6262- RigidBodySet: () => RigidBodySet,
6363- RigidBodyType: () => RigidBodyType,
6464- RopeImpulseJoint: () => RopeImpulseJoint,
6565- RotationOps: () => RotationOps,
6666- RoundConvexPolygon: () => RoundConvexPolygon,
6767- RoundCuboid: () => RoundCuboid,
6868- RoundTriangle: () => RoundTriangle,
6969- Segment: () => Segment,
7070- SerializationPipeline: () => SerializationPipeline,
7171- Shape: () => Shape,
7272- ShapeCastHit: () => ShapeCastHit,
7373- ShapeContact: () => ShapeContact,
7474- ShapeType: () => ShapeType,
7575- SolverFlags: () => SolverFlags,
7676- SpringImpulseJoint: () => SpringImpulseJoint,
7777- TempContactForceEvent: () => TempContactForceEvent,
7878- TempContactManifold: () => TempContactManifold,
7979- TriMesh: () => TriMesh,
8080- TriMeshFlags: () => TriMeshFlags,
8181- Triangle: () => Triangle,
8282- UnitImpulseJoint: () => UnitImpulseJoint,
8383- UnitMultibodyJoint: () => UnitMultibodyJoint,
8484- Vector2: () => Vector2,
8585- VectorOps: () => VectorOps,
8686- World: () => World,
8787- version: () => version2
8888-});
8989-9090-// ../node_modules/@dimforge/rapier2d/rapier_wasm2d.js
9191-import * as wasm2 from "/Users/florian/Code/Square-Survivor/node_modules/@dimforge/rapier2d/rapier_wasm2d_bg.wasm";
9292-9393-// ../node_modules/@dimforge/rapier2d/rapier_wasm2d_bg.js
9494-var wasm;
9595-function __wbg_set_wasm(val) {
9696- wasm = val;
9797-}
9898-var heap = new Array(128).fill(void 0);
9999-heap.push(void 0, null, true, false);
100100-var heap_next = heap.length;
101101-function addHeapObject(obj) {
102102- if (heap_next === heap.length) heap.push(heap.length + 1);
103103- const idx = heap_next;
104104- heap_next = heap[idx];
105105- heap[idx] = obj;
106106- return idx;
107107-}
108108-function getObject(idx) {
109109- return heap[idx];
110110-}
111111-function dropObject(idx) {
112112- if (idx < 132) return;
113113- heap[idx] = heap_next;
114114- heap_next = idx;
115115-}
116116-function takeObject(idx) {
117117- const ret = getObject(idx);
118118- dropObject(idx);
119119- return ret;
120120-}
121121-function isLikeNone(x) {
122122- return x === void 0 || x === null;
123123-}
124124-var cachedFloat64Memory0 = null;
125125-function getFloat64Memory0() {
126126- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
127127- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
128128- }
129129- return cachedFloat64Memory0;
130130-}
131131-var cachedInt32Memory0 = null;
132132-function getInt32Memory0() {
133133- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
134134- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
135135- }
136136- return cachedInt32Memory0;
137137-}
138138-var lTextDecoder = typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
139139-var cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
140140-cachedTextDecoder.decode();
141141-var cachedUint8Memory0 = null;
142142-function getUint8Memory0() {
143143- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
144144- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
145145- }
146146- return cachedUint8Memory0;
147147-}
148148-function getStringFromWasm0(ptr, len) {
149149- ptr = ptr >>> 0;
150150- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
151151-}
152152-function version() {
153153- let deferred1_0;
154154- let deferred1_1;
155155- try {
156156- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
157157- wasm.version(retptr);
158158- var r0 = getInt32Memory0()[retptr / 4 + 0];
159159- var r1 = getInt32Memory0()[retptr / 4 + 1];
160160- deferred1_0 = r0;
161161- deferred1_1 = r1;
162162- return getStringFromWasm0(r0, r1);
163163- } finally {
164164- wasm.__wbindgen_add_to_stack_pointer(16);
165165- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
166166- }
167167-}
168168-function _assertClass(instance, klass) {
169169- if (!(instance instanceof klass)) {
170170- throw new Error(`expected instance of ${klass.name}`);
171171- }
172172- return instance.ptr;
173173-}
174174-var cachedFloat32Memory0 = null;
175175-function getFloat32Memory0() {
176176- if (cachedFloat32Memory0 === null || cachedFloat32Memory0.byteLength === 0) {
177177- cachedFloat32Memory0 = new Float32Array(wasm.memory.buffer);
178178- }
179179- return cachedFloat32Memory0;
180180-}
181181-var stack_pointer = 128;
182182-function addBorrowedObject(obj) {
183183- if (stack_pointer == 1) throw new Error("out of js stack");
184184- heap[--stack_pointer] = obj;
185185- return stack_pointer;
186186-}
187187-function getArrayF32FromWasm0(ptr, len) {
188188- ptr = ptr >>> 0;
189189- return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len);
190190-}
191191-var cachedUint32Memory0 = null;
192192-function getUint32Memory0() {
193193- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
194194- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
195195- }
196196- return cachedUint32Memory0;
197197-}
198198-function getArrayU32FromWasm0(ptr, len) {
199199- ptr = ptr >>> 0;
200200- return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len);
201201-}
202202-var WASM_VECTOR_LEN = 0;
203203-function passArrayF32ToWasm0(arg, malloc) {
204204- const ptr = malloc(arg.length * 4, 4) >>> 0;
205205- getFloat32Memory0().set(arg, ptr / 4);
206206- WASM_VECTOR_LEN = arg.length;
207207- return ptr;
208208-}
209209-function passArray32ToWasm0(arg, malloc) {
210210- const ptr = malloc(arg.length * 4, 4) >>> 0;
211211- getUint32Memory0().set(arg, ptr / 4);
212212- WASM_VECTOR_LEN = arg.length;
213213- return ptr;
214214-}
215215-var RawShapeType = Object.freeze({ Ball: 0, "0": "Ball", Cuboid: 1, "1": "Cuboid", Capsule: 2, "2": "Capsule", Segment: 3, "3": "Segment", Polyline: 4, "4": "Polyline", Triangle: 5, "5": "Triangle", TriMesh: 6, "6": "TriMesh", HeightField: 7, "7": "HeightField", Compound: 8, "8": "Compound", ConvexPolygon: 9, "9": "ConvexPolygon", RoundCuboid: 10, "10": "RoundCuboid", RoundTriangle: 11, "11": "RoundTriangle", RoundConvexPolygon: 12, "12": "RoundConvexPolygon", HalfSpace: 13, "13": "HalfSpace" });
216216-var RawFeatureType = Object.freeze({ Vertex: 0, "0": "Vertex", Face: 1, "1": "Face", Unknown: 2, "2": "Unknown" });
217217-var RawRigidBodyType = Object.freeze({ Dynamic: 0, "0": "Dynamic", Fixed: 1, "1": "Fixed", KinematicPositionBased: 2, "2": "KinematicPositionBased", KinematicVelocityBased: 3, "3": "KinematicVelocityBased" });
218218-var RawJointType = Object.freeze({ Revolute: 0, "0": "Revolute", Fixed: 1, "1": "Fixed", Prismatic: 2, "2": "Prismatic", Rope: 3, "3": "Rope", Spring: 4, "4": "Spring", Generic: 5, "5": "Generic" });
219219-var RawJointAxis = Object.freeze({ X: 0, "0": "X", Y: 1, "1": "Y", AngX: 2, "2": "AngX" });
220220-var RawMotorModel = Object.freeze({ AccelerationBased: 0, "0": "AccelerationBased", ForceBased: 1, "1": "ForceBased" });
221221-var RawBroadPhase = class _RawBroadPhase {
222222- static __wrap(ptr) {
223223- ptr = ptr >>> 0;
224224- const obj = Object.create(_RawBroadPhase.prototype);
225225- obj.__wbg_ptr = ptr;
226226- return obj;
227227- }
228228- __destroy_into_raw() {
229229- const ptr = this.__wbg_ptr;
230230- this.__wbg_ptr = 0;
231231- return ptr;
232232- }
233233- free() {
234234- const ptr = this.__destroy_into_raw();
235235- wasm.__wbg_rawbroadphase_free(ptr);
236236- }
237237- /**
238238- */
239239- constructor() {
240240- const ret = wasm.rawbroadphase_new();
241241- this.__wbg_ptr = ret >>> 0;
242242- return this;
243243- }
244244-};
245245-var RawCCDSolver = class {
246246- __destroy_into_raw() {
247247- const ptr = this.__wbg_ptr;
248248- this.__wbg_ptr = 0;
249249- return ptr;
250250- }
251251- free() {
252252- const ptr = this.__destroy_into_raw();
253253- wasm.__wbg_rawccdsolver_free(ptr);
254254- }
255255- /**
256256- */
257257- constructor() {
258258- const ret = wasm.rawccdsolver_new();
259259- this.__wbg_ptr = ret >>> 0;
260260- return this;
261261- }
262262-};
263263-var RawCharacterCollision = class {
264264- __destroy_into_raw() {
265265- const ptr = this.__wbg_ptr;
266266- this.__wbg_ptr = 0;
267267- return ptr;
268268- }
269269- free() {
270270- const ptr = this.__destroy_into_raw();
271271- wasm.__wbg_rawcharactercollision_free(ptr);
272272- }
273273- /**
274274- */
275275- constructor() {
276276- const ret = wasm.rawcharactercollision_new();
277277- this.__wbg_ptr = ret >>> 0;
278278- return this;
279279- }
280280- /**
281281- * @returns {number}
282282- */
283283- handle() {
284284- const ret = wasm.rawcharactercollision_handle(this.__wbg_ptr);
285285- return ret;
286286- }
287287- /**
288288- * @returns {RawVector}
289289- */
290290- translationDeltaApplied() {
291291- const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
292292- return RawVector.__wrap(ret);
293293- }
294294- /**
295295- * @returns {RawVector}
296296- */
297297- translationDeltaRemaining() {
298298- const ret = wasm.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
299299- return RawVector.__wrap(ret);
300300- }
301301- /**
302302- * @returns {number}
303303- */
304304- toi() {
305305- const ret = wasm.rawcharactercollision_toi(this.__wbg_ptr);
306306- return ret;
307307- }
308308- /**
309309- * @returns {RawVector}
310310- */
311311- worldWitness1() {
312312- const ret = wasm.rawcharactercollision_worldWitness1(this.__wbg_ptr);
313313- return RawVector.__wrap(ret);
314314- }
315315- /**
316316- * @returns {RawVector}
317317- */
318318- worldWitness2() {
319319- const ret = wasm.rawcharactercollision_worldWitness2(this.__wbg_ptr);
320320- return RawVector.__wrap(ret);
321321- }
322322- /**
323323- * @returns {RawVector}
324324- */
325325- worldNormal1() {
326326- const ret = wasm.rawcharactercollision_worldNormal1(this.__wbg_ptr);
327327- return RawVector.__wrap(ret);
328328- }
329329- /**
330330- * @returns {RawVector}
331331- */
332332- worldNormal2() {
333333- const ret = wasm.rawcharactercollision_worldNormal2(this.__wbg_ptr);
334334- return RawVector.__wrap(ret);
335335- }
336336-};
337337-var RawColliderSet = class _RawColliderSet {
338338- static __wrap(ptr) {
339339- ptr = ptr >>> 0;
340340- const obj = Object.create(_RawColliderSet.prototype);
341341- obj.__wbg_ptr = ptr;
342342- return obj;
343343- }
344344- __destroy_into_raw() {
345345- const ptr = this.__wbg_ptr;
346346- this.__wbg_ptr = 0;
347347- return ptr;
348348- }
349349- free() {
350350- const ptr = this.__destroy_into_raw();
351351- wasm.__wbg_rawcolliderset_free(ptr);
352352- }
353353- /**
354354- * The world-space translation of this collider.
355355- * @param {number} handle
356356- * @returns {RawVector}
357357- */
358358- coTranslation(handle) {
359359- const ret = wasm.rawcolliderset_coTranslation(this.__wbg_ptr, handle);
360360- return RawVector.__wrap(ret);
361361- }
362362- /**
363363- * The world-space orientation of this collider.
364364- * @param {number} handle
365365- * @returns {RawRotation}
366366- */
367367- coRotation(handle) {
368368- const ret = wasm.rawcolliderset_coRotation(this.__wbg_ptr, handle);
369369- return RawRotation.__wrap(ret);
370370- }
371371- /**
372372- * Sets the translation of this collider.
373373- *
374374- * # Parameters
375375- * - `x`: the world-space position of the collider along the `x` axis.
376376- * - `y`: the world-space position of the collider along the `y` axis.
377377- * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it
378378- * wasn't moving before modifying its position.
379379- * @param {number} handle
380380- * @param {number} x
381381- * @param {number} y
382382- */
383383- coSetTranslation(handle, x, y) {
384384- wasm.rawcolliderset_coSetTranslation(this.__wbg_ptr, handle, x, y);
385385- }
386386- /**
387387- * @param {number} handle
388388- * @param {number} x
389389- * @param {number} y
390390- */
391391- coSetTranslationWrtParent(handle, x, y) {
392392- wasm.rawcolliderset_coSetTranslationWrtParent(this.__wbg_ptr, handle, x, y);
393393- }
394394- /**
395395- * Sets the rotation angle of this collider.
396396- *
397397- * # Parameters
398398- * - `angle`: the rotation angle, in radians.
399399- * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it
400400- * wasn't moving before modifying its position.
401401- * @param {number} handle
402402- * @param {number} angle
403403- */
404404- coSetRotation(handle, angle) {
405405- wasm.rawcolliderset_coSetRotation(this.__wbg_ptr, handle, angle);
406406- }
407407- /**
408408- * @param {number} handle
409409- * @param {number} angle
410410- */
411411- coSetRotationWrtParent(handle, angle) {
412412- wasm.rawcolliderset_coSetRotationWrtParent(this.__wbg_ptr, handle, angle);
413413- }
414414- /**
415415- * Is this collider a sensor?
416416- * @param {number} handle
417417- * @returns {boolean}
418418- */
419419- coIsSensor(handle) {
420420- const ret = wasm.rawcolliderset_coIsSensor(this.__wbg_ptr, handle);
421421- return ret !== 0;
422422- }
423423- /**
424424- * The type of the shape of this collider.
425425- * @param {number} handle
426426- * @returns {RawShapeType}
427427- */
428428- coShapeType(handle) {
429429- const ret = wasm.rawcolliderset_coShapeType(this.__wbg_ptr, handle);
430430- return ret;
431431- }
432432- /**
433433- * @param {number} handle
434434- * @returns {RawVector | undefined}
435435- */
436436- coHalfspaceNormal(handle) {
437437- const ret = wasm.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, handle);
438438- return ret === 0 ? void 0 : RawVector.__wrap(ret);
439439- }
440440- /**
441441- * The half-extents of this collider if it is has a cuboid shape.
442442- * @param {number} handle
443443- * @returns {RawVector | undefined}
444444- */
445445- coHalfExtents(handle) {
446446- const ret = wasm.rawcolliderset_coHalfExtents(this.__wbg_ptr, handle);
447447- return ret === 0 ? void 0 : RawVector.__wrap(ret);
448448- }
449449- /**
450450- * Set the half-extents of this collider if it has a cuboid shape.
451451- * @param {number} handle
452452- * @param {RawVector} newHalfExtents
453453- */
454454- coSetHalfExtents(handle, newHalfExtents) {
455455- _assertClass(newHalfExtents, RawVector);
456456- wasm.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, handle, newHalfExtents.__wbg_ptr);
457457- }
458458- /**
459459- * The radius of this collider if it is a ball, capsule, cylinder, or cone shape.
460460- * @param {number} handle
461461- * @returns {number | undefined}
462462- */
463463- coRadius(handle) {
464464- try {
465465- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
466466- wasm.rawcolliderset_coRadius(retptr, this.__wbg_ptr, handle);
467467- var r0 = getInt32Memory0()[retptr / 4 + 0];
468468- var r1 = getFloat32Memory0()[retptr / 4 + 1];
469469- return r0 === 0 ? void 0 : r1;
470470- } finally {
471471- wasm.__wbindgen_add_to_stack_pointer(16);
472472- }
473473- }
474474- /**
475475- * Set the radius of this collider if it is a ball, capsule, cylinder, or cone shape.
476476- * @param {number} handle
477477- * @param {number} newRadius
478478- */
479479- coSetRadius(handle, newRadius) {
480480- wasm.rawcolliderset_coSetRadius(this.__wbg_ptr, handle, newRadius);
481481- }
482482- /**
483483- * The half height of this collider if it is a capsule, cylinder, or cone shape.
484484- * @param {number} handle
485485- * @returns {number | undefined}
486486- */
487487- coHalfHeight(handle) {
488488- try {
489489- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
490490- wasm.rawcolliderset_coHalfHeight(retptr, this.__wbg_ptr, handle);
491491- var r0 = getInt32Memory0()[retptr / 4 + 0];
492492- var r1 = getFloat32Memory0()[retptr / 4 + 1];
493493- return r0 === 0 ? void 0 : r1;
494494- } finally {
495495- wasm.__wbindgen_add_to_stack_pointer(16);
496496- }
497497- }
498498- /**
499499- * Set the half height of this collider if it is a capsule, cylinder, or cone shape.
500500- * @param {number} handle
501501- * @param {number} newHalfheight
502502- */
503503- coSetHalfHeight(handle, newHalfheight) {
504504- wasm.rawcolliderset_coSetHalfHeight(this.__wbg_ptr, handle, newHalfheight);
505505- }
506506- /**
507507- * The radius of the round edges of this collider.
508508- * @param {number} handle
509509- * @returns {number | undefined}
510510- */
511511- coRoundRadius(handle) {
512512- try {
513513- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
514514- wasm.rawcolliderset_coRoundRadius(retptr, this.__wbg_ptr, handle);
515515- var r0 = getInt32Memory0()[retptr / 4 + 0];
516516- var r1 = getFloat32Memory0()[retptr / 4 + 1];
517517- return r0 === 0 ? void 0 : r1;
518518- } finally {
519519- wasm.__wbindgen_add_to_stack_pointer(16);
520520- }
521521- }
522522- /**
523523- * Set the radius of the round edges of this collider.
524524- * @param {number} handle
525525- * @param {number} newBorderRadius
526526- */
527527- coSetRoundRadius(handle, newBorderRadius) {
528528- wasm.rawcolliderset_coSetRoundRadius(this.__wbg_ptr, handle, newBorderRadius);
529529- }
530530- /**
531531- * The vertices of this triangle mesh, polyline, convex polyhedron, segment, triangle or convex polyhedron, if it is one.
532532- * @param {number} handle
533533- * @returns {Float32Array | undefined}
534534- */
535535- coVertices(handle) {
536536- try {
537537- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538538- wasm.rawcolliderset_coVertices(retptr, this.__wbg_ptr, handle);
539539- var r0 = getInt32Memory0()[retptr / 4 + 0];
540540- var r1 = getInt32Memory0()[retptr / 4 + 1];
541541- let v1;
542542- if (r0 !== 0) {
543543- v1 = getArrayF32FromWasm0(r0, r1).slice();
544544- wasm.__wbindgen_free(r0, r1 * 4, 4);
545545- }
546546- return v1;
547547- } finally {
548548- wasm.__wbindgen_add_to_stack_pointer(16);
549549- }
550550- }
551551- /**
552552- * The indices of this triangle mesh, polyline, or convex polyhedron, if it is one.
553553- * @param {number} handle
554554- * @returns {Uint32Array | undefined}
555555- */
556556- coIndices(handle) {
557557- try {
558558- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
559559- wasm.rawcolliderset_coIndices(retptr, this.__wbg_ptr, handle);
560560- var r0 = getInt32Memory0()[retptr / 4 + 0];
561561- var r1 = getInt32Memory0()[retptr / 4 + 1];
562562- let v1;
563563- if (r0 !== 0) {
564564- v1 = getArrayU32FromWasm0(r0, r1).slice();
565565- wasm.__wbindgen_free(r0, r1 * 4, 4);
566566- }
567567- return v1;
568568- } finally {
569569- wasm.__wbindgen_add_to_stack_pointer(16);
570570- }
571571- }
572572- /**
573573- * @param {number} handle
574574- * @returns {number | undefined}
575575- */
576576- coTriMeshFlags(handle) {
577577- try {
578578- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
579579- wasm.rawcolliderset_coTriMeshFlags(retptr, this.__wbg_ptr, handle);
580580- var r0 = getInt32Memory0()[retptr / 4 + 0];
581581- var r1 = getInt32Memory0()[retptr / 4 + 1];
582582- return r0 === 0 ? void 0 : r1 >>> 0;
583583- } finally {
584584- wasm.__wbindgen_add_to_stack_pointer(16);
585585- }
586586- }
587587- /**
588588- * The height of this heightfield if it is one.
589589- * @param {number} handle
590590- * @returns {Float32Array | undefined}
591591- */
592592- coHeightfieldHeights(handle) {
593593- try {
594594- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
595595- wasm.rawcolliderset_coHeightfieldHeights(retptr, this.__wbg_ptr, handle);
596596- var r0 = getInt32Memory0()[retptr / 4 + 0];
597597- var r1 = getInt32Memory0()[retptr / 4 + 1];
598598- let v1;
599599- if (r0 !== 0) {
600600- v1 = getArrayF32FromWasm0(r0, r1).slice();
601601- wasm.__wbindgen_free(r0, r1 * 4, 4);
602602- }
603603- return v1;
604604- } finally {
605605- wasm.__wbindgen_add_to_stack_pointer(16);
606606- }
607607- }
608608- /**
609609- * The scaling factor applied of this heightfield if it is one.
610610- * @param {number} handle
611611- * @returns {RawVector | undefined}
612612- */
613613- coHeightfieldScale(handle) {
614614- const ret = wasm.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, handle);
615615- return ret === 0 ? void 0 : RawVector.__wrap(ret);
616616- }
617617- /**
618618- * The unique integer identifier of the collider this collider is attached to.
619619- * @param {number} handle
620620- * @returns {number | undefined}
621621- */
622622- coParent(handle) {
623623- try {
624624- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
625625- wasm.rawcolliderset_coParent(retptr, this.__wbg_ptr, handle);
626626- var r0 = getInt32Memory0()[retptr / 4 + 0];
627627- var r2 = getFloat64Memory0()[retptr / 8 + 1];
628628- return r0 === 0 ? void 0 : r2;
629629- } finally {
630630- wasm.__wbindgen_add_to_stack_pointer(16);
631631- }
632632- }
633633- /**
634634- * @param {number} handle
635635- * @param {boolean} enabled
636636- */
637637- coSetEnabled(handle, enabled) {
638638- wasm.rawcolliderset_coSetEnabled(this.__wbg_ptr, handle, enabled);
639639- }
640640- /**
641641- * @param {number} handle
642642- * @returns {boolean}
643643- */
644644- coIsEnabled(handle) {
645645- const ret = wasm.rawcolliderset_coIsEnabled(this.__wbg_ptr, handle);
646646- return ret !== 0;
647647- }
648648- /**
649649- * @param {number} handle
650650- * @param {number} contact_skin
651651- */
652652- coSetContactSkin(handle, contact_skin) {
653653- wasm.rawcolliderset_coSetContactSkin(this.__wbg_ptr, handle, contact_skin);
654654- }
655655- /**
656656- * @param {number} handle
657657- * @returns {number}
658658- */
659659- coContactSkin(handle) {
660660- const ret = wasm.rawcolliderset_coContactSkin(this.__wbg_ptr, handle);
661661- return ret;
662662- }
663663- /**
664664- * The friction coefficient of this collider.
665665- * @param {number} handle
666666- * @returns {number}
667667- */
668668- coFriction(handle) {
669669- const ret = wasm.rawcolliderset_coFriction(this.__wbg_ptr, handle);
670670- return ret;
671671- }
672672- /**
673673- * The restitution coefficient of this collider.
674674- * @param {number} handle
675675- * @returns {number}
676676- */
677677- coRestitution(handle) {
678678- const ret = wasm.rawcolliderset_coRestitution(this.__wbg_ptr, handle);
679679- return ret;
680680- }
681681- /**
682682- * The density of this collider.
683683- * @param {number} handle
684684- * @returns {number}
685685- */
686686- coDensity(handle) {
687687- const ret = wasm.rawcolliderset_coDensity(this.__wbg_ptr, handle);
688688- return ret;
689689- }
690690- /**
691691- * The mass of this collider.
692692- * @param {number} handle
693693- * @returns {number}
694694- */
695695- coMass(handle) {
696696- const ret = wasm.rawcolliderset_coMass(this.__wbg_ptr, handle);
697697- return ret;
698698- }
699699- /**
700700- * The volume of this collider.
701701- * @param {number} handle
702702- * @returns {number}
703703- */
704704- coVolume(handle) {
705705- const ret = wasm.rawcolliderset_coVolume(this.__wbg_ptr, handle);
706706- return ret;
707707- }
708708- /**
709709- * The collision groups of this collider.
710710- * @param {number} handle
711711- * @returns {number}
712712- */
713713- coCollisionGroups(handle) {
714714- const ret = wasm.rawcolliderset_coCollisionGroups(this.__wbg_ptr, handle);
715715- return ret >>> 0;
716716- }
717717- /**
718718- * The solver groups of this collider.
719719- * @param {number} handle
720720- * @returns {number}
721721- */
722722- coSolverGroups(handle) {
723723- const ret = wasm.rawcolliderset_coSolverGroups(this.__wbg_ptr, handle);
724724- return ret >>> 0;
725725- }
726726- /**
727727- * The physics hooks enabled for this collider.
728728- * @param {number} handle
729729- * @returns {number}
730730- */
731731- coActiveHooks(handle) {
732732- const ret = wasm.rawcolliderset_coActiveHooks(this.__wbg_ptr, handle);
733733- return ret >>> 0;
734734- }
735735- /**
736736- * The collision types enabled for this collider.
737737- * @param {number} handle
738738- * @returns {number}
739739- */
740740- coActiveCollisionTypes(handle) {
741741- const ret = wasm.rawcolliderset_coActiveCollisionTypes(this.__wbg_ptr, handle);
742742- return ret;
743743- }
744744- /**
745745- * The events enabled for this collider.
746746- * @param {number} handle
747747- * @returns {number}
748748- */
749749- coActiveEvents(handle) {
750750- const ret = wasm.rawcolliderset_coActiveEvents(this.__wbg_ptr, handle);
751751- return ret >>> 0;
752752- }
753753- /**
754754- * The total force magnitude beyond which a contact force event can be emitted.
755755- * @param {number} handle
756756- * @returns {number}
757757- */
758758- coContactForceEventThreshold(handle) {
759759- const ret = wasm.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, handle);
760760- return ret;
761761- }
762762- /**
763763- * @param {number} handle
764764- * @param {RawVector} point
765765- * @returns {boolean}
766766- */
767767- coContainsPoint(handle, point) {
768768- _assertClass(point, RawVector);
769769- const ret = wasm.rawcolliderset_coContainsPoint(this.__wbg_ptr, handle, point.__wbg_ptr);
770770- return ret !== 0;
771771- }
772772- /**
773773- * @param {number} handle
774774- * @param {RawVector} colliderVel
775775- * @param {RawShape} shape2
776776- * @param {RawVector} shape2Pos
777777- * @param {RawRotation} shape2Rot
778778- * @param {RawVector} shape2Vel
779779- * @param {number} target_distance
780780- * @param {number} maxToi
781781- * @param {boolean} stop_at_penetration
782782- * @returns {RawShapeCastHit | undefined}
783783- */
784784- coCastShape(handle, colliderVel, shape2, shape2Pos, shape2Rot, shape2Vel, target_distance, maxToi, stop_at_penetration) {
785785- _assertClass(colliderVel, RawVector);
786786- _assertClass(shape2, RawShape);
787787- _assertClass(shape2Pos, RawVector);
788788- _assertClass(shape2Rot, RawRotation);
789789- _assertClass(shape2Vel, RawVector);
790790- const ret = wasm.rawcolliderset_coCastShape(this.__wbg_ptr, handle, colliderVel.__wbg_ptr, shape2.__wbg_ptr, shape2Pos.__wbg_ptr, shape2Rot.__wbg_ptr, shape2Vel.__wbg_ptr, target_distance, maxToi, stop_at_penetration);
791791- return ret === 0 ? void 0 : RawShapeCastHit.__wrap(ret);
792792- }
793793- /**
794794- * @param {number} handle
795795- * @param {RawVector} collider1Vel
796796- * @param {number} collider2handle
797797- * @param {RawVector} collider2Vel
798798- * @param {number} target_distance
799799- * @param {number} max_toi
800800- * @param {boolean} stop_at_penetration
801801- * @returns {RawColliderShapeCastHit | undefined}
802802- */
803803- coCastCollider(handle, collider1Vel, collider2handle, collider2Vel, target_distance, max_toi, stop_at_penetration) {
804804- _assertClass(collider1Vel, RawVector);
805805- _assertClass(collider2Vel, RawVector);
806806- const ret = wasm.rawcolliderset_coCastCollider(this.__wbg_ptr, handle, collider1Vel.__wbg_ptr, collider2handle, collider2Vel.__wbg_ptr, target_distance, max_toi, stop_at_penetration);
807807- return ret === 0 ? void 0 : RawColliderShapeCastHit.__wrap(ret);
808808- }
809809- /**
810810- * @param {number} handle
811811- * @param {RawShape} shape2
812812- * @param {RawVector} shapePos2
813813- * @param {RawRotation} shapeRot2
814814- * @returns {boolean}
815815- */
816816- coIntersectsShape(handle, shape2, shapePos2, shapeRot2) {
817817- _assertClass(shape2, RawShape);
818818- _assertClass(shapePos2, RawVector);
819819- _assertClass(shapeRot2, RawRotation);
820820- const ret = wasm.rawcolliderset_coIntersectsShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr);
821821- return ret !== 0;
822822- }
823823- /**
824824- * @param {number} handle
825825- * @param {RawShape} shape2
826826- * @param {RawVector} shapePos2
827827- * @param {RawRotation} shapeRot2
828828- * @param {number} prediction
829829- * @returns {RawShapeContact | undefined}
830830- */
831831- coContactShape(handle, shape2, shapePos2, shapeRot2, prediction) {
832832- _assertClass(shape2, RawShape);
833833- _assertClass(shapePos2, RawVector);
834834- _assertClass(shapeRot2, RawRotation);
835835- const ret = wasm.rawcolliderset_coContactShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction);
836836- return ret === 0 ? void 0 : RawShapeContact.__wrap(ret);
837837- }
838838- /**
839839- * @param {number} handle
840840- * @param {number} collider2handle
841841- * @param {number} prediction
842842- * @returns {RawShapeContact | undefined}
843843- */
844844- coContactCollider(handle, collider2handle, prediction) {
845845- const ret = wasm.rawcolliderset_coContactCollider(this.__wbg_ptr, handle, collider2handle, prediction);
846846- return ret === 0 ? void 0 : RawShapeContact.__wrap(ret);
847847- }
848848- /**
849849- * @param {number} handle
850850- * @param {RawVector} point
851851- * @param {boolean} solid
852852- * @returns {RawPointProjection}
853853- */
854854- coProjectPoint(handle, point, solid) {
855855- _assertClass(point, RawVector);
856856- const ret = wasm.rawcolliderset_coProjectPoint(this.__wbg_ptr, handle, point.__wbg_ptr, solid);
857857- return RawPointProjection.__wrap(ret);
858858- }
859859- /**
860860- * @param {number} handle
861861- * @param {RawVector} rayOrig
862862- * @param {RawVector} rayDir
863863- * @param {number} maxToi
864864- * @returns {boolean}
865865- */
866866- coIntersectsRay(handle, rayOrig, rayDir, maxToi) {
867867- _assertClass(rayOrig, RawVector);
868868- _assertClass(rayDir, RawVector);
869869- const ret = wasm.rawcolliderset_coIntersectsRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi);
870870- return ret !== 0;
871871- }
872872- /**
873873- * @param {number} handle
874874- * @param {RawVector} rayOrig
875875- * @param {RawVector} rayDir
876876- * @param {number} maxToi
877877- * @param {boolean} solid
878878- * @returns {number}
879879- */
880880- coCastRay(handle, rayOrig, rayDir, maxToi, solid) {
881881- _assertClass(rayOrig, RawVector);
882882- _assertClass(rayDir, RawVector);
883883- const ret = wasm.rawcolliderset_coCastRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);
884884- return ret;
885885- }
886886- /**
887887- * @param {number} handle
888888- * @param {RawVector} rayOrig
889889- * @param {RawVector} rayDir
890890- * @param {number} maxToi
891891- * @param {boolean} solid
892892- * @returns {RawRayIntersection | undefined}
893893- */
894894- coCastRayAndGetNormal(handle, rayOrig, rayDir, maxToi, solid) {
895895- _assertClass(rayOrig, RawVector);
896896- _assertClass(rayDir, RawVector);
897897- const ret = wasm.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);
898898- return ret === 0 ? void 0 : RawRayIntersection.__wrap(ret);
899899- }
900900- /**
901901- * @param {number} handle
902902- * @param {boolean} is_sensor
903903- */
904904- coSetSensor(handle, is_sensor) {
905905- wasm.rawcolliderset_coSetSensor(this.__wbg_ptr, handle, is_sensor);
906906- }
907907- /**
908908- * @param {number} handle
909909- * @param {number} restitution
910910- */
911911- coSetRestitution(handle, restitution) {
912912- wasm.rawcolliderset_coSetRestitution(this.__wbg_ptr, handle, restitution);
913913- }
914914- /**
915915- * @param {number} handle
916916- * @param {number} friction
917917- */
918918- coSetFriction(handle, friction) {
919919- wasm.rawcolliderset_coSetFriction(this.__wbg_ptr, handle, friction);
920920- }
921921- /**
922922- * @param {number} handle
923923- * @returns {number}
924924- */
925925- coFrictionCombineRule(handle) {
926926- const ret = wasm.rawcolliderset_coFrictionCombineRule(this.__wbg_ptr, handle);
927927- return ret >>> 0;
928928- }
929929- /**
930930- * @param {number} handle
931931- * @param {number} rule
932932- */
933933- coSetFrictionCombineRule(handle, rule) {
934934- wasm.rawcolliderset_coSetFrictionCombineRule(this.__wbg_ptr, handle, rule);
935935- }
936936- /**
937937- * @param {number} handle
938938- * @returns {number}
939939- */
940940- coRestitutionCombineRule(handle) {
941941- const ret = wasm.rawcolliderset_coRestitutionCombineRule(this.__wbg_ptr, handle);
942942- return ret >>> 0;
943943- }
944944- /**
945945- * @param {number} handle
946946- * @param {number} rule
947947- */
948948- coSetRestitutionCombineRule(handle, rule) {
949949- wasm.rawcolliderset_coSetRestitutionCombineRule(this.__wbg_ptr, handle, rule);
950950- }
951951- /**
952952- * @param {number} handle
953953- * @param {number} groups
954954- */
955955- coSetCollisionGroups(handle, groups) {
956956- wasm.rawcolliderset_coSetCollisionGroups(this.__wbg_ptr, handle, groups);
957957- }
958958- /**
959959- * @param {number} handle
960960- * @param {number} groups
961961- */
962962- coSetSolverGroups(handle, groups) {
963963- wasm.rawcolliderset_coSetSolverGroups(this.__wbg_ptr, handle, groups);
964964- }
965965- /**
966966- * @param {number} handle
967967- * @param {number} hooks
968968- */
969969- coSetActiveHooks(handle, hooks) {
970970- wasm.rawcolliderset_coSetActiveHooks(this.__wbg_ptr, handle, hooks);
971971- }
972972- /**
973973- * @param {number} handle
974974- * @param {number} events
975975- */
976976- coSetActiveEvents(handle, events) {
977977- wasm.rawcolliderset_coSetActiveEvents(this.__wbg_ptr, handle, events);
978978- }
979979- /**
980980- * @param {number} handle
981981- * @param {number} types
982982- */
983983- coSetActiveCollisionTypes(handle, types) {
984984- wasm.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, handle, types);
985985- }
986986- /**
987987- * @param {number} handle
988988- * @param {RawShape} shape
989989- */
990990- coSetShape(handle, shape) {
991991- _assertClass(shape, RawShape);
992992- wasm.rawcolliderset_coSetShape(this.__wbg_ptr, handle, shape.__wbg_ptr);
993993- }
994994- /**
995995- * @param {number} handle
996996- * @param {number} threshold
997997- */
998998- coSetContactForceEventThreshold(handle, threshold) {
999999- wasm.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, handle, threshold);
10001000- }
10011001- /**
10021002- * @param {number} handle
10031003- * @param {number} density
10041004- */
10051005- coSetDensity(handle, density) {
10061006- wasm.rawcolliderset_coSetDensity(this.__wbg_ptr, handle, density);
10071007- }
10081008- /**
10091009- * @param {number} handle
10101010- * @param {number} mass
10111011- */
10121012- coSetMass(handle, mass) {
10131013- wasm.rawcolliderset_coSetMass(this.__wbg_ptr, handle, mass);
10141014- }
10151015- /**
10161016- * @param {number} handle
10171017- * @param {number} mass
10181018- * @param {RawVector} centerOfMass
10191019- * @param {number} principalAngularInertia
10201020- */
10211021- coSetMassProperties(handle, mass, centerOfMass, principalAngularInertia) {
10221022- _assertClass(centerOfMass, RawVector);
10231023- wasm.rawcolliderset_coSetMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia);
10241024- }
10251025- /**
10261026- */
10271027- constructor() {
10281028- const ret = wasm.rawcolliderset_new();
10291029- this.__wbg_ptr = ret >>> 0;
10301030- return this;
10311031- }
10321032- /**
10331033- * @returns {number}
10341034- */
10351035- len() {
10361036- const ret = wasm.rawcolliderset_len(this.__wbg_ptr);
10371037- return ret >>> 0;
10381038- }
10391039- /**
10401040- * @param {number} handle
10411041- * @returns {boolean}
10421042- */
10431043- contains(handle) {
10441044- const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle);
10451045- return ret !== 0;
10461046- }
10471047- /**
10481048- * @param {boolean} enabled
10491049- * @param {RawShape} shape
10501050- * @param {RawVector} translation
10511051- * @param {RawRotation} rotation
10521052- * @param {number} massPropsMode
10531053- * @param {number} mass
10541054- * @param {RawVector} centerOfMass
10551055- * @param {number} principalAngularInertia
10561056- * @param {number} density
10571057- * @param {number} friction
10581058- * @param {number} restitution
10591059- * @param {number} frictionCombineRule
10601060- * @param {number} restitutionCombineRule
10611061- * @param {boolean} isSensor
10621062- * @param {number} collisionGroups
10631063- * @param {number} solverGroups
10641064- * @param {number} activeCollisionTypes
10651065- * @param {number} activeHooks
10661066- * @param {number} activeEvents
10671067- * @param {number} contactForceEventThreshold
10681068- * @param {number} contactSkin
10691069- * @param {boolean} hasParent
10701070- * @param {number} parent
10711071- * @param {RawRigidBodySet} bodies
10721072- * @returns {number | undefined}
10731073- */
10741074- createCollider(enabled, shape, translation, rotation, massPropsMode, mass, centerOfMass, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies) {
10751075- try {
10761076- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
10771077- _assertClass(shape, RawShape);
10781078- _assertClass(translation, RawVector);
10791079- _assertClass(rotation, RawRotation);
10801080- _assertClass(centerOfMass, RawVector);
10811081- _assertClass(bodies, RawRigidBodySet);
10821082- wasm.rawcolliderset_createCollider(retptr, this.__wbg_ptr, enabled, shape.__wbg_ptr, translation.__wbg_ptr, rotation.__wbg_ptr, massPropsMode, mass, centerOfMass.__wbg_ptr, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies.__wbg_ptr);
10831083- var r0 = getInt32Memory0()[retptr / 4 + 0];
10841084- var r2 = getFloat64Memory0()[retptr / 8 + 1];
10851085- return r0 === 0 ? void 0 : r2;
10861086- } finally {
10871087- wasm.__wbindgen_add_to_stack_pointer(16);
10881088- }
10891089- }
10901090- /**
10911091- * Removes a collider from this set and wake-up the rigid-body it is attached to.
10921092- * @param {number} handle
10931093- * @param {RawIslandManager} islands
10941094- * @param {RawRigidBodySet} bodies
10951095- * @param {boolean} wakeUp
10961096- */
10971097- remove(handle, islands, bodies, wakeUp) {
10981098- _assertClass(islands, RawIslandManager);
10991099- _assertClass(bodies, RawRigidBodySet);
11001100- wasm.rawcolliderset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, bodies.__wbg_ptr, wakeUp);
11011101- }
11021102- /**
11031103- * Checks if a collider with the given integer handle exists.
11041104- * @param {number} handle
11051105- * @returns {boolean}
11061106- */
11071107- isHandleValid(handle) {
11081108- const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle);
11091109- return ret !== 0;
11101110- }
11111111- /**
11121112- * Applies the given JavaScript function to the integer handle of each collider managed by this collider set.
11131113- *
11141114- * # Parameters
11151115- * - `f(handle)`: the function to apply to the integer handle of each collider managed by this collider set. Called as `f(handle)`.
11161116- * @param {Function} f
11171117- */
11181118- forEachColliderHandle(f) {
11191119- try {
11201120- wasm.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, addBorrowedObject(f));
11211121- } finally {
11221122- heap[stack_pointer++] = void 0;
11231123- }
11241124- }
11251125-};
11261126-var RawColliderShapeCastHit = class _RawColliderShapeCastHit {
11271127- static __wrap(ptr) {
11281128- ptr = ptr >>> 0;
11291129- const obj = Object.create(_RawColliderShapeCastHit.prototype);
11301130- obj.__wbg_ptr = ptr;
11311131- return obj;
11321132- }
11331133- __destroy_into_raw() {
11341134- const ptr = this.__wbg_ptr;
11351135- this.__wbg_ptr = 0;
11361136- return ptr;
11371137- }
11381138- free() {
11391139- const ptr = this.__destroy_into_raw();
11401140- wasm.__wbg_rawcollidershapecasthit_free(ptr);
11411141- }
11421142- /**
11431143- * @returns {number}
11441144- */
11451145- colliderHandle() {
11461146- const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr);
11471147- return ret;
11481148- }
11491149- /**
11501150- * @returns {number}
11511151- */
11521152- time_of_impact() {
11531153- const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
11541154- return ret;
11551155- }
11561156- /**
11571157- * @returns {RawVector}
11581158- */
11591159- witness1() {
11601160- const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);
11611161- return RawVector.__wrap(ret);
11621162- }
11631163- /**
11641164- * @returns {RawVector}
11651165- */
11661166- witness2() {
11671167- const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr);
11681168- return RawVector.__wrap(ret);
11691169- }
11701170- /**
11711171- * @returns {RawVector}
11721172- */
11731173- normal1() {
11741174- const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr);
11751175- return RawVector.__wrap(ret);
11761176- }
11771177- /**
11781178- * @returns {RawVector}
11791179- */
11801180- normal2() {
11811181- const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr);
11821182- return RawVector.__wrap(ret);
11831183- }
11841184-};
11851185-var RawContactManifold = class _RawContactManifold {
11861186- static __wrap(ptr) {
11871187- ptr = ptr >>> 0;
11881188- const obj = Object.create(_RawContactManifold.prototype);
11891189- obj.__wbg_ptr = ptr;
11901190- return obj;
11911191- }
11921192- __destroy_into_raw() {
11931193- const ptr = this.__wbg_ptr;
11941194- this.__wbg_ptr = 0;
11951195- return ptr;
11961196- }
11971197- free() {
11981198- const ptr = this.__destroy_into_raw();
11991199- wasm.__wbg_rawcontactmanifold_free(ptr);
12001200- }
12011201- /**
12021202- * @returns {RawVector}
12031203- */
12041204- normal() {
12051205- const ret = wasm.rawcontactmanifold_normal(this.__wbg_ptr);
12061206- return RawVector.__wrap(ret);
12071207- }
12081208- /**
12091209- * @returns {RawVector}
12101210- */
12111211- local_n1() {
12121212- const ret = wasm.rawcontactmanifold_local_n1(this.__wbg_ptr);
12131213- return RawVector.__wrap(ret);
12141214- }
12151215- /**
12161216- * @returns {RawVector}
12171217- */
12181218- local_n2() {
12191219- const ret = wasm.rawcontactmanifold_local_n2(this.__wbg_ptr);
12201220- return RawVector.__wrap(ret);
12211221- }
12221222- /**
12231223- * @returns {number}
12241224- */
12251225- subshape1() {
12261226- const ret = wasm.rawcontactmanifold_subshape1(this.__wbg_ptr);
12271227- return ret >>> 0;
12281228- }
12291229- /**
12301230- * @returns {number}
12311231- */
12321232- subshape2() {
12331233- const ret = wasm.rawcontactmanifold_subshape2(this.__wbg_ptr);
12341234- return ret >>> 0;
12351235- }
12361236- /**
12371237- * @returns {number}
12381238- */
12391239- num_contacts() {
12401240- const ret = wasm.rawcontactmanifold_num_contacts(this.__wbg_ptr);
12411241- return ret >>> 0;
12421242- }
12431243- /**
12441244- * @param {number} i
12451245- * @returns {RawVector | undefined}
12461246- */
12471247- contact_local_p1(i) {
12481248- const ret = wasm.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, i);
12491249- return ret === 0 ? void 0 : RawVector.__wrap(ret);
12501250- }
12511251- /**
12521252- * @param {number} i
12531253- * @returns {RawVector | undefined}
12541254- */
12551255- contact_local_p2(i) {
12561256- const ret = wasm.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, i);
12571257- return ret === 0 ? void 0 : RawVector.__wrap(ret);
12581258- }
12591259- /**
12601260- * @param {number} i
12611261- * @returns {number}
12621262- */
12631263- contact_dist(i) {
12641264- const ret = wasm.rawcontactmanifold_contact_dist(this.__wbg_ptr, i);
12651265- return ret;
12661266- }
12671267- /**
12681268- * @param {number} i
12691269- * @returns {number}
12701270- */
12711271- contact_fid1(i) {
12721272- const ret = wasm.rawcontactmanifold_contact_fid1(this.__wbg_ptr, i);
12731273- return ret >>> 0;
12741274- }
12751275- /**
12761276- * @param {number} i
12771277- * @returns {number}
12781278- */
12791279- contact_fid2(i) {
12801280- const ret = wasm.rawcontactmanifold_contact_fid2(this.__wbg_ptr, i);
12811281- return ret >>> 0;
12821282- }
12831283- /**
12841284- * @param {number} i
12851285- * @returns {number}
12861286- */
12871287- contact_impulse(i) {
12881288- const ret = wasm.rawcontactmanifold_contact_impulse(this.__wbg_ptr, i);
12891289- return ret;
12901290- }
12911291- /**
12921292- * @param {number} i
12931293- * @returns {number}
12941294- */
12951295- contact_tangent_impulse(i) {
12961296- const ret = wasm.rawcontactmanifold_contact_tangent_impulse(this.__wbg_ptr, i);
12971297- return ret;
12981298- }
12991299- /**
13001300- * @returns {number}
13011301- */
13021302- num_solver_contacts() {
13031303- const ret = wasm.rawcontactmanifold_num_solver_contacts(this.__wbg_ptr);
13041304- return ret >>> 0;
13051305- }
13061306- /**
13071307- * @param {number} i
13081308- * @returns {RawVector | undefined}
13091309- */
13101310- solver_contact_point(i) {
13111311- const ret = wasm.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, i);
13121312- return ret === 0 ? void 0 : RawVector.__wrap(ret);
13131313- }
13141314- /**
13151315- * @param {number} i
13161316- * @returns {number}
13171317- */
13181318- solver_contact_dist(i) {
13191319- const ret = wasm.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, i);
13201320- return ret;
13211321- }
13221322- /**
13231323- * @param {number} i
13241324- * @returns {number}
13251325- */
13261326- solver_contact_friction(i) {
13271327- const ret = wasm.rawcontactmanifold_solver_contact_friction(this.__wbg_ptr, i);
13281328- return ret;
13291329- }
13301330- /**
13311331- * @param {number} i
13321332- * @returns {number}
13331333- */
13341334- solver_contact_restitution(i) {
13351335- const ret = wasm.rawcontactmanifold_solver_contact_restitution(this.__wbg_ptr, i);
13361336- return ret;
13371337- }
13381338- /**
13391339- * @param {number} i
13401340- * @returns {RawVector}
13411341- */
13421342- solver_contact_tangent_velocity(i) {
13431343- const ret = wasm.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, i);
13441344- return RawVector.__wrap(ret);
13451345- }
13461346-};
13471347-var RawContactPair = class _RawContactPair {
13481348- static __wrap(ptr) {
13491349- ptr = ptr >>> 0;
13501350- const obj = Object.create(_RawContactPair.prototype);
13511351- obj.__wbg_ptr = ptr;
13521352- return obj;
13531353- }
13541354- __destroy_into_raw() {
13551355- const ptr = this.__wbg_ptr;
13561356- this.__wbg_ptr = 0;
13571357- return ptr;
13581358- }
13591359- free() {
13601360- const ptr = this.__destroy_into_raw();
13611361- wasm.__wbg_rawcontactpair_free(ptr);
13621362- }
13631363- /**
13641364- * @returns {number}
13651365- */
13661366- collider1() {
13671367- const ret = wasm.rawcontactpair_collider1(this.__wbg_ptr);
13681368- return ret;
13691369- }
13701370- /**
13711371- * @returns {number}
13721372- */
13731373- collider2() {
13741374- const ret = wasm.rawcontactpair_collider2(this.__wbg_ptr);
13751375- return ret;
13761376- }
13771377- /**
13781378- * @returns {number}
13791379- */
13801380- numContactManifolds() {
13811381- const ret = wasm.rawcontactpair_numContactManifolds(this.__wbg_ptr);
13821382- return ret >>> 0;
13831383- }
13841384- /**
13851385- * @param {number} i
13861386- * @returns {RawContactManifold | undefined}
13871387- */
13881388- contactManifold(i) {
13891389- const ret = wasm.rawcontactpair_contactManifold(this.__wbg_ptr, i);
13901390- return ret === 0 ? void 0 : RawContactManifold.__wrap(ret);
13911391- }
13921392-};
13931393-var RawDebugRenderPipeline = class {
13941394- __destroy_into_raw() {
13951395- const ptr = this.__wbg_ptr;
13961396- this.__wbg_ptr = 0;
13971397- return ptr;
13981398- }
13991399- free() {
14001400- const ptr = this.__destroy_into_raw();
14011401- wasm.__wbg_rawdebugrenderpipeline_free(ptr);
14021402- }
14031403- /**
14041404- */
14051405- constructor() {
14061406- const ret = wasm.rawdebugrenderpipeline_new();
14071407- this.__wbg_ptr = ret >>> 0;
14081408- return this;
14091409- }
14101410- /**
14111411- * @returns {Float32Array}
14121412- */
14131413- vertices() {
14141414- const ret = wasm.rawdebugrenderpipeline_vertices(this.__wbg_ptr);
14151415- return takeObject(ret);
14161416- }
14171417- /**
14181418- * @returns {Float32Array}
14191419- */
14201420- colors() {
14211421- const ret = wasm.rawdebugrenderpipeline_colors(this.__wbg_ptr);
14221422- return takeObject(ret);
14231423- }
14241424- /**
14251425- * @param {RawRigidBodySet} bodies
14261426- * @param {RawColliderSet} colliders
14271427- * @param {RawImpulseJointSet} impulse_joints
14281428- * @param {RawMultibodyJointSet} multibody_joints
14291429- * @param {RawNarrowPhase} narrow_phase
14301430- */
14311431- render(bodies, colliders, impulse_joints, multibody_joints, narrow_phase) {
14321432- _assertClass(bodies, RawRigidBodySet);
14331433- _assertClass(colliders, RawColliderSet);
14341434- _assertClass(impulse_joints, RawImpulseJointSet);
14351435- _assertClass(multibody_joints, RawMultibodyJointSet);
14361436- _assertClass(narrow_phase, RawNarrowPhase);
14371437- wasm.rawdebugrenderpipeline_render(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, impulse_joints.__wbg_ptr, multibody_joints.__wbg_ptr, narrow_phase.__wbg_ptr);
14381438- }
14391439-};
14401440-var RawDeserializedWorld = class _RawDeserializedWorld {
14411441- static __wrap(ptr) {
14421442- ptr = ptr >>> 0;
14431443- const obj = Object.create(_RawDeserializedWorld.prototype);
14441444- obj.__wbg_ptr = ptr;
14451445- return obj;
14461446- }
14471447- __destroy_into_raw() {
14481448- const ptr = this.__wbg_ptr;
14491449- this.__wbg_ptr = 0;
14501450- return ptr;
14511451- }
14521452- free() {
14531453- const ptr = this.__destroy_into_raw();
14541454- wasm.__wbg_rawdeserializedworld_free(ptr);
14551455- }
14561456- /**
14571457- * @returns {RawVector | undefined}
14581458- */
14591459- takeGravity() {
14601460- const ret = wasm.rawdeserializedworld_takeGravity(this.__wbg_ptr);
14611461- return ret === 0 ? void 0 : RawVector.__wrap(ret);
14621462- }
14631463- /**
14641464- * @returns {RawIntegrationParameters | undefined}
14651465- */
14661466- takeIntegrationParameters() {
14671467- const ret = wasm.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
14681468- return ret === 0 ? void 0 : RawIntegrationParameters.__wrap(ret);
14691469- }
14701470- /**
14711471- * @returns {RawIslandManager | undefined}
14721472- */
14731473- takeIslandManager() {
14741474- const ret = wasm.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);
14751475- return ret === 0 ? void 0 : RawIslandManager.__wrap(ret);
14761476- }
14771477- /**
14781478- * @returns {RawBroadPhase | undefined}
14791479- */
14801480- takeBroadPhase() {
14811481- const ret = wasm.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);
14821482- return ret === 0 ? void 0 : RawBroadPhase.__wrap(ret);
14831483- }
14841484- /**
14851485- * @returns {RawNarrowPhase | undefined}
14861486- */
14871487- takeNarrowPhase() {
14881488- const ret = wasm.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr);
14891489- return ret === 0 ? void 0 : RawNarrowPhase.__wrap(ret);
14901490- }
14911491- /**
14921492- * @returns {RawRigidBodySet | undefined}
14931493- */
14941494- takeBodies() {
14951495- const ret = wasm.rawdeserializedworld_takeBodies(this.__wbg_ptr);
14961496- return ret === 0 ? void 0 : RawRigidBodySet.__wrap(ret);
14971497- }
14981498- /**
14991499- * @returns {RawColliderSet | undefined}
15001500- */
15011501- takeColliders() {
15021502- const ret = wasm.rawdeserializedworld_takeColliders(this.__wbg_ptr);
15031503- return ret === 0 ? void 0 : RawColliderSet.__wrap(ret);
15041504- }
15051505- /**
15061506- * @returns {RawImpulseJointSet | undefined}
15071507- */
15081508- takeImpulseJoints() {
15091509- const ret = wasm.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr);
15101510- return ret === 0 ? void 0 : RawImpulseJointSet.__wrap(ret);
15111511- }
15121512- /**
15131513- * @returns {RawMultibodyJointSet | undefined}
15141514- */
15151515- takeMultibodyJoints() {
15161516- const ret = wasm.rawdeserializedworld_takeMultibodyJoints(this.__wbg_ptr);
15171517- return ret === 0 ? void 0 : RawMultibodyJointSet.__wrap(ret);
15181518- }
15191519-};
15201520-var RawEventQueue = class {
15211521- __destroy_into_raw() {
15221522- const ptr = this.__wbg_ptr;
15231523- this.__wbg_ptr = 0;
15241524- return ptr;
15251525- }
15261526- free() {
15271527- const ptr = this.__destroy_into_raw();
15281528- wasm.__wbg_raweventqueue_free(ptr);
15291529- }
15301530- /**
15311531- * Creates a new event collector.
15321532- *
15331533- * # Parameters
15341534- * - `autoDrain`: setting this to `true` is strongly recommended. If true, the collector will
15351535- * be automatically drained before each `world.step(collector)`. If false, the collector will
15361536- * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of
15371537- * RAM if no drain is performed.
15381538- * @param {boolean} autoDrain
15391539- */
15401540- constructor(autoDrain) {
15411541- const ret = wasm.raweventqueue_new(autoDrain);
15421542- this.__wbg_ptr = ret >>> 0;
15431543- return this;
15441544- }
15451545- /**
15461546- * Applies the given javascript closure on each collision event of this collector, then clear
15471547- * the internal collision event buffer.
15481548- *
15491549- * # Parameters
15501550- * - `f(handle1, handle2, started)`: JavaScript closure applied to each collision event. The
15511551- * closure should take three arguments: two integers representing the handles of the colliders
15521552- * involved in the collision, and a boolean indicating if the collision started (true) or stopped
15531553- * (false).
15541554- * @param {Function} f
15551555- */
15561556- drainCollisionEvents(f) {
15571557- try {
15581558- wasm.raweventqueue_drainCollisionEvents(this.__wbg_ptr, addBorrowedObject(f));
15591559- } finally {
15601560- heap[stack_pointer++] = void 0;
15611561- }
15621562- }
15631563- /**
15641564- * @param {Function} f
15651565- */
15661566- drainContactForceEvents(f) {
15671567- try {
15681568- wasm.raweventqueue_drainContactForceEvents(this.__wbg_ptr, addBorrowedObject(f));
15691569- } finally {
15701570- heap[stack_pointer++] = void 0;
15711571- }
15721572- }
15731573- /**
15741574- * Removes all events contained by this collector.
15751575- */
15761576- clear() {
15771577- wasm.raweventqueue_clear(this.__wbg_ptr);
15781578- }
15791579-};
15801580-var RawGenericJoint = class _RawGenericJoint {
15811581- static __wrap(ptr) {
15821582- ptr = ptr >>> 0;
15831583- const obj = Object.create(_RawGenericJoint.prototype);
15841584- obj.__wbg_ptr = ptr;
15851585- return obj;
15861586- }
15871587- __destroy_into_raw() {
15881588- const ptr = this.__wbg_ptr;
15891589- this.__wbg_ptr = 0;
15901590- return ptr;
15911591- }
15921592- free() {
15931593- const ptr = this.__destroy_into_raw();
15941594- wasm.__wbg_rawgenericjoint_free(ptr);
15951595- }
15961596- /**
15971597- * @param {number} rest_length
15981598- * @param {number} stiffness
15991599- * @param {number} damping
16001600- * @param {RawVector} anchor1
16011601- * @param {RawVector} anchor2
16021602- * @returns {RawGenericJoint}
16031603- */
16041604- static spring(rest_length, stiffness, damping, anchor1, anchor2) {
16051605- _assertClass(anchor1, RawVector);
16061606- _assertClass(anchor2, RawVector);
16071607- const ret = wasm.rawgenericjoint_spring(rest_length, stiffness, damping, anchor1.__wbg_ptr, anchor2.__wbg_ptr);
16081608- return _RawGenericJoint.__wrap(ret);
16091609- }
16101610- /**
16111611- * @param {number} length
16121612- * @param {RawVector} anchor1
16131613- * @param {RawVector} anchor2
16141614- * @returns {RawGenericJoint}
16151615- */
16161616- static rope(length, anchor1, anchor2) {
16171617- _assertClass(anchor1, RawVector);
16181618- _assertClass(anchor2, RawVector);
16191619- const ret = wasm.rawgenericjoint_rope(length, anchor1.__wbg_ptr, anchor2.__wbg_ptr);
16201620- return _RawGenericJoint.__wrap(ret);
16211621- }
16221622- /**
16231623- * Creates a new joint descriptor that builds a Prismatic joint.
16241624- *
16251625- * A prismatic joint removes all the degrees of freedom between the
16261626- * affected bodies, except for the translation along one axis.
16271627- *
16281628- * Returns `None` if any of the provided axes cannot be normalized.
16291629- * @param {RawVector} anchor1
16301630- * @param {RawVector} anchor2
16311631- * @param {RawVector} axis
16321632- * @param {boolean} limitsEnabled
16331633- * @param {number} limitsMin
16341634- * @param {number} limitsMax
16351635- * @returns {RawGenericJoint | undefined}
16361636- */
16371637- static prismatic(anchor1, anchor2, axis, limitsEnabled, limitsMin, limitsMax) {
16381638- _assertClass(anchor1, RawVector);
16391639- _assertClass(anchor2, RawVector);
16401640- _assertClass(axis, RawVector);
16411641- const ret = wasm.rawgenericjoint_prismatic(anchor1.__wbg_ptr, anchor2.__wbg_ptr, axis.__wbg_ptr, limitsEnabled, limitsMin, limitsMax);
16421642- return ret === 0 ? void 0 : _RawGenericJoint.__wrap(ret);
16431643- }
16441644- /**
16451645- * Creates a new joint descriptor that builds a Fixed joint.
16461646- *
16471647- * A fixed joint removes all the degrees of freedom between the affected bodies.
16481648- * @param {RawVector} anchor1
16491649- * @param {RawRotation} axes1
16501650- * @param {RawVector} anchor2
16511651- * @param {RawRotation} axes2
16521652- * @returns {RawGenericJoint}
16531653- */
16541654- static fixed(anchor1, axes1, anchor2, axes2) {
16551655- _assertClass(anchor1, RawVector);
16561656- _assertClass(axes1, RawRotation);
16571657- _assertClass(anchor2, RawVector);
16581658- _assertClass(axes2, RawRotation);
16591659- const ret = wasm.rawgenericjoint_fixed(anchor1.__wbg_ptr, axes1.__wbg_ptr, anchor2.__wbg_ptr, axes2.__wbg_ptr);
16601660- return _RawGenericJoint.__wrap(ret);
16611661- }
16621662- /**
16631663- * Create a new joint descriptor that builds Revolute joints.
16641664- *
16651665- * A revolute joint removes all degrees of freedom between the affected
16661666- * bodies except for the rotation.
16671667- * @param {RawVector} anchor1
16681668- * @param {RawVector} anchor2
16691669- * @returns {RawGenericJoint | undefined}
16701670- */
16711671- static revolute(anchor1, anchor2) {
16721672- _assertClass(anchor1, RawVector);
16731673- _assertClass(anchor2, RawVector);
16741674- const ret = wasm.rawgenericjoint_revolute(anchor1.__wbg_ptr, anchor2.__wbg_ptr);
16751675- return ret === 0 ? void 0 : _RawGenericJoint.__wrap(ret);
16761676- }
16771677-};
16781678-var RawImpulseJointSet = class _RawImpulseJointSet {
16791679- static __wrap(ptr) {
16801680- ptr = ptr >>> 0;
16811681- const obj = Object.create(_RawImpulseJointSet.prototype);
16821682- obj.__wbg_ptr = ptr;
16831683- return obj;
16841684- }
16851685- __destroy_into_raw() {
16861686- const ptr = this.__wbg_ptr;
16871687- this.__wbg_ptr = 0;
16881688- return ptr;
16891689- }
16901690- free() {
16911691- const ptr = this.__destroy_into_raw();
16921692- wasm.__wbg_rawimpulsejointset_free(ptr);
16931693- }
16941694- /**
16951695- * The type of this joint.
16961696- * @param {number} handle
16971697- * @returns {RawJointType}
16981698- */
16991699- jointType(handle) {
17001700- const ret = wasm.rawimpulsejointset_jointType(this.__wbg_ptr, handle);
17011701- return ret;
17021702- }
17031703- /**
17041704- * The unique integer identifier of the first rigid-body this joint it attached to.
17051705- * @param {number} handle
17061706- * @returns {number}
17071707- */
17081708- jointBodyHandle1(handle) {
17091709- const ret = wasm.rawimpulsejointset_jointBodyHandle1(this.__wbg_ptr, handle);
17101710- return ret;
17111711- }
17121712- /**
17131713- * The unique integer identifier of the second rigid-body this joint is attached to.
17141714- * @param {number} handle
17151715- * @returns {number}
17161716- */
17171717- jointBodyHandle2(handle) {
17181718- const ret = wasm.rawimpulsejointset_jointBodyHandle2(this.__wbg_ptr, handle);
17191719- return ret;
17201720- }
17211721- /**
17221722- * The angular part of the joint’s local frame relative to the first rigid-body it is attached to.
17231723- * @param {number} handle
17241724- * @returns {RawRotation}
17251725- */
17261726- jointFrameX1(handle) {
17271727- const ret = wasm.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, handle);
17281728- return RawRotation.__wrap(ret);
17291729- }
17301730- /**
17311731- * The angular part of the joint’s local frame relative to the second rigid-body it is attached to.
17321732- * @param {number} handle
17331733- * @returns {RawRotation}
17341734- */
17351735- jointFrameX2(handle) {
17361736- const ret = wasm.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, handle);
17371737- return RawRotation.__wrap(ret);
17381738- }
17391739- /**
17401740- * The position of the first anchor of this joint.
17411741- *
17421742- * The first anchor gives the position of the points application point on the
17431743- * local frame of the first rigid-body it is attached to.
17441744- * @param {number} handle
17451745- * @returns {RawVector}
17461746- */
17471747- jointAnchor1(handle) {
17481748- const ret = wasm.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, handle);
17491749- return RawVector.__wrap(ret);
17501750- }
17511751- /**
17521752- * The position of the second anchor of this joint.
17531753- *
17541754- * The second anchor gives the position of the points application point on the
17551755- * local frame of the second rigid-body it is attached to.
17561756- * @param {number} handle
17571757- * @returns {RawVector}
17581758- */
17591759- jointAnchor2(handle) {
17601760- const ret = wasm.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, handle);
17611761- return RawVector.__wrap(ret);
17621762- }
17631763- /**
17641764- * Sets the position of the first local anchor
17651765- * @param {number} handle
17661766- * @param {RawVector} newPos
17671767- */
17681768- jointSetAnchor1(handle, newPos) {
17691769- _assertClass(newPos, RawVector);
17701770- wasm.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, handle, newPos.__wbg_ptr);
17711771- }
17721772- /**
17731773- * Sets the position of the second local anchor
17741774- * @param {number} handle
17751775- * @param {RawVector} newPos
17761776- */
17771777- jointSetAnchor2(handle, newPos) {
17781778- _assertClass(newPos, RawVector);
17791779- wasm.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, handle, newPos.__wbg_ptr);
17801780- }
17811781- /**
17821782- * Are contacts between the rigid-bodies attached by this joint enabled?
17831783- * @param {number} handle
17841784- * @returns {boolean}
17851785- */
17861786- jointContactsEnabled(handle) {
17871787- const ret = wasm.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, handle);
17881788- return ret !== 0;
17891789- }
17901790- /**
17911791- * Sets whether contacts are enabled between the rigid-bodies attached by this joint.
17921792- * @param {number} handle
17931793- * @param {boolean} enabled
17941794- */
17951795- jointSetContactsEnabled(handle, enabled) {
17961796- wasm.rawimpulsejointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled);
17971797- }
17981798- /**
17991799- * Are the limits for this joint enabled?
18001800- * @param {number} handle
18011801- * @param {RawJointAxis} axis
18021802- * @returns {boolean}
18031803- */
18041804- jointLimitsEnabled(handle, axis) {
18051805- const ret = wasm.rawimpulsejointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis);
18061806- return ret !== 0;
18071807- }
18081808- /**
18091809- * Return the lower limit along the given joint axis.
18101810- * @param {number} handle
18111811- * @param {RawJointAxis} axis
18121812- * @returns {number}
18131813- */
18141814- jointLimitsMin(handle, axis) {
18151815- const ret = wasm.rawimpulsejointset_jointLimitsMin(this.__wbg_ptr, handle, axis);
18161816- return ret;
18171817- }
18181818- /**
18191819- * If this is a prismatic joint, returns its upper limit.
18201820- * @param {number} handle
18211821- * @param {RawJointAxis} axis
18221822- * @returns {number}
18231823- */
18241824- jointLimitsMax(handle, axis) {
18251825- const ret = wasm.rawimpulsejointset_jointLimitsMax(this.__wbg_ptr, handle, axis);
18261826- return ret;
18271827- }
18281828- /**
18291829- * Enables and sets the joint limits
18301830- * @param {number} handle
18311831- * @param {RawJointAxis} axis
18321832- * @param {number} min
18331833- * @param {number} max
18341834- */
18351835- jointSetLimits(handle, axis, min, max) {
18361836- wasm.rawimpulsejointset_jointSetLimits(this.__wbg_ptr, handle, axis, min, max);
18371837- }
18381838- /**
18391839- * @param {number} handle
18401840- * @param {RawJointAxis} axis
18411841- * @param {RawMotorModel} model
18421842- */
18431843- jointConfigureMotorModel(handle, axis, model) {
18441844- wasm.rawimpulsejointset_jointConfigureMotorModel(this.__wbg_ptr, handle, axis, model);
18451845- }
18461846- /**
18471847- * @param {number} handle
18481848- * @param {RawJointAxis} axis
18491849- * @param {number} targetVel
18501850- * @param {number} factor
18511851- */
18521852- jointConfigureMotorVelocity(handle, axis, targetVel, factor) {
18531853- wasm.rawimpulsejointset_jointConfigureMotorVelocity(this.__wbg_ptr, handle, axis, targetVel, factor);
18541854- }
18551855- /**
18561856- * @param {number} handle
18571857- * @param {RawJointAxis} axis
18581858- * @param {number} targetPos
18591859- * @param {number} stiffness
18601860- * @param {number} damping
18611861- */
18621862- jointConfigureMotorPosition(handle, axis, targetPos, stiffness, damping) {
18631863- wasm.rawimpulsejointset_jointConfigureMotorPosition(this.__wbg_ptr, handle, axis, targetPos, stiffness, damping);
18641864- }
18651865- /**
18661866- * @param {number} handle
18671867- * @param {RawJointAxis} axis
18681868- * @param {number} targetPos
18691869- * @param {number} targetVel
18701870- * @param {number} stiffness
18711871- * @param {number} damping
18721872- */
18731873- jointConfigureMotor(handle, axis, targetPos, targetVel, stiffness, damping) {
18741874- wasm.rawimpulsejointset_jointConfigureMotor(this.__wbg_ptr, handle, axis, targetPos, targetVel, stiffness, damping);
18751875- }
18761876- /**
18771877- */
18781878- constructor() {
18791879- const ret = wasm.rawimpulsejointset_new();
18801880- this.__wbg_ptr = ret >>> 0;
18811881- return this;
18821882- }
18831883- /**
18841884- * @param {RawGenericJoint} params
18851885- * @param {number} parent1
18861886- * @param {number} parent2
18871887- * @param {boolean} wake_up
18881888- * @returns {number}
18891889- */
18901890- createJoint(params, parent1, parent2, wake_up) {
18911891- _assertClass(params, RawGenericJoint);
18921892- const ret = wasm.rawimpulsejointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wake_up);
18931893- return ret;
18941894- }
18951895- /**
18961896- * @param {number} handle
18971897- * @param {boolean} wakeUp
18981898- */
18991899- remove(handle, wakeUp) {
19001900- wasm.rawimpulsejointset_remove(this.__wbg_ptr, handle, wakeUp);
19011901- }
19021902- /**
19031903- * @returns {number}
19041904- */
19051905- len() {
19061906- const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr);
19071907- return ret >>> 0;
19081908- }
19091909- /**
19101910- * @param {number} handle
19111911- * @returns {boolean}
19121912- */
19131913- contains(handle) {
19141914- const ret = wasm.rawimpulsejointset_contains(this.__wbg_ptr, handle);
19151915- return ret !== 0;
19161916- }
19171917- /**
19181918- * Applies the given JavaScript function to the integer handle of each joint managed by this physics world.
19191919- *
19201920- * # Parameters
19211921- * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`.
19221922- * @param {Function} f
19231923- */
19241924- forEachJointHandle(f) {
19251925- try {
19261926- wasm.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f));
19271927- } finally {
19281928- heap[stack_pointer++] = void 0;
19291929- }
19301930- }
19311931- /**
19321932- * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body.
19331933- *
19341934- * # Parameters
19351935- * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`.
19361936- * @param {number} body
19371937- * @param {Function} f
19381938- */
19391939- forEachJointAttachedToRigidBody(body, f) {
19401940- try {
19411941- wasm.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f));
19421942- } finally {
19431943- heap[stack_pointer++] = void 0;
19441944- }
19451945- }
19461946-};
19471947-var RawIntegrationParameters = class _RawIntegrationParameters {
19481948- static __wrap(ptr) {
19491949- ptr = ptr >>> 0;
19501950- const obj = Object.create(_RawIntegrationParameters.prototype);
19511951- obj.__wbg_ptr = ptr;
19521952- return obj;
19531953- }
19541954- __destroy_into_raw() {
19551955- const ptr = this.__wbg_ptr;
19561956- this.__wbg_ptr = 0;
19571957- return ptr;
19581958- }
19591959- free() {
19601960- const ptr = this.__destroy_into_raw();
19611961- wasm.__wbg_rawintegrationparameters_free(ptr);
19621962- }
19631963- /**
19641964- */
19651965- constructor() {
19661966- const ret = wasm.rawintegrationparameters_new();
19671967- this.__wbg_ptr = ret >>> 0;
19681968- return this;
19691969- }
19701970- /**
19711971- * @returns {number}
19721972- */
19731973- get dt() {
19741974- const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);
19751975- return ret;
19761976- }
19771977- /**
19781978- * @returns {number}
19791979- */
19801980- get erp() {
19811981- const ret = wasm.rawintegrationparameters_erp(this.__wbg_ptr);
19821982- return ret;
19831983- }
19841984- /**
19851985- * @returns {number}
19861986- */
19871987- get normalizedAllowedLinearError() {
19881988- const ret = wasm.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);
19891989- return ret;
19901990- }
19911991- /**
19921992- * @returns {number}
19931993- */
19941994- get normalizedPredictionDistance() {
19951995- const ret = wasm.rawintegrationparameters_normalizedPredictionDistance(this.__wbg_ptr);
19961996- return ret;
19971997- }
19981998- /**
19991999- * @returns {number}
20002000- */
20012001- get numSolverIterations() {
20022002- const ret = wasm.rawintegrationparameters_numSolverIterations(this.__wbg_ptr);
20032003- return ret >>> 0;
20042004- }
20052005- /**
20062006- * @returns {number}
20072007- */
20082008- get numAdditionalFrictionIterations() {
20092009- const ret = wasm.rawintegrationparameters_numAdditionalFrictionIterations(this.__wbg_ptr);
20102010- return ret >>> 0;
20112011- }
20122012- /**
20132013- * @returns {number}
20142014- */
20152015- get numInternalPgsIterations() {
20162016- const ret = wasm.rawintegrationparameters_numInternalPgsIterations(this.__wbg_ptr);
20172017- return ret >>> 0;
20182018- }
20192019- /**
20202020- * @returns {number}
20212021- */
20222022- get minIslandSize() {
20232023- const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr);
20242024- return ret >>> 0;
20252025- }
20262026- /**
20272027- * @returns {number}
20282028- */
20292029- get maxCcdSubsteps() {
20302030- const ret = wasm.rawintegrationparameters_maxCcdSubsteps(this.__wbg_ptr);
20312031- return ret >>> 0;
20322032- }
20332033- /**
20342034- * @returns {number}
20352035- */
20362036- get lengthUnit() {
20372037- const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
20382038- return ret;
20392039- }
20402040- /**
20412041- * @param {number} value
20422042- */
20432043- set dt(value) {
20442044- wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, value);
20452045- }
20462046- /**
20472047- * @param {number} value
20482048- */
20492049- set erp(value) {
20502050- wasm.rawintegrationparameters_set_erp(this.__wbg_ptr, value);
20512051- }
20522052- /**
20532053- * @param {number} value
20542054- */
20552055- set normalizedAllowedLinearError(value) {
20562056- wasm.rawintegrationparameters_set_normalizedAllowedLinearError(this.__wbg_ptr, value);
20572057- }
20582058- /**
20592059- * @param {number} value
20602060- */
20612061- set normalizedPredictionDistance(value) {
20622062- wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, value);
20632063- }
20642064- /**
20652065- * @param {number} value
20662066- */
20672067- set numSolverIterations(value) {
20682068- wasm.rawintegrationparameters_set_numSolverIterations(this.__wbg_ptr, value);
20692069- }
20702070- /**
20712071- * @param {number} value
20722072- */
20732073- set numAdditionalFrictionIterations(value) {
20742074- wasm.rawintegrationparameters_set_numAdditionalFrictionIterations(this.__wbg_ptr, value);
20752075- }
20762076- /**
20772077- * @param {number} value
20782078- */
20792079- set numInternalPgsIterations(value) {
20802080- wasm.rawintegrationparameters_set_numInternalPgsIterations(this.__wbg_ptr, value);
20812081- }
20822082- /**
20832083- * @param {number} value
20842084- */
20852085- set minIslandSize(value) {
20862086- wasm.rawintegrationparameters_set_minIslandSize(this.__wbg_ptr, value);
20872087- }
20882088- /**
20892089- * @param {number} value
20902090- */
20912091- set maxCcdSubsteps(value) {
20922092- wasm.rawintegrationparameters_set_maxCcdSubsteps(this.__wbg_ptr, value);
20932093- }
20942094- /**
20952095- * @param {number} value
20962096- */
20972097- set lengthUnit(value) {
20982098- wasm.rawintegrationparameters_set_lengthUnit(this.__wbg_ptr, value);
20992099- }
21002100- /**
21012101- */
21022102- switchToStandardPgsSolver() {
21032103- wasm.rawintegrationparameters_switchToStandardPgsSolver(this.__wbg_ptr);
21042104- }
21052105- /**
21062106- */
21072107- switchToSmallStepsPgsSolver() {
21082108- wasm.rawintegrationparameters_switchToSmallStepsPgsSolver(this.__wbg_ptr);
21092109- }
21102110- /**
21112111- */
21122112- switchToSmallStepsPgsSolverWithoutWarmstart() {
21132113- wasm.rawintegrationparameters_switchToSmallStepsPgsSolverWithoutWarmstart(this.__wbg_ptr);
21142114- }
21152115-};
21162116-var RawIslandManager = class _RawIslandManager {
21172117- static __wrap(ptr) {
21182118- ptr = ptr >>> 0;
21192119- const obj = Object.create(_RawIslandManager.prototype);
21202120- obj.__wbg_ptr = ptr;
21212121- return obj;
21222122- }
21232123- __destroy_into_raw() {
21242124- const ptr = this.__wbg_ptr;
21252125- this.__wbg_ptr = 0;
21262126- return ptr;
21272127- }
21282128- free() {
21292129- const ptr = this.__destroy_into_raw();
21302130- wasm.__wbg_rawislandmanager_free(ptr);
21312131- }
21322132- /**
21332133- */
21342134- constructor() {
21352135- const ret = wasm.rawislandmanager_new();
21362136- this.__wbg_ptr = ret >>> 0;
21372137- return this;
21382138- }
21392139- /**
21402140- * Applies the given JavaScript function to the integer handle of each active rigid-body
21412141- * managed by this island manager.
21422142- *
21432143- * After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by
21442144- * the physics engine in order to save computational power. A sleeping rigid-body never moves
21452145- * unless it is moved manually by the user.
21462146- *
21472147- * # Parameters
21482148- * - `f(handle)`: the function to apply to the integer handle of each active rigid-body managed by this
21492149- * set. Called as `f(collider)`.
21502150- * @param {Function} f
21512151- */
21522152- forEachActiveRigidBodyHandle(f) {
21532153- try {
21542154- wasm.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f));
21552155- } finally {
21562156- heap[stack_pointer++] = void 0;
21572157- }
21582158- }
21592159-};
21602160-var RawKinematicCharacterController = class {
21612161- __destroy_into_raw() {
21622162- const ptr = this.__wbg_ptr;
21632163- this.__wbg_ptr = 0;
21642164- return ptr;
21652165- }
21662166- free() {
21672167- const ptr = this.__destroy_into_raw();
21682168- wasm.__wbg_rawkinematiccharactercontroller_free(ptr);
21692169- }
21702170- /**
21712171- * @param {number} offset
21722172- */
21732173- constructor(offset) {
21742174- const ret = wasm.rawkinematiccharactercontroller_new(offset);
21752175- this.__wbg_ptr = ret >>> 0;
21762176- return this;
21772177- }
21782178- /**
21792179- * @returns {RawVector}
21802180- */
21812181- up() {
21822182- const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr);
21832183- return RawVector.__wrap(ret);
21842184- }
21852185- /**
21862186- * @param {RawVector} vector
21872187- */
21882188- setUp(vector) {
21892189- _assertClass(vector, RawVector);
21902190- wasm.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, vector.__wbg_ptr);
21912191- }
21922192- /**
21932193- * @returns {number}
21942194- */
21952195- normalNudgeFactor() {
21962196- const ret = wasm.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);
21972197- return ret;
21982198- }
21992199- /**
22002200- * @param {number} value
22012201- */
22022202- setNormalNudgeFactor(value) {
22032203- wasm.rawkinematiccharactercontroller_setNormalNudgeFactor(this.__wbg_ptr, value);
22042204- }
22052205- /**
22062206- * @returns {number}
22072207- */
22082208- offset() {
22092209- const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);
22102210- return ret;
22112211- }
22122212- /**
22132213- * @param {number} value
22142214- */
22152215- setOffset(value) {
22162216- wasm.rawkinematiccharactercontroller_setOffset(this.__wbg_ptr, value);
22172217- }
22182218- /**
22192219- * @returns {boolean}
22202220- */
22212221- slideEnabled() {
22222222- const ret = wasm.rawkinematiccharactercontroller_slideEnabled(this.__wbg_ptr);
22232223- return ret !== 0;
22242224- }
22252225- /**
22262226- * @param {boolean} enabled
22272227- */
22282228- setSlideEnabled(enabled) {
22292229- wasm.rawkinematiccharactercontroller_setSlideEnabled(this.__wbg_ptr, enabled);
22302230- }
22312231- /**
22322232- * @returns {number | undefined}
22332233- */
22342234- autostepMaxHeight() {
22352235- try {
22362236- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
22372237- wasm.rawkinematiccharactercontroller_autostepMaxHeight(retptr, this.__wbg_ptr);
22382238- var r0 = getInt32Memory0()[retptr / 4 + 0];
22392239- var r1 = getFloat32Memory0()[retptr / 4 + 1];
22402240- return r0 === 0 ? void 0 : r1;
22412241- } finally {
22422242- wasm.__wbindgen_add_to_stack_pointer(16);
22432243- }
22442244- }
22452245- /**
22462246- * @returns {number | undefined}
22472247- */
22482248- autostepMinWidth() {
22492249- try {
22502250- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
22512251- wasm.rawkinematiccharactercontroller_autostepMinWidth(retptr, this.__wbg_ptr);
22522252- var r0 = getInt32Memory0()[retptr / 4 + 0];
22532253- var r1 = getFloat32Memory0()[retptr / 4 + 1];
22542254- return r0 === 0 ? void 0 : r1;
22552255- } finally {
22562256- wasm.__wbindgen_add_to_stack_pointer(16);
22572257- }
22582258- }
22592259- /**
22602260- * @returns {boolean | undefined}
22612261- */
22622262- autostepIncludesDynamicBodies() {
22632263- const ret = wasm.rawkinematiccharactercontroller_autostepIncludesDynamicBodies(this.__wbg_ptr);
22642264- return ret === 16777215 ? void 0 : ret !== 0;
22652265- }
22662266- /**
22672267- * @returns {boolean}
22682268- */
22692269- autostepEnabled() {
22702270- const ret = wasm.rawkinematiccharactercontroller_autostepEnabled(this.__wbg_ptr);
22712271- return ret !== 0;
22722272- }
22732273- /**
22742274- * @param {number} maxHeight
22752275- * @param {number} minWidth
22762276- * @param {boolean} includeDynamicBodies
22772277- */
22782278- enableAutostep(maxHeight, minWidth, includeDynamicBodies) {
22792279- wasm.rawkinematiccharactercontroller_enableAutostep(this.__wbg_ptr, maxHeight, minWidth, includeDynamicBodies);
22802280- }
22812281- /**
22822282- */
22832283- disableAutostep() {
22842284- wasm.rawkinematiccharactercontroller_disableAutostep(this.__wbg_ptr);
22852285- }
22862286- /**
22872287- * @returns {number}
22882288- */
22892289- maxSlopeClimbAngle() {
22902290- const ret = wasm.rawintegrationparameters_normalizedPredictionDistance(this.__wbg_ptr);
22912291- return ret;
22922292- }
22932293- /**
22942294- * @param {number} angle
22952295- */
22962296- setMaxSlopeClimbAngle(angle) {
22972297- wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, angle);
22982298- }
22992299- /**
23002300- * @returns {number}
23012301- */
23022302- minSlopeSlideAngle() {
23032303- const ret = wasm.rawkinematiccharactercontroller_minSlopeSlideAngle(this.__wbg_ptr);
23042304- return ret;
23052305- }
23062306- /**
23072307- * @param {number} angle
23082308- */
23092309- setMinSlopeSlideAngle(angle) {
23102310- wasm.rawkinematiccharactercontroller_setMinSlopeSlideAngle(this.__wbg_ptr, angle);
23112311- }
23122312- /**
23132313- * @returns {number | undefined}
23142314- */
23152315- snapToGroundDistance() {
23162316- try {
23172317- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
23182318- wasm.rawkinematiccharactercontroller_snapToGroundDistance(retptr, this.__wbg_ptr);
23192319- var r0 = getInt32Memory0()[retptr / 4 + 0];
23202320- var r1 = getFloat32Memory0()[retptr / 4 + 1];
23212321- return r0 === 0 ? void 0 : r1;
23222322- } finally {
23232323- wasm.__wbindgen_add_to_stack_pointer(16);
23242324- }
23252325- }
23262326- /**
23272327- * @param {number} distance
23282328- */
23292329- enableSnapToGround(distance) {
23302330- wasm.rawkinematiccharactercontroller_enableSnapToGround(this.__wbg_ptr, distance);
23312331- }
23322332- /**
23332333- */
23342334- disableSnapToGround() {
23352335- wasm.rawkinematiccharactercontroller_disableSnapToGround(this.__wbg_ptr);
23362336- }
23372337- /**
23382338- * @returns {boolean}
23392339- */
23402340- snapToGroundEnabled() {
23412341- const ret = wasm.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr);
23422342- return ret !== 0;
23432343- }
23442344- /**
23452345- * @param {number} dt
23462346- * @param {RawRigidBodySet} bodies
23472347- * @param {RawColliderSet} colliders
23482348- * @param {RawQueryPipeline} queries
23492349- * @param {number} collider_handle
23502350- * @param {RawVector} desired_translation_delta
23512351- * @param {boolean} apply_impulses_to_dynamic_bodies
23522352- * @param {number | undefined} character_mass
23532353- * @param {number} filter_flags
23542354- * @param {number | undefined} filter_groups
23552355- * @param {Function} filter_predicate
23562356- */
23572357- computeColliderMovement(dt, bodies, colliders, queries, collider_handle, desired_translation_delta, apply_impulses_to_dynamic_bodies, character_mass, filter_flags, filter_groups, filter_predicate) {
23582358- try {
23592359- _assertClass(bodies, RawRigidBodySet);
23602360- _assertClass(colliders, RawColliderSet);
23612361- _assertClass(queries, RawQueryPipeline);
23622362- _assertClass(desired_translation_delta, RawVector);
23632363- wasm.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, dt, bodies.__wbg_ptr, colliders.__wbg_ptr, queries.__wbg_ptr, collider_handle, desired_translation_delta.__wbg_ptr, apply_impulses_to_dynamic_bodies, !isLikeNone(character_mass), isLikeNone(character_mass) ? 0 : character_mass, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, addBorrowedObject(filter_predicate));
23642364- } finally {
23652365- heap[stack_pointer++] = void 0;
23662366- }
23672367- }
23682368- /**
23692369- * @returns {RawVector}
23702370- */
23712371- computedMovement() {
23722372- const ret = wasm.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
23732373- return RawVector.__wrap(ret);
23742374- }
23752375- /**
23762376- * @returns {boolean}
23772377- */
23782378- computedGrounded() {
23792379- const ret = wasm.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr);
23802380- return ret !== 0;
23812381- }
23822382- /**
23832383- * @returns {number}
23842384- */
23852385- numComputedCollisions() {
23862386- const ret = wasm.rawkinematiccharactercontroller_numComputedCollisions(this.__wbg_ptr);
23872387- return ret >>> 0;
23882388- }
23892389- /**
23902390- * @param {number} i
23912391- * @param {RawCharacterCollision} collision
23922392- * @returns {boolean}
23932393- */
23942394- computedCollision(i, collision) {
23952395- _assertClass(collision, RawCharacterCollision);
23962396- const ret = wasm.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, i, collision.__wbg_ptr);
23972397- return ret !== 0;
23982398- }
23992399-};
24002400-var RawMultibodyJointSet = class _RawMultibodyJointSet {
24012401- static __wrap(ptr) {
24022402- ptr = ptr >>> 0;
24032403- const obj = Object.create(_RawMultibodyJointSet.prototype);
24042404- obj.__wbg_ptr = ptr;
24052405- return obj;
24062406- }
24072407- __destroy_into_raw() {
24082408- const ptr = this.__wbg_ptr;
24092409- this.__wbg_ptr = 0;
24102410- return ptr;
24112411- }
24122412- free() {
24132413- const ptr = this.__destroy_into_raw();
24142414- wasm.__wbg_rawmultibodyjointset_free(ptr);
24152415- }
24162416- /**
24172417- * The type of this joint.
24182418- * @param {number} handle
24192419- * @returns {RawJointType}
24202420- */
24212421- jointType(handle) {
24222422- const ret = wasm.rawmultibodyjointset_jointType(this.__wbg_ptr, handle);
24232423- return ret;
24242424- }
24252425- /**
24262426- * The angular part of the joint’s local frame relative to the first rigid-body it is attached to.
24272427- * @param {number} handle
24282428- * @returns {RawRotation}
24292429- */
24302430- jointFrameX1(handle) {
24312431- const ret = wasm.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, handle);
24322432- return RawRotation.__wrap(ret);
24332433- }
24342434- /**
24352435- * The angular part of the joint’s local frame relative to the second rigid-body it is attached to.
24362436- * @param {number} handle
24372437- * @returns {RawRotation}
24382438- */
24392439- jointFrameX2(handle) {
24402440- const ret = wasm.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, handle);
24412441- return RawRotation.__wrap(ret);
24422442- }
24432443- /**
24442444- * The position of the first anchor of this joint.
24452445- *
24462446- * The first anchor gives the position of the points application point on the
24472447- * local frame of the first rigid-body it is attached to.
24482448- * @param {number} handle
24492449- * @returns {RawVector}
24502450- */
24512451- jointAnchor1(handle) {
24522452- const ret = wasm.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, handle);
24532453- return RawVector.__wrap(ret);
24542454- }
24552455- /**
24562456- * The position of the second anchor of this joint.
24572457- *
24582458- * The second anchor gives the position of the points application point on the
24592459- * local frame of the second rigid-body it is attached to.
24602460- * @param {number} handle
24612461- * @returns {RawVector}
24622462- */
24632463- jointAnchor2(handle) {
24642464- const ret = wasm.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, handle);
24652465- return RawVector.__wrap(ret);
24662466- }
24672467- /**
24682468- * Are contacts between the rigid-bodies attached by this joint enabled?
24692469- * @param {number} handle
24702470- * @returns {boolean}
24712471- */
24722472- jointContactsEnabled(handle) {
24732473- const ret = wasm.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, handle);
24742474- return ret !== 0;
24752475- }
24762476- /**
24772477- * Sets whether contacts are enabled between the rigid-bodies attached by this joint.
24782478- * @param {number} handle
24792479- * @param {boolean} enabled
24802480- */
24812481- jointSetContactsEnabled(handle, enabled) {
24822482- wasm.rawmultibodyjointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled);
24832483- }
24842484- /**
24852485- * Are the limits for this joint enabled?
24862486- * @param {number} handle
24872487- * @param {RawJointAxis} axis
24882488- * @returns {boolean}
24892489- */
24902490- jointLimitsEnabled(handle, axis) {
24912491- const ret = wasm.rawmultibodyjointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis);
24922492- return ret !== 0;
24932493- }
24942494- /**
24952495- * Return the lower limit along the given joint axis.
24962496- * @param {number} handle
24972497- * @param {RawJointAxis} axis
24982498- * @returns {number}
24992499- */
25002500- jointLimitsMin(handle, axis) {
25012501- const ret = wasm.rawmultibodyjointset_jointLimitsMin(this.__wbg_ptr, handle, axis);
25022502- return ret;
25032503- }
25042504- /**
25052505- * If this is a prismatic joint, returns its upper limit.
25062506- * @param {number} handle
25072507- * @param {RawJointAxis} axis
25082508- * @returns {number}
25092509- */
25102510- jointLimitsMax(handle, axis) {
25112511- const ret = wasm.rawmultibodyjointset_jointLimitsMax(this.__wbg_ptr, handle, axis);
25122512- return ret;
25132513- }
25142514- /**
25152515- */
25162516- constructor() {
25172517- const ret = wasm.rawmultibodyjointset_new();
25182518- this.__wbg_ptr = ret >>> 0;
25192519- return this;
25202520- }
25212521- /**
25222522- * @param {RawGenericJoint} params
25232523- * @param {number} parent1
25242524- * @param {number} parent2
25252525- * @param {boolean} wakeUp
25262526- * @returns {number}
25272527- */
25282528- createJoint(params, parent1, parent2, wakeUp) {
25292529- _assertClass(params, RawGenericJoint);
25302530- const ret = wasm.rawmultibodyjointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wakeUp);
25312531- return ret;
25322532- }
25332533- /**
25342534- * @param {number} handle
25352535- * @param {boolean} wakeUp
25362536- */
25372537- remove(handle, wakeUp) {
25382538- wasm.rawmultibodyjointset_remove(this.__wbg_ptr, handle, wakeUp);
25392539- }
25402540- /**
25412541- * @param {number} handle
25422542- * @returns {boolean}
25432543- */
25442544- contains(handle) {
25452545- const ret = wasm.rawmultibodyjointset_contains(this.__wbg_ptr, handle);
25462546- return ret !== 0;
25472547- }
25482548- /**
25492549- * Applies the given JavaScript function to the integer handle of each joint managed by this physics world.
25502550- *
25512551- * # Parameters
25522552- * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`.
25532553- * @param {Function} f
25542554- */
25552555- forEachJointHandle(f) {
25562556- try {
25572557- wasm.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f));
25582558- } finally {
25592559- heap[stack_pointer++] = void 0;
25602560- }
25612561- }
25622562- /**
25632563- * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body.
25642564- *
25652565- * # Parameters
25662566- * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`.
25672567- * @param {number} body
25682568- * @param {Function} f
25692569- */
25702570- forEachJointAttachedToRigidBody(body, f) {
25712571- try {
25722572- wasm.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f));
25732573- } finally {
25742574- heap[stack_pointer++] = void 0;
25752575- }
25762576- }
25772577-};
25782578-var RawNarrowPhase = class _RawNarrowPhase {
25792579- static __wrap(ptr) {
25802580- ptr = ptr >>> 0;
25812581- const obj = Object.create(_RawNarrowPhase.prototype);
25822582- obj.__wbg_ptr = ptr;
25832583- return obj;
25842584- }
25852585- __destroy_into_raw() {
25862586- const ptr = this.__wbg_ptr;
25872587- this.__wbg_ptr = 0;
25882588- return ptr;
25892589- }
25902590- free() {
25912591- const ptr = this.__destroy_into_raw();
25922592- wasm.__wbg_rawnarrowphase_free(ptr);
25932593- }
25942594- /**
25952595- */
25962596- constructor() {
25972597- const ret = wasm.rawnarrowphase_new();
25982598- this.__wbg_ptr = ret >>> 0;
25992599- return this;
26002600- }
26012601- /**
26022602- * @param {number} handle1
26032603- * @param {Function} f
26042604- */
26052605- contact_pairs_with(handle1, f) {
26062606- wasm.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f));
26072607- }
26082608- /**
26092609- * @param {number} handle1
26102610- * @param {number} handle2
26112611- * @returns {RawContactPair | undefined}
26122612- */
26132613- contact_pair(handle1, handle2) {
26142614- const ret = wasm.rawnarrowphase_contact_pair(this.__wbg_ptr, handle1, handle2);
26152615- return ret === 0 ? void 0 : RawContactPair.__wrap(ret);
26162616- }
26172617- /**
26182618- * @param {number} handle1
26192619- * @param {Function} f
26202620- */
26212621- intersection_pairs_with(handle1, f) {
26222622- wasm.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f));
26232623- }
26242624- /**
26252625- * @param {number} handle1
26262626- * @param {number} handle2
26272627- * @returns {boolean}
26282628- */
26292629- intersection_pair(handle1, handle2) {
26302630- const ret = wasm.rawnarrowphase_intersection_pair(this.__wbg_ptr, handle1, handle2);
26312631- return ret !== 0;
26322632- }
26332633-};
26342634-var RawPhysicsPipeline = class {
26352635- __destroy_into_raw() {
26362636- const ptr = this.__wbg_ptr;
26372637- this.__wbg_ptr = 0;
26382638- return ptr;
26392639- }
26402640- free() {
26412641- const ptr = this.__destroy_into_raw();
26422642- wasm.__wbg_rawphysicspipeline_free(ptr);
26432643- }
26442644- /**
26452645- */
26462646- constructor() {
26472647- const ret = wasm.rawphysicspipeline_new();
26482648- this.__wbg_ptr = ret >>> 0;
26492649- return this;
26502650- }
26512651- /**
26522652- * @param {RawVector} gravity
26532653- * @param {RawIntegrationParameters} integrationParameters
26542654- * @param {RawIslandManager} islands
26552655- * @param {RawBroadPhase} broadPhase
26562656- * @param {RawNarrowPhase} narrowPhase
26572657- * @param {RawRigidBodySet} bodies
26582658- * @param {RawColliderSet} colliders
26592659- * @param {RawImpulseJointSet} joints
26602660- * @param {RawMultibodyJointSet} articulations
26612661- * @param {RawCCDSolver} ccd_solver
26622662- */
26632663- step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver) {
26642664- _assertClass(gravity, RawVector);
26652665- _assertClass(integrationParameters, RawIntegrationParameters);
26662666- _assertClass(islands, RawIslandManager);
26672667- _assertClass(broadPhase, RawBroadPhase);
26682668- _assertClass(narrowPhase, RawNarrowPhase);
26692669- _assertClass(bodies, RawRigidBodySet);
26702670- _assertClass(colliders, RawColliderSet);
26712671- _assertClass(joints, RawImpulseJointSet);
26722672- _assertClass(articulations, RawMultibodyJointSet);
26732673- _assertClass(ccd_solver, RawCCDSolver);
26742674- wasm.rawphysicspipeline_step(this.__wbg_ptr, gravity.__wbg_ptr, integrationParameters.__wbg_ptr, islands.__wbg_ptr, broadPhase.__wbg_ptr, narrowPhase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr, ccd_solver.__wbg_ptr);
26752675- }
26762676- /**
26772677- * @param {RawVector} gravity
26782678- * @param {RawIntegrationParameters} integrationParameters
26792679- * @param {RawIslandManager} islands
26802680- * @param {RawBroadPhase} broadPhase
26812681- * @param {RawNarrowPhase} narrowPhase
26822682- * @param {RawRigidBodySet} bodies
26832683- * @param {RawColliderSet} colliders
26842684- * @param {RawImpulseJointSet} joints
26852685- * @param {RawMultibodyJointSet} articulations
26862686- * @param {RawCCDSolver} ccd_solver
26872687- * @param {RawEventQueue} eventQueue
26882688- * @param {object} hookObject
26892689- * @param {Function} hookFilterContactPair
26902690- * @param {Function} hookFilterIntersectionPair
26912691- */
26922692- stepWithEvents(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver, eventQueue, hookObject, hookFilterContactPair, hookFilterIntersectionPair) {
26932693- _assertClass(gravity, RawVector);
26942694- _assertClass(integrationParameters, RawIntegrationParameters);
26952695- _assertClass(islands, RawIslandManager);
26962696- _assertClass(broadPhase, RawBroadPhase);
26972697- _assertClass(narrowPhase, RawNarrowPhase);
26982698- _assertClass(bodies, RawRigidBodySet);
26992699- _assertClass(colliders, RawColliderSet);
27002700- _assertClass(joints, RawImpulseJointSet);
27012701- _assertClass(articulations, RawMultibodyJointSet);
27022702- _assertClass(ccd_solver, RawCCDSolver);
27032703- _assertClass(eventQueue, RawEventQueue);
27042704- wasm.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, gravity.__wbg_ptr, integrationParameters.__wbg_ptr, islands.__wbg_ptr, broadPhase.__wbg_ptr, narrowPhase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr, ccd_solver.__wbg_ptr, eventQueue.__wbg_ptr, addHeapObject(hookObject), addHeapObject(hookFilterContactPair), addHeapObject(hookFilterIntersectionPair));
27052705- }
27062706-};
27072707-var RawPointColliderProjection = class _RawPointColliderProjection {
27082708- static __wrap(ptr) {
27092709- ptr = ptr >>> 0;
27102710- const obj = Object.create(_RawPointColliderProjection.prototype);
27112711- obj.__wbg_ptr = ptr;
27122712- return obj;
27132713- }
27142714- __destroy_into_raw() {
27152715- const ptr = this.__wbg_ptr;
27162716- this.__wbg_ptr = 0;
27172717- return ptr;
27182718- }
27192719- free() {
27202720- const ptr = this.__destroy_into_raw();
27212721- wasm.__wbg_rawpointcolliderprojection_free(ptr);
27222722- }
27232723- /**
27242724- * @returns {number}
27252725- */
27262726- colliderHandle() {
27272727- const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr);
27282728- return ret;
27292729- }
27302730- /**
27312731- * @returns {RawVector}
27322732- */
27332733- point() {
27342734- const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr);
27352735- return RawVector.__wrap(ret);
27362736- }
27372737- /**
27382738- * @returns {boolean}
27392739- */
27402740- isInside() {
27412741- const ret = wasm.rawpointcolliderprojection_isInside(this.__wbg_ptr);
27422742- return ret !== 0;
27432743- }
27442744- /**
27452745- * @returns {RawFeatureType}
27462746- */
27472747- featureType() {
27482748- const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr);
27492749- return ret;
27502750- }
27512751- /**
27522752- * @returns {number | undefined}
27532753- */
27542754- featureId() {
27552755- try {
27562756- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
27572757- wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr);
27582758- var r0 = getInt32Memory0()[retptr / 4 + 0];
27592759- var r1 = getInt32Memory0()[retptr / 4 + 1];
27602760- return r0 === 0 ? void 0 : r1 >>> 0;
27612761- } finally {
27622762- wasm.__wbindgen_add_to_stack_pointer(16);
27632763- }
27642764- }
27652765-};
27662766-var RawPointProjection = class _RawPointProjection {
27672767- static __wrap(ptr) {
27682768- ptr = ptr >>> 0;
27692769- const obj = Object.create(_RawPointProjection.prototype);
27702770- obj.__wbg_ptr = ptr;
27712771- return obj;
27722772- }
27732773- __destroy_into_raw() {
27742774- const ptr = this.__wbg_ptr;
27752775- this.__wbg_ptr = 0;
27762776- return ptr;
27772777- }
27782778- free() {
27792779- const ptr = this.__destroy_into_raw();
27802780- wasm.__wbg_rawpointprojection_free(ptr);
27812781- }
27822782- /**
27832783- * @returns {RawVector}
27842784- */
27852785- point() {
27862786- const ret = wasm.rawpointprojection_point(this.__wbg_ptr);
27872787- return RawVector.__wrap(ret);
27882788- }
27892789- /**
27902790- * @returns {boolean}
27912791- */
27922792- isInside() {
27932793- const ret = wasm.rawpointprojection_isInside(this.__wbg_ptr);
27942794- return ret !== 0;
27952795- }
27962796-};
27972797-var RawQueryPipeline = class {
27982798- __destroy_into_raw() {
27992799- const ptr = this.__wbg_ptr;
28002800- this.__wbg_ptr = 0;
28012801- return ptr;
28022802- }
28032803- free() {
28042804- const ptr = this.__destroy_into_raw();
28052805- wasm.__wbg_rawquerypipeline_free(ptr);
28062806- }
28072807- /**
28082808- */
28092809- constructor() {
28102810- const ret = wasm.rawquerypipeline_new();
28112811- this.__wbg_ptr = ret >>> 0;
28122812- return this;
28132813- }
28142814- /**
28152815- * @param {RawRigidBodySet} bodies
28162816- * @param {RawColliderSet} colliders
28172817- */
28182818- update(bodies, colliders) {
28192819- _assertClass(bodies, RawRigidBodySet);
28202820- _assertClass(colliders, RawColliderSet);
28212821- wasm.rawquerypipeline_update(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr);
28222822- }
28232823- /**
28242824- * @param {RawRigidBodySet} bodies
28252825- * @param {RawColliderSet} colliders
28262826- * @param {RawVector} rayOrig
28272827- * @param {RawVector} rayDir
28282828- * @param {number} maxToi
28292829- * @param {boolean} solid
28302830- * @param {number} filter_flags
28312831- * @param {number | undefined} filter_groups
28322832- * @param {number | undefined} filter_exclude_collider
28332833- * @param {number | undefined} filter_exclude_rigid_body
28342834- * @param {Function} filter_predicate
28352835- * @returns {RawRayColliderHit | undefined}
28362836- */
28372837- castRay(bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
28382838- try {
28392839- _assertClass(bodies, RawRigidBodySet);
28402840- _assertClass(colliders, RawColliderSet);
28412841- _assertClass(rayOrig, RawVector);
28422842- _assertClass(rayDir, RawVector);
28432843- const ret = wasm.rawquerypipeline_castRay(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
28442844- return ret === 0 ? void 0 : RawRayColliderHit.__wrap(ret);
28452845- } finally {
28462846- heap[stack_pointer++] = void 0;
28472847- }
28482848- }
28492849- /**
28502850- * @param {RawRigidBodySet} bodies
28512851- * @param {RawColliderSet} colliders
28522852- * @param {RawVector} rayOrig
28532853- * @param {RawVector} rayDir
28542854- * @param {number} maxToi
28552855- * @param {boolean} solid
28562856- * @param {number} filter_flags
28572857- * @param {number | undefined} filter_groups
28582858- * @param {number | undefined} filter_exclude_collider
28592859- * @param {number | undefined} filter_exclude_rigid_body
28602860- * @param {Function} filter_predicate
28612861- * @returns {RawRayColliderIntersection | undefined}
28622862- */
28632863- castRayAndGetNormal(bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
28642864- try {
28652865- _assertClass(bodies, RawRigidBodySet);
28662866- _assertClass(colliders, RawColliderSet);
28672867- _assertClass(rayOrig, RawVector);
28682868- _assertClass(rayDir, RawVector);
28692869- const ret = wasm.rawquerypipeline_castRayAndGetNormal(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
28702870- return ret === 0 ? void 0 : RawRayColliderIntersection.__wrap(ret);
28712871- } finally {
28722872- heap[stack_pointer++] = void 0;
28732873- }
28742874- }
28752875- /**
28762876- * @param {RawRigidBodySet} bodies
28772877- * @param {RawColliderSet} colliders
28782878- * @param {RawVector} rayOrig
28792879- * @param {RawVector} rayDir
28802880- * @param {number} maxToi
28812881- * @param {boolean} solid
28822882- * @param {Function} callback
28832883- * @param {number} filter_flags
28842884- * @param {number | undefined} filter_groups
28852885- * @param {number | undefined} filter_exclude_collider
28862886- * @param {number | undefined} filter_exclude_rigid_body
28872887- * @param {Function} filter_predicate
28882888- */
28892889- intersectionsWithRay(bodies, colliders, rayOrig, rayDir, maxToi, solid, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
28902890- try {
28912891- _assertClass(bodies, RawRigidBodySet);
28922892- _assertClass(colliders, RawColliderSet);
28932893- _assertClass(rayOrig, RawVector);
28942894- _assertClass(rayDir, RawVector);
28952895- wasm.rawquerypipeline_intersectionsWithRay(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, addBorrowedObject(callback), filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
28962896- } finally {
28972897- heap[stack_pointer++] = void 0;
28982898- heap[stack_pointer++] = void 0;
28992899- }
29002900- }
29012901- /**
29022902- * @param {RawRigidBodySet} bodies
29032903- * @param {RawColliderSet} colliders
29042904- * @param {RawVector} shapePos
29052905- * @param {RawRotation} shapeRot
29062906- * @param {RawShape} shape
29072907- * @param {number} filter_flags
29082908- * @param {number | undefined} filter_groups
29092909- * @param {number | undefined} filter_exclude_collider
29102910- * @param {number | undefined} filter_exclude_rigid_body
29112911- * @param {Function} filter_predicate
29122912- * @returns {number | undefined}
29132913- */
29142914- intersectionWithShape(bodies, colliders, shapePos, shapeRot, shape, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
29152915- try {
29162916- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
29172917- _assertClass(bodies, RawRigidBodySet);
29182918- _assertClass(colliders, RawColliderSet);
29192919- _assertClass(shapePos, RawVector);
29202920- _assertClass(shapeRot, RawRotation);
29212921- _assertClass(shape, RawShape);
29222922- wasm.rawquerypipeline_intersectionWithShape(retptr, this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shape.__wbg_ptr, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
29232923- var r0 = getInt32Memory0()[retptr / 4 + 0];
29242924- var r2 = getFloat64Memory0()[retptr / 8 + 1];
29252925- return r0 === 0 ? void 0 : r2;
29262926- } finally {
29272927- wasm.__wbindgen_add_to_stack_pointer(16);
29282928- heap[stack_pointer++] = void 0;
29292929- }
29302930- }
29312931- /**
29322932- * @param {RawRigidBodySet} bodies
29332933- * @param {RawColliderSet} colliders
29342934- * @param {RawVector} point
29352935- * @param {boolean} solid
29362936- * @param {number} filter_flags
29372937- * @param {number | undefined} filter_groups
29382938- * @param {number | undefined} filter_exclude_collider
29392939- * @param {number | undefined} filter_exclude_rigid_body
29402940- * @param {Function} filter_predicate
29412941- * @returns {RawPointColliderProjection | undefined}
29422942- */
29432943- projectPoint(bodies, colliders, point, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
29442944- try {
29452945- _assertClass(bodies, RawRigidBodySet);
29462946- _assertClass(colliders, RawColliderSet);
29472947- _assertClass(point, RawVector);
29482948- const ret = wasm.rawquerypipeline_projectPoint(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, solid, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
29492949- return ret === 0 ? void 0 : RawPointColliderProjection.__wrap(ret);
29502950- } finally {
29512951- heap[stack_pointer++] = void 0;
29522952- }
29532953- }
29542954- /**
29552955- * @param {RawRigidBodySet} bodies
29562956- * @param {RawColliderSet} colliders
29572957- * @param {RawVector} point
29582958- * @param {number} filter_flags
29592959- * @param {number | undefined} filter_groups
29602960- * @param {number | undefined} filter_exclude_collider
29612961- * @param {number | undefined} filter_exclude_rigid_body
29622962- * @param {Function} filter_predicate
29632963- * @returns {RawPointColliderProjection | undefined}
29642964- */
29652965- projectPointAndGetFeature(bodies, colliders, point, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
29662966- try {
29672967- _assertClass(bodies, RawRigidBodySet);
29682968- _assertClass(colliders, RawColliderSet);
29692969- _assertClass(point, RawVector);
29702970- const ret = wasm.rawquerypipeline_projectPointAndGetFeature(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
29712971- return ret === 0 ? void 0 : RawPointColliderProjection.__wrap(ret);
29722972- } finally {
29732973- heap[stack_pointer++] = void 0;
29742974- }
29752975- }
29762976- /**
29772977- * @param {RawRigidBodySet} bodies
29782978- * @param {RawColliderSet} colliders
29792979- * @param {RawVector} point
29802980- * @param {Function} callback
29812981- * @param {number} filter_flags
29822982- * @param {number | undefined} filter_groups
29832983- * @param {number | undefined} filter_exclude_collider
29842984- * @param {number | undefined} filter_exclude_rigid_body
29852985- * @param {Function} filter_predicate
29862986- */
29872987- intersectionsWithPoint(bodies, colliders, point, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
29882988- try {
29892989- _assertClass(bodies, RawRigidBodySet);
29902990- _assertClass(colliders, RawColliderSet);
29912991- _assertClass(point, RawVector);
29922992- wasm.rawquerypipeline_intersectionsWithPoint(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, addBorrowedObject(callback), filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
29932993- } finally {
29942994- heap[stack_pointer++] = void 0;
29952995- heap[stack_pointer++] = void 0;
29962996- }
29972997- }
29982998- /**
29992999- * @param {RawRigidBodySet} bodies
30003000- * @param {RawColliderSet} colliders
30013001- * @param {RawVector} shapePos
30023002- * @param {RawRotation} shapeRot
30033003- * @param {RawVector} shapeVel
30043004- * @param {RawShape} shape
30053005- * @param {number} target_distance
30063006- * @param {number} maxToi
30073007- * @param {boolean} stop_at_penetration
30083008- * @param {number} filter_flags
30093009- * @param {number | undefined} filter_groups
30103010- * @param {number | undefined} filter_exclude_collider
30113011- * @param {number | undefined} filter_exclude_rigid_body
30123012- * @param {Function} filter_predicate
30133013- * @returns {RawColliderShapeCastHit | undefined}
30143014- */
30153015- castShape(bodies, colliders, shapePos, shapeRot, shapeVel, shape, target_distance, maxToi, stop_at_penetration, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
30163016- try {
30173017- _assertClass(bodies, RawRigidBodySet);
30183018- _assertClass(colliders, RawColliderSet);
30193019- _assertClass(shapePos, RawVector);
30203020- _assertClass(shapeRot, RawRotation);
30213021- _assertClass(shapeVel, RawVector);
30223022- _assertClass(shape, RawShape);
30233023- const ret = wasm.rawquerypipeline_castShape(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shapeVel.__wbg_ptr, shape.__wbg_ptr, target_distance, maxToi, stop_at_penetration, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
30243024- return ret === 0 ? void 0 : RawColliderShapeCastHit.__wrap(ret);
30253025- } finally {
30263026- heap[stack_pointer++] = void 0;
30273027- }
30283028- }
30293029- /**
30303030- * @param {RawRigidBodySet} bodies
30313031- * @param {RawColliderSet} colliders
30323032- * @param {RawVector} shapePos
30333033- * @param {RawRotation} shapeRot
30343034- * @param {RawShape} shape
30353035- * @param {Function} callback
30363036- * @param {number} filter_flags
30373037- * @param {number | undefined} filter_groups
30383038- * @param {number | undefined} filter_exclude_collider
30393039- * @param {number | undefined} filter_exclude_rigid_body
30403040- * @param {Function} filter_predicate
30413041- */
30423042- intersectionsWithShape(bodies, colliders, shapePos, shapeRot, shape, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {
30433043- try {
30443044- _assertClass(bodies, RawRigidBodySet);
30453045- _assertClass(colliders, RawColliderSet);
30463046- _assertClass(shapePos, RawVector);
30473047- _assertClass(shapeRot, RawRotation);
30483048- _assertClass(shape, RawShape);
30493049- wasm.rawquerypipeline_intersectionsWithShape(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shape.__wbg_ptr, addBorrowedObject(callback), filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));
30503050- } finally {
30513051- heap[stack_pointer++] = void 0;
30523052- heap[stack_pointer++] = void 0;
30533053- }
30543054- }
30553055- /**
30563056- * @param {RawVector} aabbCenter
30573057- * @param {RawVector} aabbHalfExtents
30583058- * @param {Function} callback
30593059- */
30603060- collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) {
30613061- try {
30623062- _assertClass(aabbCenter, RawVector);
30633063- _assertClass(aabbHalfExtents, RawVector);
30643064- wasm.rawquerypipeline_collidersWithAabbIntersectingAabb(this.__wbg_ptr, aabbCenter.__wbg_ptr, aabbHalfExtents.__wbg_ptr, addBorrowedObject(callback));
30653065- } finally {
30663066- heap[stack_pointer++] = void 0;
30673067- }
30683068- }
30693069-};
30703070-var RawRayColliderHit = class _RawRayColliderHit {
30713071- static __wrap(ptr) {
30723072- ptr = ptr >>> 0;
30733073- const obj = Object.create(_RawRayColliderHit.prototype);
30743074- obj.__wbg_ptr = ptr;
30753075- return obj;
30763076- }
30773077- __destroy_into_raw() {
30783078- const ptr = this.__wbg_ptr;
30793079- this.__wbg_ptr = 0;
30803080- return ptr;
30813081- }
30823082- free() {
30833083- const ptr = this.__destroy_into_raw();
30843084- wasm.__wbg_rawraycolliderhit_free(ptr);
30853085- }
30863086- /**
30873087- * @returns {number}
30883088- */
30893089- colliderHandle() {
30903090- const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr);
30913091- return ret;
30923092- }
30933093- /**
30943094- * @returns {number}
30953095- */
30963096- timeOfImpact() {
30973097- const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
30983098- return ret;
30993099- }
31003100-};
31013101-var RawRayColliderIntersection = class _RawRayColliderIntersection {
31023102- static __wrap(ptr) {
31033103- ptr = ptr >>> 0;
31043104- const obj = Object.create(_RawRayColliderIntersection.prototype);
31053105- obj.__wbg_ptr = ptr;
31063106- return obj;
31073107- }
31083108- __destroy_into_raw() {
31093109- const ptr = this.__wbg_ptr;
31103110- this.__wbg_ptr = 0;
31113111- return ptr;
31123112- }
31133113- free() {
31143114- const ptr = this.__destroy_into_raw();
31153115- wasm.__wbg_rawraycolliderintersection_free(ptr);
31163116- }
31173117- /**
31183118- * @returns {number}
31193119- */
31203120- colliderHandle() {
31213121- const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr);
31223122- return ret;
31233123- }
31243124- /**
31253125- * @returns {RawVector}
31263126- */
31273127- normal() {
31283128- const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);
31293129- return RawVector.__wrap(ret);
31303130- }
31313131- /**
31323132- * @returns {number}
31333133- */
31343134- time_of_impact() {
31353135- const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
31363136- return ret;
31373137- }
31383138- /**
31393139- * @returns {RawFeatureType}
31403140- */
31413141- featureType() {
31423142- const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr);
31433143- return ret;
31443144- }
31453145- /**
31463146- * @returns {number | undefined}
31473147- */
31483148- featureId() {
31493149- try {
31503150- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
31513151- wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr);
31523152- var r0 = getInt32Memory0()[retptr / 4 + 0];
31533153- var r1 = getInt32Memory0()[retptr / 4 + 1];
31543154- return r0 === 0 ? void 0 : r1 >>> 0;
31553155- } finally {
31563156- wasm.__wbindgen_add_to_stack_pointer(16);
31573157- }
31583158- }
31593159-};
31603160-var RawRayIntersection = class _RawRayIntersection {
31613161- static __wrap(ptr) {
31623162- ptr = ptr >>> 0;
31633163- const obj = Object.create(_RawRayIntersection.prototype);
31643164- obj.__wbg_ptr = ptr;
31653165- return obj;
31663166- }
31673167- __destroy_into_raw() {
31683168- const ptr = this.__wbg_ptr;
31693169- this.__wbg_ptr = 0;
31703170- return ptr;
31713171- }
31723172- free() {
31733173- const ptr = this.__destroy_into_raw();
31743174- wasm.__wbg_rawrayintersection_free(ptr);
31753175- }
31763176- /**
31773177- * @returns {RawVector}
31783178- */
31793179- normal() {
31803180- const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);
31813181- return RawVector.__wrap(ret);
31823182- }
31833183- /**
31843184- * @returns {number}
31853185- */
31863186- time_of_impact() {
31873187- const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
31883188- return ret;
31893189- }
31903190- /**
31913191- * @returns {RawFeatureType}
31923192- */
31933193- featureType() {
31943194- const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr);
31953195- return ret;
31963196- }
31973197- /**
31983198- * @returns {number | undefined}
31993199- */
32003200- featureId() {
32013201- try {
32023202- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
32033203- wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr);
32043204- var r0 = getInt32Memory0()[retptr / 4 + 0];
32053205- var r1 = getInt32Memory0()[retptr / 4 + 1];
32063206- return r0 === 0 ? void 0 : r1 >>> 0;
32073207- } finally {
32083208- wasm.__wbindgen_add_to_stack_pointer(16);
32093209- }
32103210- }
32113211-};
32123212-var RawRigidBodySet = class _RawRigidBodySet {
32133213- static __wrap(ptr) {
32143214- ptr = ptr >>> 0;
32153215- const obj = Object.create(_RawRigidBodySet.prototype);
32163216- obj.__wbg_ptr = ptr;
32173217- return obj;
32183218- }
32193219- __destroy_into_raw() {
32203220- const ptr = this.__wbg_ptr;
32213221- this.__wbg_ptr = 0;
32223222- return ptr;
32233223- }
32243224- free() {
32253225- const ptr = this.__destroy_into_raw();
32263226- wasm.__wbg_rawrigidbodyset_free(ptr);
32273227- }
32283228- /**
32293229- * The world-space translation of this rigid-body.
32303230- * @param {number} handle
32313231- * @returns {RawVector}
32323232- */
32333233- rbTranslation(handle) {
32343234- const ret = wasm.rawrigidbodyset_rbTranslation(this.__wbg_ptr, handle);
32353235- return RawVector.__wrap(ret);
32363236- }
32373237- /**
32383238- * The world-space orientation of this rigid-body.
32393239- * @param {number} handle
32403240- * @returns {RawRotation}
32413241- */
32423242- rbRotation(handle) {
32433243- const ret = wasm.rawrigidbodyset_rbRotation(this.__wbg_ptr, handle);
32443244- return RawRotation.__wrap(ret);
32453245- }
32463246- /**
32473247- * Put the given rigid-body to sleep.
32483248- * @param {number} handle
32493249- */
32503250- rbSleep(handle) {
32513251- wasm.rawrigidbodyset_rbSleep(this.__wbg_ptr, handle);
32523252- }
32533253- /**
32543254- * Is this rigid-body sleeping?
32553255- * @param {number} handle
32563256- * @returns {boolean}
32573257- */
32583258- rbIsSleeping(handle) {
32593259- const ret = wasm.rawrigidbodyset_rbIsSleeping(this.__wbg_ptr, handle);
32603260- return ret !== 0;
32613261- }
32623262- /**
32633263- * Is the velocity of this rigid-body not zero?
32643264- * @param {number} handle
32653265- * @returns {boolean}
32663266- */
32673267- rbIsMoving(handle) {
32683268- const ret = wasm.rawrigidbodyset_rbIsMoving(this.__wbg_ptr, handle);
32693269- return ret !== 0;
32703270- }
32713271- /**
32723272- * The world-space predicted translation of this rigid-body.
32733273- *
32743274- * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation`
32753275- * method and is used for estimating the kinematic body velocity at the next timestep.
32763276- * For non-kinematic bodies, this value is currently unspecified.
32773277- * @param {number} handle
32783278- * @returns {RawVector}
32793279- */
32803280- rbNextTranslation(handle) {
32813281- const ret = wasm.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, handle);
32823282- return RawVector.__wrap(ret);
32833283- }
32843284- /**
32853285- * The world-space predicted orientation of this rigid-body.
32863286- *
32873287- * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation`
32883288- * method and is used for estimating the kinematic body velocity at the next timestep.
32893289- * For non-kinematic bodies, this value is currently unspecified.
32903290- * @param {number} handle
32913291- * @returns {RawRotation}
32923292- */
32933293- rbNextRotation(handle) {
32943294- const ret = wasm.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, handle);
32953295- return RawRotation.__wrap(ret);
32963296- }
32973297- /**
32983298- * Sets the translation of this rigid-body.
32993299- *
33003300- * # Parameters
33013301- * - `x`: the world-space position of the rigid-body along the `x` axis.
33023302- * - `y`: the world-space position of the rigid-body along the `y` axis.
33033303- * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it
33043304- * wasn't moving before modifying its position.
33053305- * @param {number} handle
33063306- * @param {number} x
33073307- * @param {number} y
33083308- * @param {boolean} wakeUp
33093309- */
33103310- rbSetTranslation(handle, x, y, wakeUp) {
33113311- wasm.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, handle, x, y, wakeUp);
33123312- }
33133313- /**
33143314- * Sets the rotation angle of this rigid-body.
33153315- *
33163316- * # Parameters
33173317- * - `angle`: the rotation angle, in radians.
33183318- * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it
33193319- * wasn't moving before modifying its position.
33203320- * @param {number} handle
33213321- * @param {number} angle
33223322- * @param {boolean} wakeUp
33233323- */
33243324- rbSetRotation(handle, angle, wakeUp) {
33253325- wasm.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, handle, angle, wakeUp);
33263326- }
33273327- /**
33283328- * Sets the linear velocity of this rigid-body.
33293329- * @param {number} handle
33303330- * @param {RawVector} linvel
33313331- * @param {boolean} wakeUp
33323332- */
33333333- rbSetLinvel(handle, linvel, wakeUp) {
33343334- _assertClass(linvel, RawVector);
33353335- wasm.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, handle, linvel.__wbg_ptr, wakeUp);
33363336- }
33373337- /**
33383338- * Sets the angular velocity of this rigid-body.
33393339- * @param {number} handle
33403340- * @param {number} angvel
33413341- * @param {boolean} wakeUp
33423342- */
33433343- rbSetAngvel(handle, angvel, wakeUp) {
33443344- wasm.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, handle, angvel, wakeUp);
33453345- }
33463346- /**
33473347- * If this rigid body is kinematic, sets its future translation after the next timestep integration.
33483348- *
33493349- * This should be used instead of `rigidBody.setTranslation` to make the dynamic object
33503350- * interacting with this kinematic body behave as expected. Internally, Rapier will compute
33513351- * an artificial velocity for this rigid-body from its current position and its next kinematic
33523352- * position. This velocity will be used to compute forces on dynamic bodies interacting with
33533353- * this body.
33543354- *
33553355- * # Parameters
33563356- * - `x`: the world-space position of the rigid-body along the `x` axis.
33573357- * - `y`: the world-space position of the rigid-body along the `y` axis.
33583358- * @param {number} handle
33593359- * @param {number} x
33603360- * @param {number} y
33613361- */
33623362- rbSetNextKinematicTranslation(handle, x, y) {
33633363- wasm.rawrigidbodyset_rbSetNextKinematicTranslation(this.__wbg_ptr, handle, x, y);
33643364- }
33653365- /**
33663366- * If this rigid body is kinematic, sets its future rotation after the next timestep integration.
33673367- *
33683368- * This should be used instead of `rigidBody.setRotation` to make the dynamic object
33693369- * interacting with this kinematic body behave as expected. Internally, Rapier will compute
33703370- * an artificial velocity for this rigid-body from its current position and its next kinematic
33713371- * position. This velocity will be used to compute forces on dynamic bodies interacting with
33723372- * this body.
33733373- *
33743374- * # Parameters
33753375- * - `angle`: the rotation angle, in radians.
33763376- * @param {number} handle
33773377- * @param {number} angle
33783378- */
33793379- rbSetNextKinematicRotation(handle, angle) {
33803380- wasm.rawrigidbodyset_rbSetNextKinematicRotation(this.__wbg_ptr, handle, angle);
33813381- }
33823382- /**
33833383- * @param {number} handle
33843384- * @param {RawColliderSet} colliders
33853385- */
33863386- rbRecomputeMassPropertiesFromColliders(handle, colliders) {
33873387- _assertClass(colliders, RawColliderSet);
33883388- wasm.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, handle, colliders.__wbg_ptr);
33893389- }
33903390- /**
33913391- * @param {number} handle
33923392- * @param {number} mass
33933393- * @param {boolean} wake_up
33943394- */
33953395- rbSetAdditionalMass(handle, mass, wake_up) {
33963396- wasm.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, handle, mass, wake_up);
33973397- }
33983398- /**
33993399- * @param {number} handle
34003400- * @param {number} mass
34013401- * @param {RawVector} centerOfMass
34023402- * @param {number} principalAngularInertia
34033403- * @param {boolean} wake_up
34043404- */
34053405- rbSetAdditionalMassProperties(handle, mass, centerOfMass, principalAngularInertia, wake_up) {
34063406- _assertClass(centerOfMass, RawVector);
34073407- wasm.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia, wake_up);
34083408- }
34093409- /**
34103410- * The linear velocity of this rigid-body.
34113411- * @param {number} handle
34123412- * @returns {RawVector}
34133413- */
34143414- rbLinvel(handle) {
34153415- const ret = wasm.rawrigidbodyset_rbLinvel(this.__wbg_ptr, handle);
34163416- return RawVector.__wrap(ret);
34173417- }
34183418- /**
34193419- * The angular velocity of this rigid-body.
34203420- * @param {number} handle
34213421- * @returns {number}
34223422- */
34233423- rbAngvel(handle) {
34243424- const ret = wasm.rawrigidbodyset_rbAngvel(this.__wbg_ptr, handle);
34253425- return ret;
34263426- }
34273427- /**
34283428- * @param {number} handle
34293429- * @param {boolean} locked
34303430- * @param {boolean} wake_up
34313431- */
34323432- rbLockTranslations(handle, locked, wake_up) {
34333433- wasm.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, handle, locked, wake_up);
34343434- }
34353435- /**
34363436- * @param {number} handle
34373437- * @param {boolean} allow_x
34383438- * @param {boolean} allow_y
34393439- * @param {boolean} wake_up
34403440- */
34413441- rbSetEnabledTranslations(handle, allow_x, allow_y, wake_up) {
34423442- wasm.rawrigidbodyset_rbSetEnabledTranslations(this.__wbg_ptr, handle, allow_x, allow_y, wake_up);
34433443- }
34443444- /**
34453445- * @param {number} handle
34463446- * @param {boolean} locked
34473447- * @param {boolean} wake_up
34483448- */
34493449- rbLockRotations(handle, locked, wake_up) {
34503450- wasm.rawrigidbodyset_rbLockRotations(this.__wbg_ptr, handle, locked, wake_up);
34513451- }
34523452- /**
34533453- * @param {number} handle
34543454- * @returns {number}
34553455- */
34563456- rbDominanceGroup(handle) {
34573457- const ret = wasm.rawrigidbodyset_rbDominanceGroup(this.__wbg_ptr, handle);
34583458- return ret;
34593459- }
34603460- /**
34613461- * @param {number} handle
34623462- * @param {number} group
34633463- */
34643464- rbSetDominanceGroup(handle, group) {
34653465- wasm.rawrigidbodyset_rbSetDominanceGroup(this.__wbg_ptr, handle, group);
34663466- }
34673467- /**
34683468- * @param {number} handle
34693469- * @param {boolean} enabled
34703470- */
34713471- rbEnableCcd(handle, enabled) {
34723472- wasm.rawrigidbodyset_rbEnableCcd(this.__wbg_ptr, handle, enabled);
34733473- }
34743474- /**
34753475- * @param {number} handle
34763476- * @param {number} prediction
34773477- */
34783478- rbSetSoftCcdPrediction(handle, prediction) {
34793479- wasm.rawrigidbodyset_rbSetSoftCcdPrediction(this.__wbg_ptr, handle, prediction);
34803480- }
34813481- /**
34823482- * The mass of this rigid-body.
34833483- * @param {number} handle
34843484- * @returns {number}
34853485- */
34863486- rbMass(handle) {
34873487- const ret = wasm.rawrigidbodyset_rbMass(this.__wbg_ptr, handle);
34883488- return ret;
34893489- }
34903490- /**
34913491- * The inverse of the mass of a rigid-body.
34923492- *
34933493- * If this is zero, the rigid-body is assumed to have infinite mass.
34943494- * @param {number} handle
34953495- * @returns {number}
34963496- */
34973497- rbInvMass(handle) {
34983498- const ret = wasm.rawrigidbodyset_rbInvMass(this.__wbg_ptr, handle);
34993499- return ret;
35003500- }
35013501- /**
35023502- * The inverse mass taking into account translation locking.
35033503- * @param {number} handle
35043504- * @returns {RawVector}
35053505- */
35063506- rbEffectiveInvMass(handle) {
35073507- const ret = wasm.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, handle);
35083508- return RawVector.__wrap(ret);
35093509- }
35103510- /**
35113511- * The center of mass of a rigid-body expressed in its local-space.
35123512- * @param {number} handle
35133513- * @returns {RawVector}
35143514- */
35153515- rbLocalCom(handle) {
35163516- const ret = wasm.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, handle);
35173517- return RawVector.__wrap(ret);
35183518- }
35193519- /**
35203520- * The world-space center of mass of the rigid-body.
35213521- * @param {number} handle
35223522- * @returns {RawVector}
35233523- */
35243524- rbWorldCom(handle) {
35253525- const ret = wasm.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, handle);
35263526- return RawVector.__wrap(ret);
35273527- }
35283528- /**
35293529- * The inverse of the principal angular inertia of the rigid-body.
35303530- *
35313531- * Components set to zero are assumed to be infinite along the corresponding principal axis.
35323532- * @param {number} handle
35333533- * @returns {number}
35343534- */
35353535- rbInvPrincipalInertiaSqrt(handle) {
35363536- const ret = wasm.rawrigidbodyset_rbInvPrincipalInertiaSqrt(this.__wbg_ptr, handle);
35373537- return ret;
35383538- }
35393539- /**
35403540- * The angular inertia along the principal inertia axes of the rigid-body.
35413541- * @param {number} handle
35423542- * @returns {number}
35433543- */
35443544- rbPrincipalInertia(handle) {
35453545- const ret = wasm.rawrigidbodyset_rbPrincipalInertia(this.__wbg_ptr, handle);
35463546- return ret;
35473547- }
35483548- /**
35493549- * The square-root of the world-space inverse angular inertia tensor of the rigid-body,
35503550- * taking into account rotation locking.
35513551- * @param {number} handle
35523552- * @returns {number}
35533553- */
35543554- rbEffectiveWorldInvInertiaSqrt(handle) {
35553555- const ret = wasm.rawrigidbodyset_rbEffectiveWorldInvInertiaSqrt(this.__wbg_ptr, handle);
35563556- return ret;
35573557- }
35583558- /**
35593559- * The effective world-space angular inertia (that takes the potential rotation locking into account) of
35603560- * this rigid-body.
35613561- * @param {number} handle
35623562- * @returns {number}
35633563- */
35643564- rbEffectiveAngularInertia(handle) {
35653565- const ret = wasm.rawrigidbodyset_rbEffectiveAngularInertia(this.__wbg_ptr, handle);
35663566- return ret;
35673567- }
35683568- /**
35693569- * Wakes this rigid-body up.
35703570- *
35713571- * A dynamic rigid-body that does not move during several consecutive frames will
35723572- * be put to sleep by the physics engine, i.e., it will stop being simulated in order
35733573- * to avoid useless computations.
35743574- * This method forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying
35753575- * the position of a dynamic body so that it is properly simulated afterwards.
35763576- * @param {number} handle
35773577- */
35783578- rbWakeUp(handle) {
35793579- wasm.rawrigidbodyset_rbWakeUp(this.__wbg_ptr, handle);
35803580- }
35813581- /**
35823582- * Is Continuous Collision Detection enabled for this rigid-body?
35833583- * @param {number} handle
35843584- * @returns {boolean}
35853585- */
35863586- rbIsCcdEnabled(handle) {
35873587- const ret = wasm.rawrigidbodyset_rbIsCcdEnabled(this.__wbg_ptr, handle);
35883588- return ret !== 0;
35893589- }
35903590- /**
35913591- * @param {number} handle
35923592- * @returns {number}
35933593- */
35943594- rbSoftCcdPrediction(handle) {
35953595- const ret = wasm.rawrigidbodyset_rbSoftCcdPrediction(this.__wbg_ptr, handle);
35963596- return ret;
35973597- }
35983598- /**
35993599- * The number of colliders attached to this rigid-body.
36003600- * @param {number} handle
36013601- * @returns {number}
36023602- */
36033603- rbNumColliders(handle) {
36043604- const ret = wasm.rawrigidbodyset_rbNumColliders(this.__wbg_ptr, handle);
36053605- return ret >>> 0;
36063606- }
36073607- /**
36083608- * Retrieves the `i-th` collider attached to this rigid-body.
36093609- *
36103610- * # Parameters
36113611- * - `at`: The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`.
36123612- * This index is **not** the same as the unique identifier of the collider.
36133613- * @param {number} handle
36143614- * @param {number} at
36153615- * @returns {number}
36163616- */
36173617- rbCollider(handle, at) {
36183618- const ret = wasm.rawrigidbodyset_rbCollider(this.__wbg_ptr, handle, at);
36193619- return ret;
36203620- }
36213621- /**
36223622- * The status of this rigid-body: fixed, dynamic, or kinematic.
36233623- * @param {number} handle
36243624- * @returns {RawRigidBodyType}
36253625- */
36263626- rbBodyType(handle) {
36273627- const ret = wasm.rawrigidbodyset_rbBodyType(this.__wbg_ptr, handle);
36283628- return ret;
36293629- }
36303630- /**
36313631- * Set a new status for this rigid-body: fixed, dynamic, or kinematic.
36323632- * @param {number} handle
36333633- * @param {RawRigidBodyType} status
36343634- * @param {boolean} wake_up
36353635- */
36363636- rbSetBodyType(handle, status, wake_up) {
36373637- wasm.rawrigidbodyset_rbSetBodyType(this.__wbg_ptr, handle, status, wake_up);
36383638- }
36393639- /**
36403640- * Is this rigid-body fixed?
36413641- * @param {number} handle
36423642- * @returns {boolean}
36433643- */
36443644- rbIsFixed(handle) {
36453645- const ret = wasm.rawrigidbodyset_rbIsFixed(this.__wbg_ptr, handle);
36463646- return ret !== 0;
36473647- }
36483648- /**
36493649- * Is this rigid-body kinematic?
36503650- * @param {number} handle
36513651- * @returns {boolean}
36523652- */
36533653- rbIsKinematic(handle) {
36543654- const ret = wasm.rawrigidbodyset_rbIsKinematic(this.__wbg_ptr, handle);
36553655- return ret !== 0;
36563656- }
36573657- /**
36583658- * Is this rigid-body dynamic?
36593659- * @param {number} handle
36603660- * @returns {boolean}
36613661- */
36623662- rbIsDynamic(handle) {
36633663- const ret = wasm.rawrigidbodyset_rbIsDynamic(this.__wbg_ptr, handle);
36643664- return ret !== 0;
36653665- }
36663666- /**
36673667- * The linear damping coefficient of this rigid-body.
36683668- * @param {number} handle
36693669- * @returns {number}
36703670- */
36713671- rbLinearDamping(handle) {
36723672- const ret = wasm.rawrigidbodyset_rbLinearDamping(this.__wbg_ptr, handle);
36733673- return ret;
36743674- }
36753675- /**
36763676- * The angular damping coefficient of this rigid-body.
36773677- * @param {number} handle
36783678- * @returns {number}
36793679- */
36803680- rbAngularDamping(handle) {
36813681- const ret = wasm.rawrigidbodyset_rbAngularDamping(this.__wbg_ptr, handle);
36823682- return ret;
36833683- }
36843684- /**
36853685- * @param {number} handle
36863686- * @param {number} factor
36873687- */
36883688- rbSetLinearDamping(handle, factor) {
36893689- wasm.rawrigidbodyset_rbSetLinearDamping(this.__wbg_ptr, handle, factor);
36903690- }
36913691- /**
36923692- * @param {number} handle
36933693- * @param {number} factor
36943694- */
36953695- rbSetAngularDamping(handle, factor) {
36963696- wasm.rawrigidbodyset_rbSetAngularDamping(this.__wbg_ptr, handle, factor);
36973697- }
36983698- /**
36993699- * @param {number} handle
37003700- * @param {boolean} enabled
37013701- */
37023702- rbSetEnabled(handle, enabled) {
37033703- wasm.rawrigidbodyset_rbSetEnabled(this.__wbg_ptr, handle, enabled);
37043704- }
37053705- /**
37063706- * @param {number} handle
37073707- * @returns {boolean}
37083708- */
37093709- rbIsEnabled(handle) {
37103710- const ret = wasm.rawrigidbodyset_rbIsEnabled(this.__wbg_ptr, handle);
37113711- return ret !== 0;
37123712- }
37133713- /**
37143714- * @param {number} handle
37153715- * @returns {number}
37163716- */
37173717- rbGravityScale(handle) {
37183718- const ret = wasm.rawrigidbodyset_rbGravityScale(this.__wbg_ptr, handle);
37193719- return ret;
37203720- }
37213721- /**
37223722- * @param {number} handle
37233723- * @param {number} factor
37243724- * @param {boolean} wakeUp
37253725- */
37263726- rbSetGravityScale(handle, factor, wakeUp) {
37273727- wasm.rawrigidbodyset_rbSetGravityScale(this.__wbg_ptr, handle, factor, wakeUp);
37283728- }
37293729- /**
37303730- * Resets to zero all user-added forces added to this rigid-body.
37313731- * @param {number} handle
37323732- * @param {boolean} wakeUp
37333733- */
37343734- rbResetForces(handle, wakeUp) {
37353735- wasm.rawrigidbodyset_rbResetForces(this.__wbg_ptr, handle, wakeUp);
37363736- }
37373737- /**
37383738- * Resets to zero all user-added torques added to this rigid-body.
37393739- * @param {number} handle
37403740- * @param {boolean} wakeUp
37413741- */
37423742- rbResetTorques(handle, wakeUp) {
37433743- wasm.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, handle, wakeUp);
37443744- }
37453745- /**
37463746- * Adds a force at the center-of-mass of this rigid-body.
37473747- *
37483748- * # Parameters
37493749- * - `force`: the world-space force to apply on the rigid-body.
37503750- * - `wakeUp`: should the rigid-body be automatically woken-up?
37513751- * @param {number} handle
37523752- * @param {RawVector} force
37533753- * @param {boolean} wakeUp
37543754- */
37553755- rbAddForce(handle, force, wakeUp) {
37563756- _assertClass(force, RawVector);
37573757- wasm.rawrigidbodyset_rbAddForce(this.__wbg_ptr, handle, force.__wbg_ptr, wakeUp);
37583758- }
37593759- /**
37603760- * Applies an impulse at the center-of-mass of this rigid-body.
37613761- *
37623762- * # Parameters
37633763- * - `impulse`: the world-space impulse to apply on the rigid-body.
37643764- * - `wakeUp`: should the rigid-body be automatically woken-up?
37653765- * @param {number} handle
37663766- * @param {RawVector} impulse
37673767- * @param {boolean} wakeUp
37683768- */
37693769- rbApplyImpulse(handle, impulse, wakeUp) {
37703770- _assertClass(impulse, RawVector);
37713771- wasm.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, handle, impulse.__wbg_ptr, wakeUp);
37723772- }
37733773- /**
37743774- * Adds a torque at the center-of-mass of this rigid-body.
37753775- *
37763776- * # Parameters
37773777- * - `torque`: the torque to apply on the rigid-body.
37783778- * - `wakeUp`: should the rigid-body be automatically woken-up?
37793779- * @param {number} handle
37803780- * @param {number} torque
37813781- * @param {boolean} wakeUp
37823782- */
37833783- rbAddTorque(handle, torque, wakeUp) {
37843784- wasm.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, handle, torque, wakeUp);
37853785- }
37863786- /**
37873787- * Applies an impulsive torque at the center-of-mass of this rigid-body.
37883788- *
37893789- * # Parameters
37903790- * - `torque impulse`: the torque impulse to apply on the rigid-body.
37913791- * - `wakeUp`: should the rigid-body be automatically woken-up?
37923792- * @param {number} handle
37933793- * @param {number} torque_impulse
37943794- * @param {boolean} wakeUp
37953795- */
37963796- rbApplyTorqueImpulse(handle, torque_impulse, wakeUp) {
37973797- wasm.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, handle, torque_impulse, wakeUp);
37983798- }
37993799- /**
38003800- * Adds a force at the given world-space point of this rigid-body.
38013801- *
38023802- * # Parameters
38033803- * - `force`: the world-space force to apply on the rigid-body.
38043804- * - `point`: the world-space point where the impulse is to be applied on the rigid-body.
38053805- * - `wakeUp`: should the rigid-body be automatically woken-up?
38063806- * @param {number} handle
38073807- * @param {RawVector} force
38083808- * @param {RawVector} point
38093809- * @param {boolean} wakeUp
38103810- */
38113811- rbAddForceAtPoint(handle, force, point, wakeUp) {
38123812- _assertClass(force, RawVector);
38133813- _assertClass(point, RawVector);
38143814- wasm.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, handle, force.__wbg_ptr, point.__wbg_ptr, wakeUp);
38153815- }
38163816- /**
38173817- * Applies an impulse at the given world-space point of this rigid-body.
38183818- *
38193819- * # Parameters
38203820- * - `impulse`: the world-space impulse to apply on the rigid-body.
38213821- * - `point`: the world-space point where the impulse is to be applied on the rigid-body.
38223822- * - `wakeUp`: should the rigid-body be automatically woken-up?
38233823- * @param {number} handle
38243824- * @param {RawVector} impulse
38253825- * @param {RawVector} point
38263826- * @param {boolean} wakeUp
38273827- */
38283828- rbApplyImpulseAtPoint(handle, impulse, point, wakeUp) {
38293829- _assertClass(impulse, RawVector);
38303830- _assertClass(point, RawVector);
38313831- wasm.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, handle, impulse.__wbg_ptr, point.__wbg_ptr, wakeUp);
38323832- }
38333833- /**
38343834- * @param {number} handle
38353835- * @returns {number}
38363836- */
38373837- rbAdditionalSolverIterations(handle) {
38383838- const ret = wasm.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, handle);
38393839- return ret >>> 0;
38403840- }
38413841- /**
38423842- * @param {number} handle
38433843- * @param {number} iters
38443844- */
38453845- rbSetAdditionalSolverIterations(handle, iters) {
38463846- wasm.rawrigidbodyset_rbSetAdditionalSolverIterations(this.__wbg_ptr, handle, iters);
38473847- }
38483848- /**
38493849- * An arbitrary user-defined 32-bit integer
38503850- * @param {number} handle
38513851- * @returns {number}
38523852- */
38533853- rbUserData(handle) {
38543854- const ret = wasm.rawrigidbodyset_rbUserData(this.__wbg_ptr, handle);
38553855- return ret >>> 0;
38563856- }
38573857- /**
38583858- * Sets the user-defined 32-bit integer of this rigid-body.
38593859- *
38603860- * # Parameters
38613861- * - `data`: an arbitrary user-defined 32-bit integer.
38623862- * @param {number} handle
38633863- * @param {number} data
38643864- */
38653865- rbSetUserData(handle, data) {
38663866- wasm.rawrigidbodyset_rbSetUserData(this.__wbg_ptr, handle, data);
38673867- }
38683868- /**
38693869- */
38703870- constructor() {
38713871- const ret = wasm.rawrigidbodyset_new();
38723872- this.__wbg_ptr = ret >>> 0;
38733873- return this;
38743874- }
38753875- /**
38763876- * @param {boolean} enabled
38773877- * @param {RawVector} translation
38783878- * @param {RawRotation} rotation
38793879- * @param {number} gravityScale
38803880- * @param {number} mass
38813881- * @param {boolean} massOnly
38823882- * @param {RawVector} centerOfMass
38833883- * @param {RawVector} linvel
38843884- * @param {number} angvel
38853885- * @param {number} principalAngularInertia
38863886- * @param {boolean} translationEnabledX
38873887- * @param {boolean} translationEnabledY
38883888- * @param {boolean} rotationsEnabled
38893889- * @param {number} linearDamping
38903890- * @param {number} angularDamping
38913891- * @param {RawRigidBodyType} rb_type
38923892- * @param {boolean} canSleep
38933893- * @param {boolean} sleeping
38943894- * @param {number} softCcdPrediciton
38953895- * @param {boolean} ccdEnabled
38963896- * @param {number} dominanceGroup
38973897- * @param {number} additional_solver_iterations
38983898- * @returns {number}
38993899- */
39003900- createRigidBody(enabled, translation, rotation, gravityScale, mass, massOnly, centerOfMass, linvel, angvel, principalAngularInertia, translationEnabledX, translationEnabledY, rotationsEnabled, linearDamping, angularDamping, rb_type, canSleep, sleeping, softCcdPrediciton, ccdEnabled, dominanceGroup, additional_solver_iterations) {
39013901- _assertClass(translation, RawVector);
39023902- _assertClass(rotation, RawRotation);
39033903- _assertClass(centerOfMass, RawVector);
39043904- _assertClass(linvel, RawVector);
39053905- const ret = wasm.rawrigidbodyset_createRigidBody(this.__wbg_ptr, enabled, translation.__wbg_ptr, rotation.__wbg_ptr, gravityScale, mass, massOnly, centerOfMass.__wbg_ptr, linvel.__wbg_ptr, angvel, principalAngularInertia, translationEnabledX, translationEnabledY, rotationsEnabled, linearDamping, angularDamping, rb_type, canSleep, sleeping, softCcdPrediciton, ccdEnabled, dominanceGroup, additional_solver_iterations);
39063906- return ret;
39073907- }
39083908- /**
39093909- * @param {number} handle
39103910- * @param {RawIslandManager} islands
39113911- * @param {RawColliderSet} colliders
39123912- * @param {RawImpulseJointSet} joints
39133913- * @param {RawMultibodyJointSet} articulations
39143914- */
39153915- remove(handle, islands, colliders, joints, articulations) {
39163916- _assertClass(islands, RawIslandManager);
39173917- _assertClass(colliders, RawColliderSet);
39183918- _assertClass(joints, RawImpulseJointSet);
39193919- _assertClass(articulations, RawMultibodyJointSet);
39203920- wasm.rawrigidbodyset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr);
39213921- }
39223922- /**
39233923- * The number of rigid-bodies on this set.
39243924- * @returns {number}
39253925- */
39263926- len() {
39273927- const ret = wasm.rawcolliderset_len(this.__wbg_ptr);
39283928- return ret >>> 0;
39293929- }
39303930- /**
39313931- * Checks if a rigid-body with the given integer handle exists.
39323932- * @param {number} handle
39333933- * @returns {boolean}
39343934- */
39353935- contains(handle) {
39363936- const ret = wasm.rawrigidbodyset_contains(this.__wbg_ptr, handle);
39373937- return ret !== 0;
39383938- }
39393939- /**
39403940- * Applies the given JavaScript function to the integer handle of each rigid-body managed by this set.
39413941- *
39423942- * # Parameters
39433943- * - `f(handle)`: the function to apply to the integer handle of each rigid-body managed by this set. Called as `f(collider)`.
39443944- * @param {Function} f
39453945- */
39463946- forEachRigidBodyHandle(f) {
39473947- try {
39483948- wasm.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f));
39493949- } finally {
39503950- heap[stack_pointer++] = void 0;
39513951- }
39523952- }
39533953- /**
39543954- * @param {RawColliderSet} colliders
39553955- */
39563956- propagateModifiedBodyPositionsToColliders(colliders) {
39573957- _assertClass(colliders, RawColliderSet);
39583958- wasm.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, colliders.__wbg_ptr);
39593959- }
39603960-};
39613961-var RawRotation = class _RawRotation {
39623962- static __wrap(ptr) {
39633963- ptr = ptr >>> 0;
39643964- const obj = Object.create(_RawRotation.prototype);
39653965- obj.__wbg_ptr = ptr;
39663966- return obj;
39673967- }
39683968- __destroy_into_raw() {
39693969- const ptr = this.__wbg_ptr;
39703970- this.__wbg_ptr = 0;
39713971- return ptr;
39723972- }
39733973- free() {
39743974- const ptr = this.__destroy_into_raw();
39753975- wasm.__wbg_rawrotation_free(ptr);
39763976- }
39773977- /**
39783978- * The identity rotation.
39793979- * @returns {RawRotation}
39803980- */
39813981- static identity() {
39823982- const ret = wasm.rawrotation_identity();
39833983- return _RawRotation.__wrap(ret);
39843984- }
39853985- /**
39863986- * The rotation with thegiven angle.
39873987- * @param {number} angle
39883988- * @returns {RawRotation}
39893989- */
39903990- static fromAngle(angle) {
39913991- const ret = wasm.rawrotation_fromAngle(angle);
39923992- return _RawRotation.__wrap(ret);
39933993- }
39943994- /**
39953995- * The imaginary part of this complex number.
39963996- * @returns {number}
39973997- */
39983998- get im() {
39993999- const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);
40004000- return ret;
40014001- }
40024002- /**
40034003- * The real part of this complex number.
40044004- * @returns {number}
40054005- */
40064006- get re() {
40074007- const ret = wasm.rawrotation_re(this.__wbg_ptr);
40084008- return ret;
40094009- }
40104010- /**
40114011- * The rotation angle in radians.
40124012- * @returns {number}
40134013- */
40144014- get angle() {
40154015- const ret = wasm.rawrotation_angle(this.__wbg_ptr);
40164016- return ret;
40174017- }
40184018-};
40194019-var RawSerializationPipeline = class {
40204020- __destroy_into_raw() {
40214021- const ptr = this.__wbg_ptr;
40224022- this.__wbg_ptr = 0;
40234023- return ptr;
40244024- }
40254025- free() {
40264026- const ptr = this.__destroy_into_raw();
40274027- wasm.__wbg_rawserializationpipeline_free(ptr);
40284028- }
40294029- /**
40304030- */
40314031- constructor() {
40324032- const ret = wasm.rawserializationpipeline_new();
40334033- this.__wbg_ptr = ret >>> 0;
40344034- return this;
40354035- }
40364036- /**
40374037- * @param {RawVector} gravity
40384038- * @param {RawIntegrationParameters} integrationParameters
40394039- * @param {RawIslandManager} islands
40404040- * @param {RawBroadPhase} broadPhase
40414041- * @param {RawNarrowPhase} narrowPhase
40424042- * @param {RawRigidBodySet} bodies
40434043- * @param {RawColliderSet} colliders
40444044- * @param {RawImpulseJointSet} impulse_joints
40454045- * @param {RawMultibodyJointSet} multibody_joints
40464046- * @returns {Uint8Array | undefined}
40474047- */
40484048- serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulse_joints, multibody_joints) {
40494049- _assertClass(gravity, RawVector);
40504050- _assertClass(integrationParameters, RawIntegrationParameters);
40514051- _assertClass(islands, RawIslandManager);
40524052- _assertClass(broadPhase, RawBroadPhase);
40534053- _assertClass(narrowPhase, RawNarrowPhase);
40544054- _assertClass(bodies, RawRigidBodySet);
40554055- _assertClass(colliders, RawColliderSet);
40564056- _assertClass(impulse_joints, RawImpulseJointSet);
40574057- _assertClass(multibody_joints, RawMultibodyJointSet);
40584058- const ret = wasm.rawserializationpipeline_serializeAll(this.__wbg_ptr, gravity.__wbg_ptr, integrationParameters.__wbg_ptr, islands.__wbg_ptr, broadPhase.__wbg_ptr, narrowPhase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, impulse_joints.__wbg_ptr, multibody_joints.__wbg_ptr);
40594059- return takeObject(ret);
40604060- }
40614061- /**
40624062- * @param {Uint8Array} data
40634063- * @returns {RawDeserializedWorld | undefined}
40644064- */
40654065- deserializeAll(data) {
40664066- const ret = wasm.rawserializationpipeline_deserializeAll(this.__wbg_ptr, addHeapObject(data));
40674067- return ret === 0 ? void 0 : RawDeserializedWorld.__wrap(ret);
40684068- }
40694069-};
40704070-var RawShape = class _RawShape {
40714071- static __wrap(ptr) {
40724072- ptr = ptr >>> 0;
40734073- const obj = Object.create(_RawShape.prototype);
40744074- obj.__wbg_ptr = ptr;
40754075- return obj;
40764076- }
40774077- __destroy_into_raw() {
40784078- const ptr = this.__wbg_ptr;
40794079- this.__wbg_ptr = 0;
40804080- return ptr;
40814081- }
40824082- free() {
40834083- const ptr = this.__destroy_into_raw();
40844084- wasm.__wbg_rawshape_free(ptr);
40854085- }
40864086- /**
40874087- * @param {number} hx
40884088- * @param {number} hy
40894089- * @returns {RawShape}
40904090- */
40914091- static cuboid(hx, hy) {
40924092- const ret = wasm.rawshape_cuboid(hx, hy);
40934093- return _RawShape.__wrap(ret);
40944094- }
40954095- /**
40964096- * @param {number} hx
40974097- * @param {number} hy
40984098- * @param {number} borderRadius
40994099- * @returns {RawShape}
41004100- */
41014101- static roundCuboid(hx, hy, borderRadius) {
41024102- const ret = wasm.rawshape_roundCuboid(hx, hy, borderRadius);
41034103- return _RawShape.__wrap(ret);
41044104- }
41054105- /**
41064106- * @param {number} radius
41074107- * @returns {RawShape}
41084108- */
41094109- static ball(radius) {
41104110- const ret = wasm.rawshape_ball(radius);
41114111- return _RawShape.__wrap(ret);
41124112- }
41134113- /**
41144114- * @param {RawVector} normal
41154115- * @returns {RawShape}
41164116- */
41174117- static halfspace(normal) {
41184118- _assertClass(normal, RawVector);
41194119- const ret = wasm.rawshape_halfspace(normal.__wbg_ptr);
41204120- return _RawShape.__wrap(ret);
41214121- }
41224122- /**
41234123- * @param {number} halfHeight
41244124- * @param {number} radius
41254125- * @returns {RawShape}
41264126- */
41274127- static capsule(halfHeight, radius) {
41284128- const ret = wasm.rawshape_capsule(halfHeight, radius);
41294129- return _RawShape.__wrap(ret);
41304130- }
41314131- /**
41324132- * @param {Float32Array} vertices
41334133- * @param {Uint32Array} indices
41344134- * @returns {RawShape}
41354135- */
41364136- static polyline(vertices, indices) {
41374137- const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
41384138- const len0 = WASM_VECTOR_LEN;
41394139- const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
41404140- const len1 = WASM_VECTOR_LEN;
41414141- const ret = wasm.rawshape_polyline(ptr0, len0, ptr1, len1);
41424142- return _RawShape.__wrap(ret);
41434143- }
41444144- /**
41454145- * @param {Float32Array} vertices
41464146- * @param {Uint32Array} indices
41474147- * @param {number} flags
41484148- * @returns {RawShape}
41494149- */
41504150- static trimesh(vertices, indices, flags) {
41514151- const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
41524152- const len0 = WASM_VECTOR_LEN;
41534153- const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
41544154- const len1 = WASM_VECTOR_LEN;
41554155- const ret = wasm.rawshape_trimesh(ptr0, len0, ptr1, len1, flags);
41564156- return _RawShape.__wrap(ret);
41574157- }
41584158- /**
41594159- * @param {Float32Array} heights
41604160- * @param {RawVector} scale
41614161- * @returns {RawShape}
41624162- */
41634163- static heightfield(heights, scale) {
41644164- const ptr0 = passArrayF32ToWasm0(heights, wasm.__wbindgen_malloc);
41654165- const len0 = WASM_VECTOR_LEN;
41664166- _assertClass(scale, RawVector);
41674167- const ret = wasm.rawshape_heightfield(ptr0, len0, scale.__wbg_ptr);
41684168- return _RawShape.__wrap(ret);
41694169- }
41704170- /**
41714171- * @param {RawVector} p1
41724172- * @param {RawVector} p2
41734173- * @returns {RawShape}
41744174- */
41754175- static segment(p1, p2) {
41764176- _assertClass(p1, RawVector);
41774177- _assertClass(p2, RawVector);
41784178- const ret = wasm.rawshape_segment(p1.__wbg_ptr, p2.__wbg_ptr);
41794179- return _RawShape.__wrap(ret);
41804180- }
41814181- /**
41824182- * @param {RawVector} p1
41834183- * @param {RawVector} p2
41844184- * @param {RawVector} p3
41854185- * @returns {RawShape}
41864186- */
41874187- static triangle(p1, p2, p3) {
41884188- _assertClass(p1, RawVector);
41894189- _assertClass(p2, RawVector);
41904190- _assertClass(p3, RawVector);
41914191- const ret = wasm.rawshape_triangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr);
41924192- return _RawShape.__wrap(ret);
41934193- }
41944194- /**
41954195- * @param {RawVector} p1
41964196- * @param {RawVector} p2
41974197- * @param {RawVector} p3
41984198- * @param {number} borderRadius
41994199- * @returns {RawShape}
42004200- */
42014201- static roundTriangle(p1, p2, p3, borderRadius) {
42024202- _assertClass(p1, RawVector);
42034203- _assertClass(p2, RawVector);
42044204- _assertClass(p3, RawVector);
42054205- const ret = wasm.rawshape_roundTriangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr, borderRadius);
42064206- return _RawShape.__wrap(ret);
42074207- }
42084208- /**
42094209- * @param {Float32Array} points
42104210- * @returns {RawShape | undefined}
42114211- */
42124212- static convexHull(points) {
42134213- const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_malloc);
42144214- const len0 = WASM_VECTOR_LEN;
42154215- const ret = wasm.rawshape_convexHull(ptr0, len0);
42164216- return ret === 0 ? void 0 : _RawShape.__wrap(ret);
42174217- }
42184218- /**
42194219- * @param {Float32Array} points
42204220- * @param {number} borderRadius
42214221- * @returns {RawShape | undefined}
42224222- */
42234223- static roundConvexHull(points, borderRadius) {
42244224- const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_malloc);
42254225- const len0 = WASM_VECTOR_LEN;
42264226- const ret = wasm.rawshape_roundConvexHull(ptr0, len0, borderRadius);
42274227- return ret === 0 ? void 0 : _RawShape.__wrap(ret);
42284228- }
42294229- /**
42304230- * @param {Float32Array} vertices
42314231- * @returns {RawShape | undefined}
42324232- */
42334233- static convexPolyline(vertices) {
42344234- const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
42354235- const len0 = WASM_VECTOR_LEN;
42364236- const ret = wasm.rawshape_convexPolyline(ptr0, len0);
42374237- return ret === 0 ? void 0 : _RawShape.__wrap(ret);
42384238- }
42394239- /**
42404240- * @param {Float32Array} vertices
42414241- * @param {number} borderRadius
42424242- * @returns {RawShape | undefined}
42434243- */
42444244- static roundConvexPolyline(vertices, borderRadius) {
42454245- const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
42464246- const len0 = WASM_VECTOR_LEN;
42474247- const ret = wasm.rawshape_roundConvexPolyline(ptr0, len0, borderRadius);
42484248- return ret === 0 ? void 0 : _RawShape.__wrap(ret);
42494249- }
42504250- /**
42514251- * @param {RawVector} shapePos1
42524252- * @param {RawRotation} shapeRot1
42534253- * @param {RawVector} shapeVel1
42544254- * @param {RawShape} shape2
42554255- * @param {RawVector} shapePos2
42564256- * @param {RawRotation} shapeRot2
42574257- * @param {RawVector} shapeVel2
42584258- * @param {number} target_distance
42594259- * @param {number} maxToi
42604260- * @param {boolean} stop_at_penetration
42614261- * @returns {RawShapeCastHit | undefined}
42624262- */
42634263- castShape(shapePos1, shapeRot1, shapeVel1, shape2, shapePos2, shapeRot2, shapeVel2, target_distance, maxToi, stop_at_penetration) {
42644264- _assertClass(shapePos1, RawVector);
42654265- _assertClass(shapeRot1, RawRotation);
42664266- _assertClass(shapeVel1, RawVector);
42674267- _assertClass(shape2, _RawShape);
42684268- _assertClass(shapePos2, RawVector);
42694269- _assertClass(shapeRot2, RawRotation);
42704270- _assertClass(shapeVel2, RawVector);
42714271- const ret = wasm.rawshape_castShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shapeVel1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, shapeVel2.__wbg_ptr, target_distance, maxToi, stop_at_penetration);
42724272- return ret === 0 ? void 0 : RawShapeCastHit.__wrap(ret);
42734273- }
42744274- /**
42754275- * @param {RawVector} shapePos1
42764276- * @param {RawRotation} shapeRot1
42774277- * @param {RawShape} shape2
42784278- * @param {RawVector} shapePos2
42794279- * @param {RawRotation} shapeRot2
42804280- * @returns {boolean}
42814281- */
42824282- intersectsShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2) {
42834283- _assertClass(shapePos1, RawVector);
42844284- _assertClass(shapeRot1, RawRotation);
42854285- _assertClass(shape2, _RawShape);
42864286- _assertClass(shapePos2, RawVector);
42874287- _assertClass(shapeRot2, RawRotation);
42884288- const ret = wasm.rawshape_intersectsShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr);
42894289- return ret !== 0;
42904290- }
42914291- /**
42924292- * @param {RawVector} shapePos1
42934293- * @param {RawRotation} shapeRot1
42944294- * @param {RawShape} shape2
42954295- * @param {RawVector} shapePos2
42964296- * @param {RawRotation} shapeRot2
42974297- * @param {number} prediction
42984298- * @returns {RawShapeContact | undefined}
42994299- */
43004300- contactShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2, prediction) {
43014301- _assertClass(shapePos1, RawVector);
43024302- _assertClass(shapeRot1, RawRotation);
43034303- _assertClass(shape2, _RawShape);
43044304- _assertClass(shapePos2, RawVector);
43054305- _assertClass(shapeRot2, RawRotation);
43064306- const ret = wasm.rawshape_contactShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction);
43074307- return ret === 0 ? void 0 : RawShapeContact.__wrap(ret);
43084308- }
43094309- /**
43104310- * @param {RawVector} shapePos
43114311- * @param {RawRotation} shapeRot
43124312- * @param {RawVector} point
43134313- * @returns {boolean}
43144314- */
43154315- containsPoint(shapePos, shapeRot, point) {
43164316- _assertClass(shapePos, RawVector);
43174317- _assertClass(shapeRot, RawRotation);
43184318- _assertClass(point, RawVector);
43194319- const ret = wasm.rawshape_containsPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr);
43204320- return ret !== 0;
43214321- }
43224322- /**
43234323- * @param {RawVector} shapePos
43244324- * @param {RawRotation} shapeRot
43254325- * @param {RawVector} point
43264326- * @param {boolean} solid
43274327- * @returns {RawPointProjection}
43284328- */
43294329- projectPoint(shapePos, shapeRot, point, solid) {
43304330- _assertClass(shapePos, RawVector);
43314331- _assertClass(shapeRot, RawRotation);
43324332- _assertClass(point, RawVector);
43334333- const ret = wasm.rawshape_projectPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr, solid);
43344334- return RawPointProjection.__wrap(ret);
43354335- }
43364336- /**
43374337- * @param {RawVector} shapePos
43384338- * @param {RawRotation} shapeRot
43394339- * @param {RawVector} rayOrig
43404340- * @param {RawVector} rayDir
43414341- * @param {number} maxToi
43424342- * @returns {boolean}
43434343- */
43444344- intersectsRay(shapePos, shapeRot, rayOrig, rayDir, maxToi) {
43454345- _assertClass(shapePos, RawVector);
43464346- _assertClass(shapeRot, RawRotation);
43474347- _assertClass(rayOrig, RawVector);
43484348- _assertClass(rayDir, RawVector);
43494349- const ret = wasm.rawshape_intersectsRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi);
43504350- return ret !== 0;
43514351- }
43524352- /**
43534353- * @param {RawVector} shapePos
43544354- * @param {RawRotation} shapeRot
43554355- * @param {RawVector} rayOrig
43564356- * @param {RawVector} rayDir
43574357- * @param {number} maxToi
43584358- * @param {boolean} solid
43594359- * @returns {number}
43604360- */
43614361- castRay(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) {
43624362- _assertClass(shapePos, RawVector);
43634363- _assertClass(shapeRot, RawRotation);
43644364- _assertClass(rayOrig, RawVector);
43654365- _assertClass(rayDir, RawVector);
43664366- const ret = wasm.rawshape_castRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);
43674367- return ret;
43684368- }
43694369- /**
43704370- * @param {RawVector} shapePos
43714371- * @param {RawRotation} shapeRot
43724372- * @param {RawVector} rayOrig
43734373- * @param {RawVector} rayDir
43744374- * @param {number} maxToi
43754375- * @param {boolean} solid
43764376- * @returns {RawRayIntersection | undefined}
43774377- */
43784378- castRayAndGetNormal(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) {
43794379- _assertClass(shapePos, RawVector);
43804380- _assertClass(shapeRot, RawRotation);
43814381- _assertClass(rayOrig, RawVector);
43824382- _assertClass(rayDir, RawVector);
43834383- const ret = wasm.rawshape_castRayAndGetNormal(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);
43844384- return ret === 0 ? void 0 : RawRayIntersection.__wrap(ret);
43854385- }
43864386-};
43874387-var RawShapeCastHit = class _RawShapeCastHit {
43884388- static __wrap(ptr) {
43894389- ptr = ptr >>> 0;
43904390- const obj = Object.create(_RawShapeCastHit.prototype);
43914391- obj.__wbg_ptr = ptr;
43924392- return obj;
43934393- }
43944394- __destroy_into_raw() {
43954395- const ptr = this.__wbg_ptr;
43964396- this.__wbg_ptr = 0;
43974397- return ptr;
43984398- }
43994399- free() {
44004400- const ptr = this.__destroy_into_raw();
44014401- wasm.__wbg_rawshapecasthit_free(ptr);
44024402- }
44034403- /**
44044404- * @returns {number}
44054405- */
44064406- time_of_impact() {
44074407- const ret = wasm.rawrotation_re(this.__wbg_ptr);
44084408- return ret;
44094409- }
44104410- /**
44114411- * @returns {RawVector}
44124412- */
44134413- witness1() {
44144414- const ret = wasm.rawshapecasthit_witness1(this.__wbg_ptr);
44154415- return RawVector.__wrap(ret);
44164416- }
44174417- /**
44184418- * @returns {RawVector}
44194419- */
44204420- witness2() {
44214421- const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);
44224422- return RawVector.__wrap(ret);
44234423- }
44244424- /**
44254425- * @returns {RawVector}
44264426- */
44274427- normal1() {
44284428- const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr);
44294429- return RawVector.__wrap(ret);
44304430- }
44314431- /**
44324432- * @returns {RawVector}
44334433- */
44344434- normal2() {
44354435- const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr);
44364436- return RawVector.__wrap(ret);
44374437- }
44384438-};
44394439-var RawShapeContact = class _RawShapeContact {
44404440- static __wrap(ptr) {
44414441- ptr = ptr >>> 0;
44424442- const obj = Object.create(_RawShapeContact.prototype);
44434443- obj.__wbg_ptr = ptr;
44444444- return obj;
44454445- }
44464446- __destroy_into_raw() {
44474447- const ptr = this.__wbg_ptr;
44484448- this.__wbg_ptr = 0;
44494449- return ptr;
44504450- }
44514451- free() {
44524452- const ptr = this.__destroy_into_raw();
44534453- wasm.__wbg_rawshapecontact_free(ptr);
44544454- }
44554455- /**
44564456- * @returns {number}
44574457- */
44584458- distance() {
44594459- const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
44604460- return ret;
44614461- }
44624462- /**
44634463- * @returns {RawVector}
44644464- */
44654465- point1() {
44664466- const ret = wasm.rawpointprojection_point(this.__wbg_ptr);
44674467- return RawVector.__wrap(ret);
44684468- }
44694469- /**
44704470- * @returns {RawVector}
44714471- */
44724472- point2() {
44734473- const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr);
44744474- return RawVector.__wrap(ret);
44754475- }
44764476- /**
44774477- * @returns {RawVector}
44784478- */
44794479- normal1() {
44804480- const ret = wasm.rawcontactforceevent_total_force(this.__wbg_ptr);
44814481- return RawVector.__wrap(ret);
44824482- }
44834483- /**
44844484- * @returns {RawVector}
44854485- */
44864486- normal2() {
44874487- const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
44884488- return RawVector.__wrap(ret);
44894489- }
44904490-};
44914491-var RawVector = class _RawVector {
44924492- static __wrap(ptr) {
44934493- ptr = ptr >>> 0;
44944494- const obj = Object.create(_RawVector.prototype);
44954495- obj.__wbg_ptr = ptr;
44964496- return obj;
44974497- }
44984498- __destroy_into_raw() {
44994499- const ptr = this.__wbg_ptr;
45004500- this.__wbg_ptr = 0;
45014501- return ptr;
45024502- }
45034503- free() {
45044504- const ptr = this.__destroy_into_raw();
45054505- wasm.__wbg_rawvector_free(ptr);
45064506- }
45074507- /**
45084508- * Creates a new vector filled with zeros.
45094509- * @returns {RawVector}
45104510- */
45114511- static zero() {
45124512- const ret = wasm.rawvector_zero();
45134513- return _RawVector.__wrap(ret);
45144514- }
45154515- /**
45164516- * Creates a new 2D vector from its two components.
45174517- *
45184518- * # Parameters
45194519- * - `x`: the `x` component of this 2D vector.
45204520- * - `y`: the `y` component of this 2D vector.
45214521- * @param {number} x
45224522- * @param {number} y
45234523- */
45244524- constructor(x, y) {
45254525- const ret = wasm.rawvector_new(x, y);
45264526- this.__wbg_ptr = ret >>> 0;
45274527- return this;
45284528- }
45294529- /**
45304530- * The `x` component of this vector.
45314531- * @returns {number}
45324532- */
45334533- get x() {
45344534- const ret = wasm.rawrotation_re(this.__wbg_ptr);
45354535- return ret;
45364536- }
45374537- /**
45384538- * Sets the `x` component of this vector.
45394539- * @param {number} x
45404540- */
45414541- set x(x) {
45424542- wasm.rawvector_set_x(this.__wbg_ptr, x);
45434543- }
45444544- /**
45454545- * The `y` component of this vector.
45464546- * @returns {number}
45474547- */
45484548- get y() {
45494549- const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);
45504550- return ret;
45514551- }
45524552- /**
45534553- * Sets the `y` component of this vector.
45544554- * @param {number} y
45554555- */
45564556- set y(y) {
45574557- wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, y);
45584558- }
45594559- /**
45604560- * Create a new 2D vector from this vector with its components rearranged as `{x, y}`.
45614561- * @returns {RawVector}
45624562- */
45634563- xy() {
45644564- const ret = wasm.rawvector_xy(this.__wbg_ptr);
45654565- return _RawVector.__wrap(ret);
45664566- }
45674567- /**
45684568- * Create a new 2D vector from this vector with its components rearranged as `{y, x}`.
45694569- * @returns {RawVector}
45704570- */
45714571- yx() {
45724572- const ret = wasm.rawvector_yx(this.__wbg_ptr);
45734573- return _RawVector.__wrap(ret);
45744574- }
45754575-};
45764576-45774577-// ../node_modules/@dimforge/rapier2d/rapier_wasm2d.js
45784578-__wbg_set_wasm(wasm2);
45794579-45804580-// ../node_modules/@dimforge/rapier2d/math.js
45814581-var Vector2 = class {
45824582- constructor(x, y) {
45834583- this.x = x;
45844584- this.y = y;
45854585- }
45864586-};
45874587-var VectorOps = class _VectorOps {
45884588- static new(x, y) {
45894589- return new Vector2(x, y);
45904590- }
45914591- static zeros() {
45924592- return _VectorOps.new(0, 0);
45934593- }
45944594- // FIXME: type ram: RawVector?
45954595- static fromRaw(raw) {
45964596- if (!raw)
45974597- return null;
45984598- let res = _VectorOps.new(raw.x, raw.y);
45994599- raw.free();
46004600- return res;
46014601- }
46024602- static intoRaw(v) {
46034603- return new RawVector(v.x, v.y);
46044604- }
46054605- static copy(out, input) {
46064606- out.x = input.x;
46074607- out.y = input.y;
46084608- }
46094609-};
46104610-var RotationOps = class {
46114611- static identity() {
46124612- return 0;
46134613- }
46144614- static fromRaw(raw) {
46154615- if (!raw)
46164616- return null;
46174617- let res = raw.angle;
46184618- raw.free();
46194619- return res;
46204620- }
46214621- static intoRaw(angle) {
46224622- return RawRotation.fromAngle(angle);
46234623- }
46244624-};
46254625-46264626-// ../node_modules/@dimforge/rapier2d/dynamics/rigid_body.js
46274627-var RigidBodyType;
46284628-(function(RigidBodyType2) {
46294629- RigidBodyType2[RigidBodyType2["Dynamic"] = 0] = "Dynamic";
46304630- RigidBodyType2[RigidBodyType2["Fixed"] = 1] = "Fixed";
46314631- RigidBodyType2[RigidBodyType2["KinematicPositionBased"] = 2] = "KinematicPositionBased";
46324632- RigidBodyType2[RigidBodyType2["KinematicVelocityBased"] = 3] = "KinematicVelocityBased";
46334633-})(RigidBodyType || (RigidBodyType = {}));
46344634-var RigidBody = class {
46354635- constructor(rawSet, colliderSet, handle) {
46364636- this.rawSet = rawSet;
46374637- this.colliderSet = colliderSet;
46384638- this.handle = handle;
46394639- }
46404640- /** @internal */
46414641- finalizeDeserialization(colliderSet) {
46424642- this.colliderSet = colliderSet;
46434643- }
46444644- /**
46454645- * Checks if this rigid-body is still valid (i.e. that it has
46464646- * not been deleted from the rigid-body set yet.
46474647- */
46484648- isValid() {
46494649- return this.rawSet.contains(this.handle);
46504650- }
46514651- /**
46524652- * Locks or unlocks the ability of this rigid-body to translate.
46534653- *
46544654- * @param locked - If `true`, this rigid-body will no longer translate due to forces and impulses.
46554655- * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.
46564656- */
46574657- lockTranslations(locked, wakeUp) {
46584658- return this.rawSet.rbLockTranslations(this.handle, locked, wakeUp);
46594659- }
46604660- /**
46614661- * Locks or unlocks the ability of this rigid-body to rotate.
46624662- *
46634663- * @param locked - If `true`, this rigid-body will no longer rotate due to torques and impulses.
46644664- * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.
46654665- */
46664666- lockRotations(locked, wakeUp) {
46674667- return this.rawSet.rbLockRotations(this.handle, locked, wakeUp);
46684668- }
46694669- // #if DIM2
46704670- /**
46714671- * Locks or unlocks the ability of this rigid-body to translation along individual coordinate axes.
46724672- *
46734673- * @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis.
46744674- * @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis.
46754675- * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.
46764676- */
46774677- setEnabledTranslations(enableX, enableY, wakeUp) {
46784678- return this.rawSet.rbSetEnabledTranslations(this.handle, enableX, enableY, wakeUp);
46794679- }
46804680- /**
46814681- * Locks or unlocks the ability of this rigid-body to translation along individual coordinate axes.
46824682- *
46834683- * @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis.
46844684- * @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis.
46854685- * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.
46864686- * @deprecated use `this.setEnabledTranslations` with the same arguments instead.
46874687- */
46884688- restrictTranslations(enableX, enableY, wakeUp) {
46894689- this.setEnabledTranslations(enableX, enableX, wakeUp);
46904690- }
46914691- // #endif
46924692- /**
46934693- * The dominance group, in [-127, +127] this rigid-body is part of.
46944694- */
46954695- dominanceGroup() {
46964696- return this.rawSet.rbDominanceGroup(this.handle);
46974697- }
46984698- /**
46994699- * Sets the dominance group of this rigid-body.
47004700- *
47014701- * @param group - The dominance group of this rigid-body. Must be a signed integer in the range [-127, +127].
47024702- */
47034703- setDominanceGroup(group) {
47044704- this.rawSet.rbSetDominanceGroup(this.handle, group);
47054705- }
47064706- /**
47074707- * The number of additional solver iterations that will be run for this
47084708- * rigid-body and everything that interacts with it directly or indirectly
47094709- * through contacts or joints.
47104710- */
47114711- additionalSolverIterations() {
47124712- return this.rawSet.rbAdditionalSolverIterations(this.handle);
47134713- }
47144714- /**
47154715- * Sets the number of additional solver iterations that will be run for this
47164716- * rigid-body and everything that interacts with it directly or indirectly
47174717- * through contacts or joints.
47184718- *
47194719- * Compared to increasing the global `World.numSolverIteration`, setting this
47204720- * value lets you increase accuracy on only a subset of the scene, resulting in reduced
47214721- * performance loss.
47224722- *
47234723- * @param iters - The new number of additional solver iterations (default: 0).
47244724- */
47254725- setAdditionalSolverIterations(iters) {
47264726- this.rawSet.rbSetAdditionalSolverIterations(this.handle, iters);
47274727- }
47284728- /**
47294729- * Enable or disable CCD (Continuous Collision Detection) for this rigid-body.
47304730- *
47314731- * @param enabled - If `true`, CCD will be enabled for this rigid-body.
47324732- */
47334733- enableCcd(enabled) {
47344734- this.rawSet.rbEnableCcd(this.handle, enabled);
47354735- }
47364736- /**
47374737- * Sets the soft-CCD prediction distance for this rigid-body.
47384738- *
47394739- * See the documentation of `RigidBodyDesc.setSoftCcdPrediction` for
47404740- * additional details.
47414741- */
47424742- setSoftCcdPrediction(distance) {
47434743- this.rawSet.rbSetSoftCcdPrediction(this.handle, distance);
47444744- }
47454745- /**
47464746- * Gets the soft-CCD prediction distance for this rigid-body.
47474747- *
47484748- * See the documentation of `RigidBodyDesc.setSoftCcdPrediction` for
47494749- * additional details.
47504750- */
47514751- softCcdPrediction() {
47524752- return this.rawSet.rbSoftCcdPrediction(this.handle);
47534753- }
47544754- /**
47554755- * The world-space translation of this rigid-body.
47564756- */
47574757- translation() {
47584758- let res = this.rawSet.rbTranslation(this.handle);
47594759- return VectorOps.fromRaw(res);
47604760- }
47614761- /**
47624762- * The world-space orientation of this rigid-body.
47634763- */
47644764- rotation() {
47654765- let res = this.rawSet.rbRotation(this.handle);
47664766- return RotationOps.fromRaw(res);
47674767- }
47684768- /**
47694769- * The world-space next translation of this rigid-body.
47704770- *
47714771- * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation`
47724772- * method and is used for estimating the kinematic body velocity at the next timestep.
47734773- * For non-kinematic bodies, this value is currently unspecified.
47744774- */
47754775- nextTranslation() {
47764776- let res = this.rawSet.rbNextTranslation(this.handle);
47774777- return VectorOps.fromRaw(res);
47784778- }
47794779- /**
47804780- * The world-space next orientation of this rigid-body.
47814781- *
47824782- * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation`
47834783- * method and is used for estimating the kinematic body velocity at the next timestep.
47844784- * For non-kinematic bodies, this value is currently unspecified.
47854785- */
47864786- nextRotation() {
47874787- let res = this.rawSet.rbNextRotation(this.handle);
47884788- return RotationOps.fromRaw(res);
47894789- }
47904790- /**
47914791- * Sets the translation of this rigid-body.
47924792- *
47934793- * @param tra - The world-space position of the rigid-body.
47944794- * @param wakeUp - Forces the rigid-body to wake-up so it is properly affected by forces if it
47954795- * wasn't moving before modifying its position.
47964796- */
47974797- setTranslation(tra, wakeUp) {
47984798- this.rawSet.rbSetTranslation(this.handle, tra.x, tra.y, wakeUp);
47994799- }
48004800- /**
48014801- * Sets the linear velocity of this rigid-body.
48024802- *
48034803- * @param vel - The linear velocity to set.
48044804- * @param wakeUp - Forces the rigid-body to wake-up if it was asleep.
48054805- */
48064806- setLinvel(vel, wakeUp) {
48074807- let rawVel = VectorOps.intoRaw(vel);
48084808- this.rawSet.rbSetLinvel(this.handle, rawVel, wakeUp);
48094809- rawVel.free();
48104810- }
48114811- /**
48124812- * The scale factor applied to the gravity affecting
48134813- * this rigid-body.
48144814- */
48154815- gravityScale() {
48164816- return this.rawSet.rbGravityScale(this.handle);
48174817- }
48184818- /**
48194819- * Sets the scale factor applied to the gravity affecting
48204820- * this rigid-body.
48214821- *
48224822- * @param factor - The scale factor to set. A value of 0.0 means
48234823- * that this rigid-body will on longer be affected by gravity.
48244824- * @param wakeUp - Forces the rigid-body to wake-up if it was asleep.
48254825- */
48264826- setGravityScale(factor, wakeUp) {
48274827- this.rawSet.rbSetGravityScale(this.handle, factor, wakeUp);
48284828- }
48294829- // #if DIM2
48304830- /**
48314831- * Sets the rotation angle of this rigid-body.
48324832- *
48334833- * @param angle - The rotation angle, in radians.
48344834- * @param wakeUp - Forces the rigid-body to wake-up so it is properly affected by forces if it
48354835- * wasn't moving before modifying its position.
48364836- */
48374837- setRotation(angle, wakeUp) {
48384838- this.rawSet.rbSetRotation(this.handle, angle, wakeUp);
48394839- }
48404840- /**
48414841- * Sets the angular velocity fo this rigid-body.
48424842- *
48434843- * @param vel - The angular velocity to set.
48444844- * @param wakeUp - Forces the rigid-body to wake-up if it was asleep.
48454845- */
48464846- setAngvel(vel, wakeUp) {
48474847- this.rawSet.rbSetAngvel(this.handle, vel, wakeUp);
48484848- }
48494849- // #endif
48504850- /**
48514851- * If this rigid body is kinematic, sets its future translation after the next timestep integration.
48524852- *
48534853- * This should be used instead of `rigidBody.setTranslation` to make the dynamic object
48544854- * interacting with this kinematic body behave as expected. Internally, Rapier will compute
48554855- * an artificial velocity for this rigid-body from its current position and its next kinematic
48564856- * position. This velocity will be used to compute forces on dynamic bodies interacting with
48574857- * this body.
48584858- *
48594859- * @param t - The kinematic translation to set.
48604860- */
48614861- setNextKinematicTranslation(t) {
48624862- this.rawSet.rbSetNextKinematicTranslation(this.handle, t.x, t.y);
48634863- }
48644864- // #if DIM2
48654865- /**
48664866- * If this rigid body is kinematic, sets its future rotation after the next timestep integration.
48674867- *
48684868- * This should be used instead of `rigidBody.setRotation` to make the dynamic object
48694869- * interacting with this kinematic body behave as expected. Internally, Rapier will compute
48704870- * an artificial velocity for this rigid-body from its current position and its next kinematic
48714871- * position. This velocity will be used to compute forces on dynamic bodies interacting with
48724872- * this body.
48734873- *
48744874- * @param angle - The kinematic rotation angle, in radians.
48754875- */
48764876- setNextKinematicRotation(angle) {
48774877- this.rawSet.rbSetNextKinematicRotation(this.handle, angle);
48784878- }
48794879- // #endif
48804880- /**
48814881- * The linear velocity of this rigid-body.
48824882- */
48834883- linvel() {
48844884- return VectorOps.fromRaw(this.rawSet.rbLinvel(this.handle));
48854885- }
48864886- // #if DIM2
48874887- /**
48884888- * The angular velocity of this rigid-body.
48894889- */
48904890- angvel() {
48914891- return this.rawSet.rbAngvel(this.handle);
48924892- }
48934893- // #endif
48944894- /**
48954895- * The mass of this rigid-body.
48964896- */
48974897- mass() {
48984898- return this.rawSet.rbMass(this.handle);
48994899- }
49004900- /**
49014901- * The inverse mass taking into account translation locking.
49024902- */
49034903- effectiveInvMass() {
49044904- return VectorOps.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
49054905- }
49064906- /**
49074907- * The inverse of the mass of a rigid-body.
49084908- *
49094909- * If this is zero, the rigid-body is assumed to have infinite mass.
49104910- */
49114911- invMass() {
49124912- return this.rawSet.rbInvMass(this.handle);
49134913- }
49144914- /**
49154915- * The center of mass of a rigid-body expressed in its local-space.
49164916- */
49174917- localCom() {
49184918- return VectorOps.fromRaw(this.rawSet.rbLocalCom(this.handle));
49194919- }
49204920- /**
49214921- * The world-space center of mass of the rigid-body.
49224922- */
49234923- worldCom() {
49244924- return VectorOps.fromRaw(this.rawSet.rbWorldCom(this.handle));
49254925- }
49264926- // #if DIM2
49274927- /**
49284928- * The inverse of the principal angular inertia of the rigid-body.
49294929- *
49304930- * Components set to zero are assumed to be infinite along the corresponding principal axis.
49314931- */
49324932- invPrincipalInertiaSqrt() {
49334933- return this.rawSet.rbInvPrincipalInertiaSqrt(this.handle);
49344934- }
49354935- // #endif
49364936- // #if DIM2
49374937- /**
49384938- * The angular inertia along the principal inertia axes of the rigid-body.
49394939- */
49404940- principalInertia() {
49414941- return this.rawSet.rbPrincipalInertia(this.handle);
49424942- }
49434943- // #endif
49444944- // #if DIM2
49454945- /**
49464946- * The square-root of the world-space inverse angular inertia tensor of the rigid-body,
49474947- * taking into account rotation locking.
49484948- */
49494949- effectiveWorldInvInertiaSqrt() {
49504950- return this.rawSet.rbEffectiveWorldInvInertiaSqrt(this.handle);
49514951- }
49524952- // #endif
49534953- // #if DIM2
49544954- /**
49554955- * The effective world-space angular inertia (that takes the potential rotation locking into account) of
49564956- * this rigid-body.
49574957- */
49584958- effectiveAngularInertia() {
49594959- return this.rawSet.rbEffectiveAngularInertia(this.handle);
49604960- }
49614961- // #endif
49624962- /**
49634963- * Put this rigid body to sleep.
49644964- *
49654965- * A sleeping body no longer moves and is no longer simulated by the physics engine unless
49664966- * it is waken up. It can be woken manually with `this.wakeUp()` or automatically due to
49674967- * external forces like contacts.
49684968- */
49694969- sleep() {
49704970- this.rawSet.rbSleep(this.handle);
49714971- }
49724972- /**
49734973- * Wakes this rigid-body up.
49744974- *
49754975- * A dynamic rigid-body that does not move during several consecutive frames will
49764976- * be put to sleep by the physics engine, i.e., it will stop being simulated in order
49774977- * to avoid useless computations.
49784978- * This methods forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying
49794979- * the position of a dynamic body so that it is properly simulated afterwards.
49804980- */
49814981- wakeUp() {
49824982- this.rawSet.rbWakeUp(this.handle);
49834983- }
49844984- /**
49854985- * Is CCD enabled for this rigid-body?
49864986- */
49874987- isCcdEnabled() {
49884988- return this.rawSet.rbIsCcdEnabled(this.handle);
49894989- }
49904990- /**
49914991- * The number of colliders attached to this rigid-body.
49924992- */
49934993- numColliders() {
49944994- return this.rawSet.rbNumColliders(this.handle);
49954995- }
49964996- /**
49974997- * Retrieves the `i-th` collider attached to this rigid-body.
49984998- *
49994999- * @param i - The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`.
50005000- * This index is **not** the same as the unique identifier of the collider.
50015001- */
50025002- collider(i) {
50035003- return this.colliderSet.get(this.rawSet.rbCollider(this.handle, i));
50045004- }
50055005- /**
50065006- * Sets whether this rigid-body is enabled or not.
50075007- *
50085008- * @param enabled - Set to `false` to disable this rigid-body and all its attached colliders.
50095009- */
50105010- setEnabled(enabled) {
50115011- this.rawSet.rbSetEnabled(this.handle, enabled);
50125012- }
50135013- /**
50145014- * Is this rigid-body enabled?
50155015- */
50165016- isEnabled() {
50175017- return this.rawSet.rbIsEnabled(this.handle);
50185018- }
50195019- /**
50205020- * The status of this rigid-body: static, dynamic, or kinematic.
50215021- */
50225022- bodyType() {
50235023- return this.rawSet.rbBodyType(this.handle);
50245024- }
50255025- /**
50265026- * Set a new status for this rigid-body: static, dynamic, or kinematic.
50275027- */
50285028- setBodyType(type, wakeUp) {
50295029- return this.rawSet.rbSetBodyType(this.handle, type, wakeUp);
50305030- }
50315031- /**
50325032- * Is this rigid-body sleeping?
50335033- */
50345034- isSleeping() {
50355035- return this.rawSet.rbIsSleeping(this.handle);
50365036- }
50375037- /**
50385038- * Is the velocity of this rigid-body not zero?
50395039- */
50405040- isMoving() {
50415041- return this.rawSet.rbIsMoving(this.handle);
50425042- }
50435043- /**
50445044- * Is this rigid-body static?
50455045- */
50465046- isFixed() {
50475047- return this.rawSet.rbIsFixed(this.handle);
50485048- }
50495049- /**
50505050- * Is this rigid-body kinematic?
50515051- */
50525052- isKinematic() {
50535053- return this.rawSet.rbIsKinematic(this.handle);
50545054- }
50555055- /**
50565056- * Is this rigid-body dynamic?
50575057- */
50585058- isDynamic() {
50595059- return this.rawSet.rbIsDynamic(this.handle);
50605060- }
50615061- /**
50625062- * The linear damping coefficient of this rigid-body.
50635063- */
50645064- linearDamping() {
50655065- return this.rawSet.rbLinearDamping(this.handle);
50665066- }
50675067- /**
50685068- * The angular damping coefficient of this rigid-body.
50695069- */
50705070- angularDamping() {
50715071- return this.rawSet.rbAngularDamping(this.handle);
50725072- }
50735073- /**
50745074- * Sets the linear damping factor applied to this rigid-body.
50755075- *
50765076- * @param factor - The damping factor to set.
50775077- */
50785078- setLinearDamping(factor) {
50795079- this.rawSet.rbSetLinearDamping(this.handle, factor);
50805080- }
50815081- /**
50825082- * Recompute the mass-properties of this rigid-bodies based on its currently attached colliders.
50835083- */
50845084- recomputeMassPropertiesFromColliders() {
50855085- this.rawSet.rbRecomputeMassPropertiesFromColliders(this.handle, this.colliderSet.raw);
50865086- }
50875087- /**
50885088- * Sets the rigid-body's additional mass.
50895089- *
50905090- * The total angular inertia of the rigid-body will be scaled automatically based on this additional mass. If this
50915091- * scaling effect isn’t desired, use Self::additional_mass_properties instead of this method.
50925092- *
50935093- * This is only the "additional" mass because the total mass of the rigid-body is equal to the sum of this
50945094- * additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body.
50955095- *
50965096- * That total mass (which includes the attached colliders’ contributions) will be updated at the name physics step,
50975097- * or can be updated manually with `this.recomputeMassPropertiesFromColliders`.
50985098- *
50995099- * This will override any previous additional mass-properties set by `this.setAdditionalMass`,
51005100- * `this.setAdditionalMassProperties`, `RigidBodyDesc::setAdditionalMass`, or
51015101- * `RigidBodyDesc.setAdditionalMassfProperties` for this rigid-body.
51025102- *
51035103- * @param mass - The additional mass to set.
51045104- * @param wakeUp - If `true` then the rigid-body will be woken up if it was put to sleep because it did not move for a while.
51055105- */
51065106- setAdditionalMass(mass, wakeUp) {
51075107- this.rawSet.rbSetAdditionalMass(this.handle, mass, wakeUp);
51085108- }
51095109- // #if DIM2
51105110- /**
51115111- * Sets the rigid-body's additional mass-properties.
51125112- *
51135113- * This is only the "additional" mass-properties because the total mass-properties of the rigid-body is equal to the
51145114- * sum of this additional mass-properties and the mass computed from the colliders (with non-zero densities) attached
51155115- * to this rigid-body.
51165116- *
51175117- * That total mass-properties (which include the attached colliders’ contributions) will be updated at the name
51185118- * physics step, or can be updated manually with `this.recomputeMassPropertiesFromColliders`.
51195119- *
51205120- * This will override any previous mass-properties set by `this.setAdditionalMass`,
51215121- * `this.setAdditionalMassProperties`, `RigidBodyDesc.setAdditionalMass`, or `RigidBodyDesc.setAdditionalMassProperties`
51225122- * for this rigid-body.
51235123- *
51245124- * If `wake_up` is true then the rigid-body will be woken up if it was put to sleep because it did not move for a while.
51255125- */
51265126- setAdditionalMassProperties(mass, centerOfMass, principalAngularInertia, wakeUp) {
51275127- let rawCom = VectorOps.intoRaw(centerOfMass);
51285128- this.rawSet.rbSetAdditionalMassProperties(this.handle, mass, rawCom, principalAngularInertia, wakeUp);
51295129- rawCom.free();
51305130- }
51315131- // #endif
51325132- /**
51335133- * Sets the linear damping factor applied to this rigid-body.
51345134- *
51355135- * @param factor - The damping factor to set.
51365136- */
51375137- setAngularDamping(factor) {
51385138- this.rawSet.rbSetAngularDamping(this.handle, factor);
51395139- }
51405140- /**
51415141- * Resets to zero the user forces (but not torques) applied to this rigid-body.
51425142- *
51435143- * @param wakeUp - should the rigid-body be automatically woken-up?
51445144- */
51455145- resetForces(wakeUp) {
51465146- this.rawSet.rbResetForces(this.handle, wakeUp);
51475147- }
51485148- /**
51495149- * Resets to zero the user torques applied to this rigid-body.
51505150- *
51515151- * @param wakeUp - should the rigid-body be automatically woken-up?
51525152- */
51535153- resetTorques(wakeUp) {
51545154- this.rawSet.rbResetTorques(this.handle, wakeUp);
51555155- }
51565156- /**
51575157- * Adds a force at the center-of-mass of this rigid-body.
51585158- *
51595159- * @param force - the world-space force to add to the rigid-body.
51605160- * @param wakeUp - should the rigid-body be automatically woken-up?
51615161- */
51625162- addForce(force, wakeUp) {
51635163- const rawForce = VectorOps.intoRaw(force);
51645164- this.rawSet.rbAddForce(this.handle, rawForce, wakeUp);
51655165- rawForce.free();
51665166- }
51675167- /**
51685168- * Applies an impulse at the center-of-mass of this rigid-body.
51695169- *
51705170- * @param impulse - the world-space impulse to apply on the rigid-body.
51715171- * @param wakeUp - should the rigid-body be automatically woken-up?
51725172- */
51735173- applyImpulse(impulse, wakeUp) {
51745174- const rawImpulse = VectorOps.intoRaw(impulse);
51755175- this.rawSet.rbApplyImpulse(this.handle, rawImpulse, wakeUp);
51765176- rawImpulse.free();
51775177- }
51785178- // #if DIM2
51795179- /**
51805180- * Adds a torque at the center-of-mass of this rigid-body.
51815181- *
51825182- * @param torque - the torque to add to the rigid-body.
51835183- * @param wakeUp - should the rigid-body be automatically woken-up?
51845184- */
51855185- addTorque(torque, wakeUp) {
51865186- this.rawSet.rbAddTorque(this.handle, torque, wakeUp);
51875187- }
51885188- // #endif
51895189- // #if DIM2
51905190- /**
51915191- * Applies an impulsive torque at the center-of-mass of this rigid-body.
51925192- *
51935193- * @param torqueImpulse - the torque impulse to apply on the rigid-body.
51945194- * @param wakeUp - should the rigid-body be automatically woken-up?
51955195- */
51965196- applyTorqueImpulse(torqueImpulse, wakeUp) {
51975197- this.rawSet.rbApplyTorqueImpulse(this.handle, torqueImpulse, wakeUp);
51985198- }
51995199- // #endif
52005200- /**
52015201- * Adds a force at the given world-space point of this rigid-body.
52025202- *
52035203- * @param force - the world-space force to add to the rigid-body.
52045204- * @param point - the world-space point where the impulse is to be applied on the rigid-body.
52055205- * @param wakeUp - should the rigid-body be automatically woken-up?
52065206- */
52075207- addForceAtPoint(force, point, wakeUp) {
52085208- const rawForce = VectorOps.intoRaw(force);
52095209- const rawPoint = VectorOps.intoRaw(point);
52105210- this.rawSet.rbAddForceAtPoint(this.handle, rawForce, rawPoint, wakeUp);
52115211- rawForce.free();
52125212- rawPoint.free();
52135213- }
52145214- /**
52155215- * Applies an impulse at the given world-space point of this rigid-body.
52165216- *
52175217- * @param impulse - the world-space impulse to apply on the rigid-body.
52185218- * @param point - the world-space point where the impulse is to be applied on the rigid-body.
52195219- * @param wakeUp - should the rigid-body be automatically woken-up?
52205220- */
52215221- applyImpulseAtPoint(impulse, point, wakeUp) {
52225222- const rawImpulse = VectorOps.intoRaw(impulse);
52235223- const rawPoint = VectorOps.intoRaw(point);
52245224- this.rawSet.rbApplyImpulseAtPoint(this.handle, rawImpulse, rawPoint, wakeUp);
52255225- rawImpulse.free();
52265226- rawPoint.free();
52275227- }
52285228-};
52295229-var RigidBodyDesc = class _RigidBodyDesc {
52305230- constructor(status) {
52315231- this.enabled = true;
52325232- this.status = status;
52335233- this.translation = VectorOps.zeros();
52345234- this.rotation = RotationOps.identity();
52355235- this.gravityScale = 1;
52365236- this.linvel = VectorOps.zeros();
52375237- this.mass = 0;
52385238- this.massOnly = false;
52395239- this.centerOfMass = VectorOps.zeros();
52405240- this.translationsEnabledX = true;
52415241- this.translationsEnabledY = true;
52425242- this.angvel = 0;
52435243- this.principalAngularInertia = 0;
52445244- this.rotationsEnabled = true;
52455245- this.linearDamping = 0;
52465246- this.angularDamping = 0;
52475247- this.canSleep = true;
52485248- this.sleeping = false;
52495249- this.ccdEnabled = false;
52505250- this.softCcdPrediction = 0;
52515251- this.dominanceGroup = 0;
52525252- this.additionalSolverIterations = 0;
52535253- }
52545254- /**
52555255- * A rigid-body descriptor used to build a dynamic rigid-body.
52565256- */
52575257- static dynamic() {
52585258- return new _RigidBodyDesc(RigidBodyType.Dynamic);
52595259- }
52605260- /**
52615261- * A rigid-body descriptor used to build a position-based kinematic rigid-body.
52625262- */
52635263- static kinematicPositionBased() {
52645264- return new _RigidBodyDesc(RigidBodyType.KinematicPositionBased);
52655265- }
52665266- /**
52675267- * A rigid-body descriptor used to build a velocity-based kinematic rigid-body.
52685268- */
52695269- static kinematicVelocityBased() {
52705270- return new _RigidBodyDesc(RigidBodyType.KinematicVelocityBased);
52715271- }
52725272- /**
52735273- * A rigid-body descriptor used to build a fixed rigid-body.
52745274- */
52755275- static fixed() {
52765276- return new _RigidBodyDesc(RigidBodyType.Fixed);
52775277- }
52785278- /**
52795279- * A rigid-body descriptor used to build a dynamic rigid-body.
52805280- *
52815281- * @deprecated The method has been renamed to `.dynamic()`.
52825282- */
52835283- static newDynamic() {
52845284- return new _RigidBodyDesc(RigidBodyType.Dynamic);
52855285- }
52865286- /**
52875287- * A rigid-body descriptor used to build a position-based kinematic rigid-body.
52885288- *
52895289- * @deprecated The method has been renamed to `.kinematicPositionBased()`.
52905290- */
52915291- static newKinematicPositionBased() {
52925292- return new _RigidBodyDesc(RigidBodyType.KinematicPositionBased);
52935293- }
52945294- /**
52955295- * A rigid-body descriptor used to build a velocity-based kinematic rigid-body.
52965296- *
52975297- * @deprecated The method has been renamed to `.kinematicVelocityBased()`.
52985298- */
52995299- static newKinematicVelocityBased() {
53005300- return new _RigidBodyDesc(RigidBodyType.KinematicVelocityBased);
53015301- }
53025302- /**
53035303- * A rigid-body descriptor used to build a fixed rigid-body.
53045304- *
53055305- * @deprecated The method has been renamed to `.fixed()`.
53065306- */
53075307- static newStatic() {
53085308- return new _RigidBodyDesc(RigidBodyType.Fixed);
53095309- }
53105310- setDominanceGroup(group) {
53115311- this.dominanceGroup = group;
53125312- return this;
53135313- }
53145314- /**
53155315- * Sets the number of additional solver iterations that will be run for this
53165316- * rigid-body and everything that interacts with it directly or indirectly
53175317- * through contacts or joints.
53185318- *
53195319- * Compared to increasing the global `World.numSolverIteration`, setting this
53205320- * value lets you increase accuracy on only a subset of the scene, resulting in reduced
53215321- * performance loss.
53225322- *
53235323- * @param iters - The new number of additional solver iterations (default: 0).
53245324- */
53255325- setAdditionalSolverIterations(iters) {
53265326- this.additionalSolverIterations = iters;
53275327- return this;
53285328- }
53295329- /**
53305330- * Sets whether the created rigid-body will be enabled or disabled.
53315331- * @param enabled − If set to `false` the rigid-body will be disabled at creation.
53325332- */
53335333- setEnabled(enabled) {
53345334- this.enabled = enabled;
53355335- return this;
53365336- }
53375337- // #if DIM2
53385338- /**
53395339- * Sets the initial translation of the rigid-body to create.
53405340- */
53415341- setTranslation(x, y) {
53425342- if (typeof x != "number" || typeof y != "number")
53435343- throw TypeError("The translation components must be numbers.");
53445344- this.translation = { x, y };
53455345- return this;
53465346- }
53475347- // #endif
53485348- /**
53495349- * Sets the initial rotation of the rigid-body to create.
53505350- *
53515351- * @param rot - The rotation to set.
53525352- */
53535353- setRotation(rot) {
53545354- this.rotation = rot;
53555355- return this;
53565356- }
53575357- /**
53585358- * Sets the scale factor applied to the gravity affecting
53595359- * the rigid-body being built.
53605360- *
53615361- * @param scale - The scale factor. Set this to `0.0` if the rigid-body
53625362- * needs to ignore gravity.
53635363- */
53645364- setGravityScale(scale) {
53655365- this.gravityScale = scale;
53665366- return this;
53675367- }
53685368- /**
53695369- * Sets the initial mass of the rigid-body being built, before adding colliders' contributions.
53705370- *
53715371- * @param mass − The initial mass of the rigid-body to create.
53725372- */
53735373- setAdditionalMass(mass) {
53745374- this.mass = mass;
53755375- this.massOnly = true;
53765376- return this;
53775377- }
53785378- // #if DIM2
53795379- /**
53805380- * Sets the initial linear velocity of the rigid-body to create.
53815381- *
53825382- * @param x - The linear velocity to set along the `x` axis.
53835383- * @param y - The linear velocity to set along the `y` axis.
53845384- */
53855385- setLinvel(x, y) {
53865386- if (typeof x != "number" || typeof y != "number")
53875387- throw TypeError("The linvel components must be numbers.");
53885388- this.linvel = { x, y };
53895389- return this;
53905390- }
53915391- /**
53925392- * Sets the initial angular velocity of the rigid-body to create.
53935393- *
53945394- * @param vel - The angular velocity to set.
53955395- */
53965396- setAngvel(vel) {
53975397- this.angvel = vel;
53985398- return this;
53995399- }
54005400- /**
54015401- * Sets the mass properties of the rigid-body being built.
54025402- *
54035403- * Note that the final mass properties of the rigid-bodies depends
54045404- * on the initial mass-properties of the rigid-body (set by this method)
54055405- * to which is added the contributions of all the colliders with non-zero density
54065406- * attached to this rigid-body.
54075407- *
54085408- * Therefore, if you want your provided mass properties to be the final
54095409- * mass properties of your rigid-body, don't attach colliders to it, or
54105410- * only attach colliders with densities equal to zero.
54115411- *
54125412- * @param mass − The initial mass of the rigid-body to create.
54135413- * @param centerOfMass − The initial center-of-mass of the rigid-body to create.
54145414- * @param principalAngularInertia − The initial principal angular inertia of the rigid-body to create.
54155415- */
54165416- setAdditionalMassProperties(mass, centerOfMass, principalAngularInertia) {
54175417- this.mass = mass;
54185418- VectorOps.copy(this.centerOfMass, centerOfMass);
54195419- this.principalAngularInertia = principalAngularInertia;
54205420- this.massOnly = false;
54215421- return this;
54225422- }
54235423- /**
54245424- * Allow translation of this rigid-body only along specific axes.
54255425- * @param translationsEnabledX - Are translations along the X axis enabled?
54265426- * @param translationsEnabledY - Are translations along the y axis enabled?
54275427- */
54285428- enabledTranslations(translationsEnabledX, translationsEnabledY) {
54295429- this.translationsEnabledX = translationsEnabledX;
54305430- this.translationsEnabledY = translationsEnabledY;
54315431- return this;
54325432- }
54335433- /**
54345434- * Allow translation of this rigid-body only along specific axes.
54355435- * @param translationsEnabledX - Are translations along the X axis enabled?
54365436- * @param translationsEnabledY - Are translations along the y axis enabled?
54375437- * @deprecated use `this.enabledTranslations` with the same arguments instead.
54385438- */
54395439- restrictTranslations(translationsEnabledX, translationsEnabledY) {
54405440- return this.enabledTranslations(translationsEnabledX, translationsEnabledY);
54415441- }
54425442- /**
54435443- * Locks all translations that would have resulted from forces on
54445444- * the created rigid-body.
54455445- */
54465446- lockTranslations() {
54475447- return this.restrictTranslations(false, false);
54485448- }
54495449- /**
54505450- * Locks all rotations that would have resulted from forces on
54515451- * the created rigid-body.
54525452- */
54535453- lockRotations() {
54545454- this.rotationsEnabled = false;
54555455- return this;
54565456- }
54575457- // #endif
54585458- /**
54595459- * Sets the linear damping of the rigid-body to create.
54605460- *
54615461- * This will progressively slowdown the translational movement of the rigid-body.
54625462- *
54635463- * @param damping - The angular damping coefficient. Should be >= 0. The higher this
54645464- * value is, the stronger the translational slowdown will be.
54655465- */
54665466- setLinearDamping(damping) {
54675467- this.linearDamping = damping;
54685468- return this;
54695469- }
54705470- /**
54715471- * Sets the angular damping of the rigid-body to create.
54725472- *
54735473- * This will progressively slowdown the rotational movement of the rigid-body.
54745474- *
54755475- * @param damping - The angular damping coefficient. Should be >= 0. The higher this
54765476- * value is, the stronger the rotational slowdown will be.
54775477- */
54785478- setAngularDamping(damping) {
54795479- this.angularDamping = damping;
54805480- return this;
54815481- }
54825482- /**
54835483- * Sets whether or not the rigid-body to create can sleep.
54845484- *
54855485- * @param can - true if the rigid-body can sleep, false if it can't.
54865486- */
54875487- setCanSleep(can) {
54885488- this.canSleep = can;
54895489- return this;
54905490- }
54915491- /**
54925492- * Sets whether or not the rigid-body is to be created asleep.
54935493- *
54945494- * @param can - true if the rigid-body should be in sleep, default false.
54955495- */
54965496- setSleeping(sleeping) {
54975497- this.sleeping = sleeping;
54985498- return this;
54995499- }
55005500- /**
55015501- * Sets whether Continuous Collision Detection (CCD) is enabled for this rigid-body.
55025502- *
55035503- * @param enabled - true if the rigid-body has CCD enabled.
55045504- */
55055505- setCcdEnabled(enabled) {
55065506- this.ccdEnabled = enabled;
55075507- return this;
55085508- }
55095509- /**
55105510- * Sets the maximum prediction distance Soft Continuous Collision-Detection.
55115511- *
55125512- * When set to 0, soft-CCD is disabled. Soft-CCD helps prevent tunneling especially of
55135513- * slow-but-thin to moderately fast objects. The soft CCD prediction distance indicates how
55145514- * far in the object’s path the CCD algorithm is allowed to inspect. Large values can impact
55155515- * performance badly by increasing the work needed from the broad-phase.
55165516- *
55175517- * It is a generally cheaper variant of regular CCD (that can be enabled with
55185518- * `RigidBodyDesc::setCcdEnabled` since it relies on predictive constraints instead of
55195519- * shape-cast and substeps.
55205520- */
55215521- setSoftCcdPrediction(distance) {
55225522- this.softCcdPrediction = distance;
55235523- return this;
55245524- }
55255525- /**
55265526- * Sets the user-defined object of this rigid-body.
55275527- *
55285528- * @param userData - The user-defined object to set.
55295529- */
55305530- setUserData(data) {
55315531- this.userData = data;
55325532- return this;
55335533- }
55345534-};
55355535-55365536-// ../node_modules/@dimforge/rapier2d/coarena.js
55375537-var Coarena = class {
55385538- constructor() {
55395539- this.fconv = new Float64Array(1);
55405540- this.uconv = new Uint32Array(this.fconv.buffer);
55415541- this.data = new Array();
55425542- this.size = 0;
55435543- }
55445544- set(handle, data) {
55455545- let i = this.index(handle);
55465546- while (this.data.length <= i) {
55475547- this.data.push(null);
55485548- }
55495549- if (this.data[i] == null)
55505550- this.size += 1;
55515551- this.data[i] = data;
55525552- }
55535553- len() {
55545554- return this.size;
55555555- }
55565556- delete(handle) {
55575557- let i = this.index(handle);
55585558- if (i < this.data.length) {
55595559- if (this.data[i] != null)
55605560- this.size -= 1;
55615561- this.data[i] = null;
55625562- }
55635563- }
55645564- clear() {
55655565- this.data = new Array();
55665566- }
55675567- get(handle) {
55685568- let i = this.index(handle);
55695569- if (i < this.data.length) {
55705570- return this.data[i];
55715571- } else {
55725572- return null;
55735573- }
55745574- }
55755575- forEach(f) {
55765576- for (const elt of this.data) {
55775577- if (elt != null)
55785578- f(elt);
55795579- }
55805580- }
55815581- getAll() {
55825582- return this.data.filter((elt) => elt != null);
55835583- }
55845584- index(handle) {
55855585- this.fconv[0] = handle;
55865586- return this.uconv[0];
55875587- }
55885588-};
55895589-55905590-// ../node_modules/@dimforge/rapier2d/dynamics/rigid_body_set.js
55915591-var RigidBodySet = class {
55925592- constructor(raw) {
55935593- this.raw = raw || new RawRigidBodySet();
55945594- this.map = new Coarena();
55955595- if (raw) {
55965596- raw.forEachRigidBodyHandle((handle) => {
55975597- this.map.set(handle, new RigidBody(raw, null, handle));
55985598- });
55995599- }
56005600- }
56015601- /**
56025602- * Release the WASM memory occupied by this rigid-body set.
56035603- */
56045604- free() {
56055605- if (!!this.raw) {
56065606- this.raw.free();
56075607- }
56085608- this.raw = void 0;
56095609- if (!!this.map) {
56105610- this.map.clear();
56115611- }
56125612- this.map = void 0;
56135613- }
56145614- /**
56155615- * Internal method, do not call this explicitly.
56165616- */
56175617- finalizeDeserialization(colliderSet) {
56185618- this.map.forEach((rb) => rb.finalizeDeserialization(colliderSet));
56195619- }
56205620- /**
56215621- * Creates a new rigid-body and return its integer handle.
56225622- *
56235623- * @param desc - The description of the rigid-body to create.
56245624- */
56255625- createRigidBody(colliderSet, desc) {
56265626- let rawTra = VectorOps.intoRaw(desc.translation);
56275627- let rawRot = RotationOps.intoRaw(desc.rotation);
56285628- let rawLv = VectorOps.intoRaw(desc.linvel);
56295629- let rawCom = VectorOps.intoRaw(desc.centerOfMass);
56305630- let handle = this.raw.createRigidBody(
56315631- desc.enabled,
56325632- rawTra,
56335633- rawRot,
56345634- desc.gravityScale,
56355635- desc.mass,
56365636- desc.massOnly,
56375637- rawCom,
56385638- rawLv,
56395639- // #if DIM2
56405640- desc.angvel,
56415641- desc.principalAngularInertia,
56425642- desc.translationsEnabledX,
56435643- desc.translationsEnabledY,
56445644- desc.rotationsEnabled,
56455645- // #endif
56465646- desc.linearDamping,
56475647- desc.angularDamping,
56485648- desc.status,
56495649- desc.canSleep,
56505650- desc.sleeping,
56515651- desc.softCcdPrediction,
56525652- desc.ccdEnabled,
56535653- desc.dominanceGroup,
56545654- desc.additionalSolverIterations
56555655- );
56565656- rawTra.free();
56575657- rawRot.free();
56585658- rawLv.free();
56595659- rawCom.free();
56605660- const body = new RigidBody(this.raw, colliderSet, handle);
56615661- body.userData = desc.userData;
56625662- this.map.set(handle, body);
56635663- return body;
56645664- }
56655665- /**
56665666- * Removes a rigid-body from this set.
56675667- *
56685668- * This will also remove all the colliders and joints attached to the rigid-body.
56695669- *
56705670- * @param handle - The integer handle of the rigid-body to remove.
56715671- * @param colliders - The set of colliders that may contain colliders attached to the removed rigid-body.
56725672- * @param impulseJoints - The set of impulse joints that may contain joints attached to the removed rigid-body.
56735673- * @param multibodyJoints - The set of multibody joints that may contain joints attached to the removed rigid-body.
56745674- */
56755675- remove(handle, islands, colliders, impulseJoints, multibodyJoints) {
56765676- for (let i = 0; i < this.raw.rbNumColliders(handle); i += 1) {
56775677- colliders.unmap(this.raw.rbCollider(handle, i));
56785678- }
56795679- impulseJoints.forEachJointHandleAttachedToRigidBody(handle, (handle2) => impulseJoints.unmap(handle2));
56805680- multibodyJoints.forEachJointHandleAttachedToRigidBody(handle, (handle2) => multibodyJoints.unmap(handle2));
56815681- this.raw.remove(handle, islands.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw);
56825682- this.map.delete(handle);
56835683- }
56845684- /**
56855685- * The number of rigid-bodies on this set.
56865686- */
56875687- len() {
56885688- return this.map.len();
56895689- }
56905690- /**
56915691- * Does this set contain a rigid-body with the given handle?
56925692- *
56935693- * @param handle - The rigid-body handle to check.
56945694- */
56955695- contains(handle) {
56965696- return this.get(handle) != null;
56975697- }
56985698- /**
56995699- * Gets the rigid-body with the given handle.
57005700- *
57015701- * @param handle - The handle of the rigid-body to retrieve.
57025702- */
57035703- get(handle) {
57045704- return this.map.get(handle);
57055705- }
57065706- /**
57075707- * Applies the given closure to each rigid-body contained by this set.
57085708- *
57095709- * @param f - The closure to apply.
57105710- */
57115711- forEach(f) {
57125712- this.map.forEach(f);
57135713- }
57145714- /**
57155715- * Applies the given closure to each active rigid-bodies contained by this set.
57165716- *
57175717- * A rigid-body is active if it is not sleeping, i.e., if it moved recently.
57185718- *
57195719- * @param f - The closure to apply.
57205720- */
57215721- forEachActiveRigidBody(islands, f) {
57225722- islands.forEachActiveRigidBodyHandle((handle) => {
57235723- f(this.get(handle));
57245724- });
57255725- }
57265726- /**
57275727- * Gets all rigid-bodies in the list.
57285728- *
57295729- * @returns rigid-bodies list.
57305730- */
57315731- getAll() {
57325732- return this.map.getAll();
57335733- }
57345734-};
57355735-57365736-// ../node_modules/@dimforge/rapier2d/dynamics/integration_parameters.js
57375737-var IntegrationParameters = class {
57385738- constructor(raw) {
57395739- this.raw = raw || new RawIntegrationParameters();
57405740- }
57415741- /**
57425742- * Free the WASM memory used by these integration parameters.
57435743- */
57445744- free() {
57455745- if (!!this.raw) {
57465746- this.raw.free();
57475747- }
57485748- this.raw = void 0;
57495749- }
57505750- /**
57515751- * The timestep length (default: `1.0 / 60.0`)
57525752- */
57535753- get dt() {
57545754- return this.raw.dt;
57555755- }
57565756- /**
57575757- * The Error Reduction Parameter in `[0, 1]` is the proportion of
57585758- * the positional error to be corrected at each time step (default: `0.2`).
57595759- */
57605760- get erp() {
57615761- return this.raw.erp;
57625762- }
57635763- get lengthUnit() {
57645764- return this.raw.lengthUnit;
57655765- }
57665766- /**
57675767- * Normalized amount of penetration the engine won’t attempt to correct (default: `0.001m`).
57685768- *
57695769- * This threshold considered by the physics engine is this value multiplied by the `lengthUnit`.
57705770- */
57715771- get normalizedAllowedLinearError() {
57725772- return this.raw.normalizedAllowedLinearError;
57735773- }
57745774- /**
57755775- * The maximal normalized distance separating two objects that will generate predictive contacts (default: `0.002`).
57765776- *
57775777- * This threshold considered by the physics engine is this value multiplied by the `lengthUnit`.
57785778- */
57795779- get normalizedPredictionDistance() {
57805780- return this.raw.normalizedPredictionDistance;
57815781- }
57825782- /**
57835783- * The number of solver iterations run by the constraints solver for calculating forces (default: `4`).
57845784- */
57855785- get numSolverIterations() {
57865786- return this.raw.numSolverIterations;
57875787- }
57885788- /**
57895789- * Number of addition friction resolution iteration run during the last solver sub-step (default: `4`).
57905790- */
57915791- get numAdditionalFrictionIterations() {
57925792- return this.raw.numAdditionalFrictionIterations;
57935793- }
57945794- /**
57955795- * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).
57965796- */
57975797- get numInternalPgsIterations() {
57985798- return this.raw.numInternalPgsIterations;
57995799- }
58005800- /**
58015801- * Minimum number of dynamic bodies in each active island (default: `128`).
58025802- */
58035803- get minIslandSize() {
58045804- return this.raw.minIslandSize;
58055805- }
58065806- /**
58075807- * Maximum number of substeps performed by the solver (default: `1`).
58085808- */
58095809- get maxCcdSubsteps() {
58105810- return this.raw.maxCcdSubsteps;
58115811- }
58125812- set dt(value) {
58135813- this.raw.dt = value;
58145814- }
58155815- set erp(value) {
58165816- this.raw.erp = value;
58175817- }
58185818- set lengthUnit(value) {
58195819- this.raw.lengthUnit = value;
58205820- }
58215821- set normalizedAllowedLinearError(value) {
58225822- this.raw.normalizedAllowedLinearError = value;
58235823- }
58245824- set normalizedPredictionDistance(value) {
58255825- this.raw.normalizedPredictionDistance = value;
58265826- }
58275827- /**
58285828- * Sets the number of solver iterations run by the constraints solver for calculating forces (default: `4`).
58295829- */
58305830- set numSolverIterations(value) {
58315831- this.raw.numSolverIterations = value;
58325832- }
58335833- /**
58345834- * Sets the number of addition friction resolution iteration run during the last solver sub-step (default: `4`).
58355835- */
58365836- set numAdditionalFrictionIterations(value) {
58375837- this.raw.numAdditionalFrictionIterations = value;
58385838- }
58395839- /**
58405840- * Sets the number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).
58415841- */
58425842- set numInternalPgsIterations(value) {
58435843- this.raw.numInternalPgsIterations = value;
58445844- }
58455845- set minIslandSize(value) {
58465846- this.raw.minIslandSize = value;
58475847- }
58485848- set maxCcdSubsteps(value) {
58495849- this.raw.maxCcdSubsteps = value;
58505850- }
58515851- switchToStandardPgsSolver() {
58525852- this.raw.switchToStandardPgsSolver();
58535853- }
58545854- switchToSmallStepsPgsSolver() {
58555855- this.raw.switchToSmallStepsPgsSolver();
58565856- }
58575857- switchToSmallStepsPgsSolverWithoutWarmstart() {
58585858- this.raw.switchToSmallStepsPgsSolverWithoutWarmstart();
58595859- }
58605860-};
58615861-58625862-// ../node_modules/@dimforge/rapier2d/dynamics/impulse_joint.js
58635863-var JointType;
58645864-(function(JointType2) {
58655865- JointType2[JointType2["Revolute"] = 0] = "Revolute";
58665866- JointType2[JointType2["Fixed"] = 1] = "Fixed";
58675867- JointType2[JointType2["Prismatic"] = 2] = "Prismatic";
58685868- JointType2[JointType2["Rope"] = 3] = "Rope";
58695869- JointType2[JointType2["Spring"] = 4] = "Spring";
58705870-})(JointType || (JointType = {}));
58715871-var MotorModel;
58725872-(function(MotorModel2) {
58735873- MotorModel2[MotorModel2["AccelerationBased"] = 0] = "AccelerationBased";
58745874- MotorModel2[MotorModel2["ForceBased"] = 1] = "ForceBased";
58755875-})(MotorModel || (MotorModel = {}));
58765876-var JointAxesMask;
58775877-(function(JointAxesMask2) {
58785878- JointAxesMask2[JointAxesMask2["X"] = 1] = "X";
58795879- JointAxesMask2[JointAxesMask2["Y"] = 2] = "Y";
58805880- JointAxesMask2[JointAxesMask2["Z"] = 4] = "Z";
58815881- JointAxesMask2[JointAxesMask2["AngX"] = 8] = "AngX";
58825882- JointAxesMask2[JointAxesMask2["AngY"] = 16] = "AngY";
58835883- JointAxesMask2[JointAxesMask2["AngZ"] = 32] = "AngZ";
58845884-})(JointAxesMask || (JointAxesMask = {}));
58855885-var ImpulseJoint = class _ImpulseJoint {
58865886- constructor(rawSet, bodySet, handle) {
58875887- this.rawSet = rawSet;
58885888- this.bodySet = bodySet;
58895889- this.handle = handle;
58905890- }
58915891- static newTyped(rawSet, bodySet, handle) {
58925892- switch (rawSet.jointType(handle)) {
58935893- case RawJointType.Revolute:
58945894- return new RevoluteImpulseJoint(rawSet, bodySet, handle);
58955895- case RawJointType.Prismatic:
58965896- return new PrismaticImpulseJoint(rawSet, bodySet, handle);
58975897- case RawJointType.Fixed:
58985898- return new FixedImpulseJoint(rawSet, bodySet, handle);
58995899- case RawJointType.Spring:
59005900- return new SpringImpulseJoint(rawSet, bodySet, handle);
59015901- case RawJointType.Rope:
59025902- return new RopeImpulseJoint(rawSet, bodySet, handle);
59035903- default:
59045904- return new _ImpulseJoint(rawSet, bodySet, handle);
59055905- }
59065906- }
59075907- /** @internal */
59085908- finalizeDeserialization(bodySet) {
59095909- this.bodySet = bodySet;
59105910- }
59115911- /**
59125912- * Checks if this joint is still valid (i.e. that it has
59135913- * not been deleted from the joint set yet).
59145914- */
59155915- isValid() {
59165916- return this.rawSet.contains(this.handle);
59175917- }
59185918- /**
59195919- * The first rigid-body this joint it attached to.
59205920- */
59215921- body1() {
59225922- return this.bodySet.get(this.rawSet.jointBodyHandle1(this.handle));
59235923- }
59245924- /**
59255925- * The second rigid-body this joint is attached to.
59265926- */
59275927- body2() {
59285928- return this.bodySet.get(this.rawSet.jointBodyHandle2(this.handle));
59295929- }
59305930- /**
59315931- * The type of this joint given as a string.
59325932- */
59335933- type() {
59345934- return this.rawSet.jointType(this.handle);
59355935- }
59365936- /**
59375937- * The position of the first anchor of this joint.
59385938- *
59395939- * The first anchor gives the position of the application point on the
59405940- * local frame of the first rigid-body it is attached to.
59415941- */
59425942- anchor1() {
59435943- return VectorOps.fromRaw(this.rawSet.jointAnchor1(this.handle));
59445944- }
59455945- /**
59465946- * The position of the second anchor of this joint.
59475947- *
59485948- * The second anchor gives the position of the application point on the
59495949- * local frame of the second rigid-body it is attached to.
59505950- */
59515951- anchor2() {
59525952- return VectorOps.fromRaw(this.rawSet.jointAnchor2(this.handle));
59535953- }
59545954- /**
59555955- * Sets the position of the first anchor of this joint.
59565956- *
59575957- * The first anchor gives the position of the application point on the
59585958- * local frame of the first rigid-body it is attached to.
59595959- */
59605960- setAnchor1(newPos) {
59615961- const rawPoint = VectorOps.intoRaw(newPos);
59625962- this.rawSet.jointSetAnchor1(this.handle, rawPoint);
59635963- rawPoint.free();
59645964- }
59655965- /**
59665966- * Sets the position of the second anchor of this joint.
59675967- *
59685968- * The second anchor gives the position of the application point on the
59695969- * local frame of the second rigid-body it is attached to.
59705970- */
59715971- setAnchor2(newPos) {
59725972- const rawPoint = VectorOps.intoRaw(newPos);
59735973- this.rawSet.jointSetAnchor2(this.handle, rawPoint);
59745974- rawPoint.free();
59755975- }
59765976- /**
59775977- * Controls whether contacts are computed between colliders attached
59785978- * to the rigid-bodies linked by this joint.
59795979- */
59805980- setContactsEnabled(enabled) {
59815981- this.rawSet.jointSetContactsEnabled(this.handle, enabled);
59825982- }
59835983- /**
59845984- * Indicates if contacts are enabled between colliders attached
59855985- * to the rigid-bodies linked by this joint.
59865986- */
59875987- contactsEnabled() {
59885988- return this.rawSet.jointContactsEnabled(this.handle);
59895989- }
59905990-};
59915991-var UnitImpulseJoint = class extends ImpulseJoint {
59925992- /**
59935993- * Are the limits enabled for this joint?
59945994- */
59955995- limitsEnabled() {
59965996- return this.rawSet.jointLimitsEnabled(this.handle, this.rawAxis());
59975997- }
59985998- /**
59995999- * The min limit of this joint.
60006000- */
60016001- limitsMin() {
60026002- return this.rawSet.jointLimitsMin(this.handle, this.rawAxis());
60036003- }
60046004- /**
60056005- * The max limit of this joint.
60066006- */
60076007- limitsMax() {
60086008- return this.rawSet.jointLimitsMax(this.handle, this.rawAxis());
60096009- }
60106010- /**
60116011- * Sets the limits of this joint.
60126012- *
60136013- * @param min - The minimum bound of this joint’s free coordinate.
60146014- * @param max - The maximum bound of this joint’s free coordinate.
60156015- */
60166016- setLimits(min, max) {
60176017- this.rawSet.jointSetLimits(this.handle, this.rawAxis(), min, max);
60186018- }
60196019- configureMotorModel(model) {
60206020- this.rawSet.jointConfigureMotorModel(this.handle, this.rawAxis(), model);
60216021- }
60226022- configureMotorVelocity(targetVel, factor) {
60236023- this.rawSet.jointConfigureMotorVelocity(this.handle, this.rawAxis(), targetVel, factor);
60246024- }
60256025- configureMotorPosition(targetPos, stiffness, damping) {
60266026- this.rawSet.jointConfigureMotorPosition(this.handle, this.rawAxis(), targetPos, stiffness, damping);
60276027- }
60286028- configureMotor(targetPos, targetVel, stiffness, damping) {
60296029- this.rawSet.jointConfigureMotor(this.handle, this.rawAxis(), targetPos, targetVel, stiffness, damping);
60306030- }
60316031-};
60326032-var FixedImpulseJoint = class extends ImpulseJoint {
60336033-};
60346034-var RopeImpulseJoint = class extends ImpulseJoint {
60356035-};
60366036-var SpringImpulseJoint = class extends ImpulseJoint {
60376037-};
60386038-var PrismaticImpulseJoint = class extends UnitImpulseJoint {
60396039- rawAxis() {
60406040- return RawJointAxis.X;
60416041- }
60426042-};
60436043-var RevoluteImpulseJoint = class extends UnitImpulseJoint {
60446044- rawAxis() {
60456045- return RawJointAxis.AngX;
60466046- }
60476047-};
60486048-var JointData = class _JointData {
60496049- constructor() {
60506050- }
60516051- /**
60526052- * Creates a new joint descriptor that builds a Fixed joint.
60536053- *
60546054- * A fixed joint removes all the degrees of freedom between the affected bodies, ensuring their
60556055- * anchor and local frames coincide in world-space.
60566056- *
60576057- * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the
60586058- * local-space of the rigid-body.
60596059- * @param frame1 - The reference orientation of the joint wrt. the first rigid-body.
60606060- * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the
60616061- * local-space of the rigid-body.
60626062- * @param frame2 - The reference orientation of the joint wrt. the second rigid-body.
60636063- */
60646064- static fixed(anchor1, frame1, anchor2, frame2) {
60656065- let res = new _JointData();
60666066- res.anchor1 = anchor1;
60676067- res.anchor2 = anchor2;
60686068- res.frame1 = frame1;
60696069- res.frame2 = frame2;
60706070- res.jointType = JointType.Fixed;
60716071- return res;
60726072- }
60736073- static spring(rest_length, stiffness, damping, anchor1, anchor2) {
60746074- let res = new _JointData();
60756075- res.anchor1 = anchor1;
60766076- res.anchor2 = anchor2;
60776077- res.length = rest_length;
60786078- res.stiffness = stiffness;
60796079- res.damping = damping;
60806080- res.jointType = JointType.Spring;
60816081- return res;
60826082- }
60836083- static rope(length, anchor1, anchor2) {
60846084- let res = new _JointData();
60856085- res.anchor1 = anchor1;
60866086- res.anchor2 = anchor2;
60876087- res.length = length;
60886088- res.jointType = JointType.Rope;
60896089- return res;
60906090- }
60916091- // #if DIM2
60926092- /**
60936093- * Create a new joint descriptor that builds revolute joints.
60946094- *
60956095- * A revolute joint allows three relative rotational degrees of freedom
60966096- * by preventing any relative translation between the anchors of the
60976097- * two attached rigid-bodies.
60986098- *
60996099- * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the
61006100- * local-space of the rigid-body.
61016101- * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the
61026102- * local-space of the rigid-body.
61036103- */
61046104- static revolute(anchor1, anchor2) {
61056105- let res = new _JointData();
61066106- res.anchor1 = anchor1;
61076107- res.anchor2 = anchor2;
61086108- res.jointType = JointType.Revolute;
61096109- return res;
61106110- }
61116111- /**
61126112- * Creates a new joint descriptor that builds a Prismatic joint.
61136113- *
61146114- * A prismatic joint removes all the degrees of freedom between the
61156115- * affected bodies, except for the translation along one axis.
61166116- *
61176117- * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the
61186118- * local-space of the rigid-body.
61196119- * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the
61206120- * local-space of the rigid-body.
61216121- * @param axis - Axis of the joint, expressed in the local-space of the rigid-bodies it is attached to.
61226122- */
61236123- static prismatic(anchor1, anchor2, axis) {
61246124- let res = new _JointData();
61256125- res.anchor1 = anchor1;
61266126- res.anchor2 = anchor2;
61276127- res.axis = axis;
61286128- res.jointType = JointType.Prismatic;
61296129- return res;
61306130- }
61316131- // #endif
61326132- intoRaw() {
61336133- let rawA1 = VectorOps.intoRaw(this.anchor1);
61346134- let rawA2 = VectorOps.intoRaw(this.anchor2);
61356135- let rawAx;
61366136- let result;
61376137- let limitsEnabled = false;
61386138- let limitsMin = 0;
61396139- let limitsMax = 0;
61406140- switch (this.jointType) {
61416141- case JointType.Fixed:
61426142- let rawFra1 = RotationOps.intoRaw(this.frame1);
61436143- let rawFra2 = RotationOps.intoRaw(this.frame2);
61446144- result = RawGenericJoint.fixed(rawA1, rawFra1, rawA2, rawFra2);
61456145- rawFra1.free();
61466146- rawFra2.free();
61476147- break;
61486148- case JointType.Spring:
61496149- result = RawGenericJoint.spring(this.length, this.stiffness, this.damping, rawA1, rawA2);
61506150- break;
61516151- case JointType.Rope:
61526152- result = RawGenericJoint.rope(this.length, rawA1, rawA2);
61536153- break;
61546154- case JointType.Prismatic:
61556155- rawAx = VectorOps.intoRaw(this.axis);
61566156- if (!!this.limitsEnabled) {
61576157- limitsEnabled = true;
61586158- limitsMin = this.limits[0];
61596159- limitsMax = this.limits[1];
61606160- }
61616161- result = RawGenericJoint.prismatic(rawA1, rawA2, rawAx, limitsEnabled, limitsMin, limitsMax);
61626162- rawAx.free();
61636163- break;
61646164- case JointType.Revolute:
61656165- result = RawGenericJoint.revolute(rawA1, rawA2);
61666166- break;
61676167- }
61686168- rawA1.free();
61696169- rawA2.free();
61706170- return result;
61716171- }
61726172-};
61736173-61746174-// ../node_modules/@dimforge/rapier2d/dynamics/impulse_joint_set.js
61756175-var ImpulseJointSet = class {
61766176- constructor(raw) {
61776177- this.raw = raw || new RawImpulseJointSet();
61786178- this.map = new Coarena();
61796179- if (raw) {
61806180- raw.forEachJointHandle((handle) => {
61816181- this.map.set(handle, ImpulseJoint.newTyped(raw, null, handle));
61826182- });
61836183- }
61846184- }
61856185- /**
61866186- * Release the WASM memory occupied by this joint set.
61876187- */
61886188- free() {
61896189- if (!!this.raw) {
61906190- this.raw.free();
61916191- }
61926192- this.raw = void 0;
61936193- if (!!this.map) {
61946194- this.map.clear();
61956195- }
61966196- this.map = void 0;
61976197- }
61986198- /** @internal */
61996199- finalizeDeserialization(bodies) {
62006200- this.map.forEach((joint) => joint.finalizeDeserialization(bodies));
62016201- }
62026202- /**
62036203- * Creates a new joint and return its integer handle.
62046204- *
62056205- * @param bodies - The set of rigid-bodies containing the bodies the joint is attached to.
62066206- * @param desc - The joint's parameters.
62076207- * @param parent1 - The handle of the first rigid-body this joint is attached to.
62086208- * @param parent2 - The handle of the second rigid-body this joint is attached to.
62096209- * @param wakeUp - Should the attached rigid-bodies be awakened?
62106210- */
62116211- createJoint(bodies, desc, parent1, parent2, wakeUp) {
62126212- const rawParams = desc.intoRaw();
62136213- const handle = this.raw.createJoint(rawParams, parent1, parent2, wakeUp);
62146214- rawParams.free();
62156215- let joint = ImpulseJoint.newTyped(this.raw, bodies, handle);
62166216- this.map.set(handle, joint);
62176217- return joint;
62186218- }
62196219- /**
62206220- * Remove a joint from this set.
62216221- *
62226222- * @param handle - The integer handle of the joint.
62236223- * @param wakeUp - If `true`, the rigid-bodies attached by the removed joint will be woken-up automatically.
62246224- */
62256225- remove(handle, wakeUp) {
62266226- this.raw.remove(handle, wakeUp);
62276227- this.unmap(handle);
62286228- }
62296229- /**
62306230- * Calls the given closure with the integer handle of each impulse joint attached to this rigid-body.
62316231- *
62326232- * @param f - The closure called with the integer handle of each impulse joint attached to the rigid-body.
62336233- */
62346234- forEachJointHandleAttachedToRigidBody(handle, f) {
62356235- this.raw.forEachJointAttachedToRigidBody(handle, f);
62366236- }
62376237- /**
62386238- * Internal function, do not call directly.
62396239- * @param handle
62406240- */
62416241- unmap(handle) {
62426242- this.map.delete(handle);
62436243- }
62446244- /**
62456245- * The number of joints on this set.
62466246- */
62476247- len() {
62486248- return this.map.len();
62496249- }
62506250- /**
62516251- * Does this set contain a joint with the given handle?
62526252- *
62536253- * @param handle - The joint handle to check.
62546254- */
62556255- contains(handle) {
62566256- return this.get(handle) != null;
62576257- }
62586258- /**
62596259- * Gets the joint with the given handle.
62606260- *
62616261- * Returns `null` if no joint with the specified handle exists.
62626262- *
62636263- * @param handle - The integer handle of the joint to retrieve.
62646264- */
62656265- get(handle) {
62666266- return this.map.get(handle);
62676267- }
62686268- /**
62696269- * Applies the given closure to each joint contained by this set.
62706270- *
62716271- * @param f - The closure to apply.
62726272- */
62736273- forEach(f) {
62746274- this.map.forEach(f);
62756275- }
62766276- /**
62776277- * Gets all joints in the list.
62786278- *
62796279- * @returns joint list.
62806280- */
62816281- getAll() {
62826282- return this.map.getAll();
62836283- }
62846284-};
62856285-62866286-// ../node_modules/@dimforge/rapier2d/dynamics/multibody_joint.js
62876287-var MultibodyJoint = class _MultibodyJoint {
62886288- constructor(rawSet, handle) {
62896289- this.rawSet = rawSet;
62906290- this.handle = handle;
62916291- }
62926292- static newTyped(rawSet, handle) {
62936293- switch (rawSet.jointType(handle)) {
62946294- case RawJointType.Revolute:
62956295- return new RevoluteMultibodyJoint(rawSet, handle);
62966296- case RawJointType.Prismatic:
62976297- return new PrismaticMultibodyJoint(rawSet, handle);
62986298- case RawJointType.Fixed:
62996299- return new FixedMultibodyJoint(rawSet, handle);
63006300- default:
63016301- return new _MultibodyJoint(rawSet, handle);
63026302- }
63036303- }
63046304- /**
63056305- * Checks if this joint is still valid (i.e. that it has
63066306- * not been deleted from the joint set yet).
63076307- */
63086308- isValid() {
63096309- return this.rawSet.contains(this.handle);
63106310- }
63116311- // /**
63126312- // * The unique integer identifier of the first rigid-body this joint it attached to.
63136313- // */
63146314- // public bodyHandle1(): RigidBodyHandle {
63156315- // return this.rawSet.jointBodyHandle1(this.handle);
63166316- // }
63176317- //
63186318- // /**
63196319- // * The unique integer identifier of the second rigid-body this joint is attached to.
63206320- // */
63216321- // public bodyHandle2(): RigidBodyHandle {
63226322- // return this.rawSet.jointBodyHandle2(this.handle);
63236323- // }
63246324- //
63256325- // /**
63266326- // * The type of this joint given as a string.
63276327- // */
63286328- // public type(): JointType {
63296329- // return this.rawSet.jointType(this.handle);
63306330- // }
63316331- //
63326332- //
63336333- //
63346334- // /**
63356335- // * The position of the first anchor of this joint.
63366336- // *
63376337- // * The first anchor gives the position of the points application point on the
63386338- // * local frame of the first rigid-body it is attached to.
63396339- // */
63406340- // public anchor1(): Vector {
63416341- // return VectorOps.fromRaw(this.rawSet.jointAnchor1(this.handle));
63426342- // }
63436343- //
63446344- // /**
63456345- // * The position of the second anchor of this joint.
63466346- // *
63476347- // * The second anchor gives the position of the points application point on the
63486348- // * local frame of the second rigid-body it is attached to.
63496349- // */
63506350- // public anchor2(): Vector {
63516351- // return VectorOps.fromRaw(this.rawSet.jointAnchor2(this.handle));
63526352- // }
63536353- /**
63546354- * Controls whether contacts are computed between colliders attached
63556355- * to the rigid-bodies linked by this joint.
63566356- */
63576357- setContactsEnabled(enabled) {
63586358- this.rawSet.jointSetContactsEnabled(this.handle, enabled);
63596359- }
63606360- /**
63616361- * Indicates if contacts are enabled between colliders attached
63626362- * to the rigid-bodies linked by this joint.
63636363- */
63646364- contactsEnabled() {
63656365- return this.rawSet.jointContactsEnabled(this.handle);
63666366- }
63676367-};
63686368-var UnitMultibodyJoint = class extends MultibodyJoint {
63696369-};
63706370-var FixedMultibodyJoint = class extends MultibodyJoint {
63716371-};
63726372-var PrismaticMultibodyJoint = class extends UnitMultibodyJoint {
63736373- rawAxis() {
63746374- return RawJointAxis.X;
63756375- }
63766376-};
63776377-var RevoluteMultibodyJoint = class extends UnitMultibodyJoint {
63786378- rawAxis() {
63796379- return RawJointAxis.AngX;
63806380- }
63816381-};
63826382-63836383-// ../node_modules/@dimforge/rapier2d/dynamics/multibody_joint_set.js
63846384-var MultibodyJointSet = class {
63856385- constructor(raw) {
63866386- this.raw = raw || new RawMultibodyJointSet();
63876387- this.map = new Coarena();
63886388- if (raw) {
63896389- raw.forEachJointHandle((handle) => {
63906390- this.map.set(handle, MultibodyJoint.newTyped(this.raw, handle));
63916391- });
63926392- }
63936393- }
63946394- /**
63956395- * Release the WASM memory occupied by this joint set.
63966396- */
63976397- free() {
63986398- if (!!this.raw) {
63996399- this.raw.free();
64006400- }
64016401- this.raw = void 0;
64026402- if (!!this.map) {
64036403- this.map.clear();
64046404- }
64056405- this.map = void 0;
64066406- }
64076407- /**
64086408- * Creates a new joint and return its integer handle.
64096409- *
64106410- * @param desc - The joint's parameters.
64116411- * @param parent1 - The handle of the first rigid-body this joint is attached to.
64126412- * @param parent2 - The handle of the second rigid-body this joint is attached to.
64136413- * @param wakeUp - Should the attached rigid-bodies be awakened?
64146414- */
64156415- createJoint(desc, parent1, parent2, wakeUp) {
64166416- const rawParams = desc.intoRaw();
64176417- const handle = this.raw.createJoint(rawParams, parent1, parent2, wakeUp);
64186418- rawParams.free();
64196419- let joint = MultibodyJoint.newTyped(this.raw, handle);
64206420- this.map.set(handle, joint);
64216421- return joint;
64226422- }
64236423- /**
64246424- * Remove a joint from this set.
64256425- *
64266426- * @param handle - The integer handle of the joint.
64276427- * @param wake_up - If `true`, the rigid-bodies attached by the removed joint will be woken-up automatically.
64286428- */
64296429- remove(handle, wake_up) {
64306430- this.raw.remove(handle, wake_up);
64316431- this.map.delete(handle);
64326432- }
64336433- /**
64346434- * Internal function, do not call directly.
64356435- * @param handle
64366436- */
64376437- unmap(handle) {
64386438- this.map.delete(handle);
64396439- }
64406440- /**
64416441- * The number of joints on this set.
64426442- */
64436443- len() {
64446444- return this.map.len();
64456445- }
64466446- /**
64476447- * Does this set contain a joint with the given handle?
64486448- *
64496449- * @param handle - The joint handle to check.
64506450- */
64516451- contains(handle) {
64526452- return this.get(handle) != null;
64536453- }
64546454- /**
64556455- * Gets the joint with the given handle.
64566456- *
64576457- * Returns `null` if no joint with the specified handle exists.
64586458- *
64596459- * @param handle - The integer handle of the joint to retrieve.
64606460- */
64616461- get(handle) {
64626462- return this.map.get(handle);
64636463- }
64646464- /**
64656465- * Applies the given closure to each joint contained by this set.
64666466- *
64676467- * @param f - The closure to apply.
64686468- */
64696469- forEach(f) {
64706470- this.map.forEach(f);
64716471- }
64726472- /**
64736473- * Calls the given closure with the integer handle of each multibody joint attached to this rigid-body.
64746474- *
64756475- * @param f - The closure called with the integer handle of each multibody joint attached to the rigid-body.
64766476- */
64776477- forEachJointHandleAttachedToRigidBody(handle, f) {
64786478- this.raw.forEachJointAttachedToRigidBody(handle, f);
64796479- }
64806480- /**
64816481- * Gets all joints in the list.
64826482- *
64836483- * @returns joint list.
64846484- */
64856485- getAll() {
64866486- return this.map.getAll();
64876487- }
64886488-};
64896489-64906490-// ../node_modules/@dimforge/rapier2d/dynamics/coefficient_combine_rule.js
64916491-var CoefficientCombineRule;
64926492-(function(CoefficientCombineRule2) {
64936493- CoefficientCombineRule2[CoefficientCombineRule2["Average"] = 0] = "Average";
64946494- CoefficientCombineRule2[CoefficientCombineRule2["Min"] = 1] = "Min";
64956495- CoefficientCombineRule2[CoefficientCombineRule2["Multiply"] = 2] = "Multiply";
64966496- CoefficientCombineRule2[CoefficientCombineRule2["Max"] = 3] = "Max";
64976497-})(CoefficientCombineRule || (CoefficientCombineRule = {}));
64986498-64996499-// ../node_modules/@dimforge/rapier2d/dynamics/ccd_solver.js
65006500-var CCDSolver = class {
65016501- constructor(raw) {
65026502- this.raw = raw || new RawCCDSolver();
65036503- }
65046504- /**
65056505- * Release the WASM memory occupied by this narrow-phase.
65066506- */
65076507- free() {
65086508- if (!!this.raw) {
65096509- this.raw.free();
65106510- }
65116511- this.raw = void 0;
65126512- }
65136513-};
65146514-65156515-// ../node_modules/@dimforge/rapier2d/dynamics/island_manager.js
65166516-var IslandManager = class {
65176517- constructor(raw) {
65186518- this.raw = raw || new RawIslandManager();
65196519- }
65206520- /**
65216521- * Release the WASM memory occupied by this narrow-phase.
65226522- */
65236523- free() {
65246524- if (!!this.raw) {
65256525- this.raw.free();
65266526- }
65276527- this.raw = void 0;
65286528- }
65296529- /**
65306530- * Applies the given closure to the handle of each active rigid-bodies contained by this set.
65316531- *
65326532- * A rigid-body is active if it is not sleeping, i.e., if it moved recently.
65336533- *
65346534- * @param f - The closure to apply.
65356535- */
65366536- forEachActiveRigidBodyHandle(f) {
65376537- this.raw.forEachActiveRigidBodyHandle(f);
65386538- }
65396539-};
65406540-65416541-// ../node_modules/@dimforge/rapier2d/geometry/broad_phase.js
65426542-var BroadPhase = class {
65436543- constructor(raw) {
65446544- this.raw = raw || new RawBroadPhase();
65456545- }
65466546- /**
65476547- * Release the WASM memory occupied by this broad-phase.
65486548- */
65496549- free() {
65506550- if (!!this.raw) {
65516551- this.raw.free();
65526552- }
65536553- this.raw = void 0;
65546554- }
65556555-};
65566556-65576557-// ../node_modules/@dimforge/rapier2d/geometry/narrow_phase.js
65586558-var NarrowPhase = class {
65596559- constructor(raw) {
65606560- this.raw = raw || new RawNarrowPhase();
65616561- this.tempManifold = new TempContactManifold(null);
65626562- }
65636563- /**
65646564- * Release the WASM memory occupied by this narrow-phase.
65656565- */
65666566- free() {
65676567- if (!!this.raw) {
65686568- this.raw.free();
65696569- }
65706570- this.raw = void 0;
65716571- }
65726572- /**
65736573- * Enumerates all the colliders potentially in contact with the given collider.
65746574- *
65756575- * @param collider1 - The second collider involved in the contact.
65766576- * @param f - Closure that will be called on each collider that is in contact with `collider1`.
65776577- */
65786578- contactPairsWith(collider1, f) {
65796579- this.raw.contact_pairs_with(collider1, f);
65806580- }
65816581- /**
65826582- * Enumerates all the colliders intersecting the given colliders, assuming one of them
65836583- * is a sensor.
65846584- */
65856585- intersectionPairsWith(collider1, f) {
65866586- this.raw.intersection_pairs_with(collider1, f);
65876587- }
65886588- /**
65896589- * Iterates through all the contact manifolds between the given pair of colliders.
65906590- *
65916591- * @param collider1 - The first collider involved in the contact.
65926592- * @param collider2 - The second collider involved in the contact.
65936593- * @param f - Closure that will be called on each contact manifold between the two colliders. If the second argument
65946594- * passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1`
65956595- * actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`.
65966596- */
65976597- contactPair(collider1, collider2, f) {
65986598- const rawPair = this.raw.contact_pair(collider1, collider2);
65996599- if (!!rawPair) {
66006600- const flipped = rawPair.collider1() != collider1;
66016601- let i;
66026602- for (i = 0; i < rawPair.numContactManifolds(); ++i) {
66036603- this.tempManifold.raw = rawPair.contactManifold(i);
66046604- if (!!this.tempManifold.raw) {
66056605- f(this.tempManifold, flipped);
66066606- }
66076607- this.tempManifold.free();
66086608- }
66096609- rawPair.free();
66106610- }
66116611- }
66126612- /**
66136613- * Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor.
66146614- * @param collider1 − The first collider involved in the intersection.
66156615- * @param collider2 − The second collider involved in the intersection.
66166616- */
66176617- intersectionPair(collider1, collider2) {
66186618- return this.raw.intersection_pair(collider1, collider2);
66196619- }
66206620-};
66216621-var TempContactManifold = class {
66226622- constructor(raw) {
66236623- this.raw = raw;
66246624- }
66256625- free() {
66266626- if (!!this.raw) {
66276627- this.raw.free();
66286628- }
66296629- this.raw = void 0;
66306630- }
66316631- normal() {
66326632- return VectorOps.fromRaw(this.raw.normal());
66336633- }
66346634- localNormal1() {
66356635- return VectorOps.fromRaw(this.raw.local_n1());
66366636- }
66376637- localNormal2() {
66386638- return VectorOps.fromRaw(this.raw.local_n2());
66396639- }
66406640- subshape1() {
66416641- return this.raw.subshape1();
66426642- }
66436643- subshape2() {
66446644- return this.raw.subshape2();
66456645- }
66466646- numContacts() {
66476647- return this.raw.num_contacts();
66486648- }
66496649- localContactPoint1(i) {
66506650- return VectorOps.fromRaw(this.raw.contact_local_p1(i));
66516651- }
66526652- localContactPoint2(i) {
66536653- return VectorOps.fromRaw(this.raw.contact_local_p2(i));
66546654- }
66556655- contactDist(i) {
66566656- return this.raw.contact_dist(i);
66576657- }
66586658- contactFid1(i) {
66596659- return this.raw.contact_fid1(i);
66606660- }
66616661- contactFid2(i) {
66626662- return this.raw.contact_fid2(i);
66636663- }
66646664- contactImpulse(i) {
66656665- return this.raw.contact_impulse(i);
66666666- }
66676667- // #if DIM2
66686668- contactTangentImpulse(i) {
66696669- return this.raw.contact_tangent_impulse(i);
66706670- }
66716671- // #endif
66726672- numSolverContacts() {
66736673- return this.raw.num_solver_contacts();
66746674- }
66756675- solverContactPoint(i) {
66766676- return VectorOps.fromRaw(this.raw.solver_contact_point(i));
66776677- }
66786678- solverContactDist(i) {
66796679- return this.raw.solver_contact_dist(i);
66806680- }
66816681- solverContactFriction(i) {
66826682- return this.raw.solver_contact_friction(i);
66836683- }
66846684- solverContactRestitution(i) {
66856685- return this.raw.solver_contact_restitution(i);
66866686- }
66876687- solverContactTangentVelocity(i) {
66886688- return VectorOps.fromRaw(this.raw.solver_contact_tangent_velocity(i));
66896689- }
66906690-};
66916691-66926692-// ../node_modules/@dimforge/rapier2d/geometry/contact.js
66936693-var ShapeContact = class _ShapeContact {
66946694- constructor(dist, point1, point2, normal1, normal2) {
66956695- this.distance = dist;
66966696- this.point1 = point1;
66976697- this.point2 = point2;
66986698- this.normal1 = normal1;
66996699- this.normal2 = normal2;
67006700- }
67016701- static fromRaw(raw) {
67026702- if (!raw)
67036703- return null;
67046704- const result = new _ShapeContact(raw.distance(), VectorOps.fromRaw(raw.point1()), VectorOps.fromRaw(raw.point2()), VectorOps.fromRaw(raw.normal1()), VectorOps.fromRaw(raw.normal2()));
67056705- raw.free();
67066706- return result;
67076707- }
67086708-};
67096709-67106710-// ../node_modules/@dimforge/rapier2d/geometry/feature.js
67116711-var FeatureType;
67126712-(function(FeatureType2) {
67136713- FeatureType2[FeatureType2["Vertex"] = 0] = "Vertex";
67146714- FeatureType2[FeatureType2["Face"] = 1] = "Face";
67156715- FeatureType2[FeatureType2["Unknown"] = 2] = "Unknown";
67166716-})(FeatureType || (FeatureType = {}));
67176717-67186718-// ../node_modules/@dimforge/rapier2d/geometry/point.js
67196719-var PointProjection = class _PointProjection {
67206720- constructor(point, isInside) {
67216721- this.point = point;
67226722- this.isInside = isInside;
67236723- }
67246724- static fromRaw(raw) {
67256725- if (!raw)
67266726- return null;
67276727- const result = new _PointProjection(VectorOps.fromRaw(raw.point()), raw.isInside());
67286728- raw.free();
67296729- return result;
67306730- }
67316731-};
67326732-var PointColliderProjection = class _PointColliderProjection {
67336733- constructor(collider, point, isInside, featureType, featureId) {
67346734- this.featureType = FeatureType.Unknown;
67356735- this.featureId = void 0;
67366736- this.collider = collider;
67376737- this.point = point;
67386738- this.isInside = isInside;
67396739- if (featureId !== void 0)
67406740- this.featureId = featureId;
67416741- if (featureType !== void 0)
67426742- this.featureType = featureType;
67436743- }
67446744- static fromRaw(colliderSet, raw) {
67456745- if (!raw)
67466746- return null;
67476747- const result = new _PointColliderProjection(colliderSet.get(raw.colliderHandle()), VectorOps.fromRaw(raw.point()), raw.isInside(), raw.featureType(), raw.featureId());
67486748- raw.free();
67496749- return result;
67506750- }
67516751-};
67526752-67536753-// ../node_modules/@dimforge/rapier2d/geometry/ray.js
67546754-var Ray = class {
67556755- /**
67566756- * Builds a ray from its origin and direction.
67576757- *
67586758- * @param origin - The ray's starting point.
67596759- * @param dir - The ray's direction of propagation.
67606760- */
67616761- constructor(origin, dir) {
67626762- this.origin = origin;
67636763- this.dir = dir;
67646764- }
67656765- pointAt(t) {
67666766- return {
67676767- x: this.origin.x + this.dir.x * t,
67686768- y: this.origin.y + this.dir.y * t
67696769- };
67706770- }
67716771-};
67726772-var RayIntersection = class _RayIntersection {
67736773- constructor(timeOfImpact, normal, featureType, featureId) {
67746774- this.featureType = FeatureType.Unknown;
67756775- this.featureId = void 0;
67766776- this.timeOfImpact = timeOfImpact;
67776777- this.normal = normal;
67786778- if (featureId !== void 0)
67796779- this.featureId = featureId;
67806780- if (featureType !== void 0)
67816781- this.featureType = featureType;
67826782- }
67836783- static fromRaw(raw) {
67846784- if (!raw)
67856785- return null;
67866786- const result = new _RayIntersection(raw.time_of_impact(), VectorOps.fromRaw(raw.normal()), raw.featureType(), raw.featureId());
67876787- raw.free();
67886788- return result;
67896789- }
67906790-};
67916791-var RayColliderIntersection = class _RayColliderIntersection {
67926792- constructor(collider, timeOfImpact, normal, featureType, featureId) {
67936793- this.featureType = FeatureType.Unknown;
67946794- this.featureId = void 0;
67956795- this.collider = collider;
67966796- this.timeOfImpact = timeOfImpact;
67976797- this.normal = normal;
67986798- if (featureId !== void 0)
67996799- this.featureId = featureId;
68006800- if (featureType !== void 0)
68016801- this.featureType = featureType;
68026802- }
68036803- static fromRaw(colliderSet, raw) {
68046804- if (!raw)
68056805- return null;
68066806- const result = new _RayColliderIntersection(colliderSet.get(raw.colliderHandle()), raw.time_of_impact(), VectorOps.fromRaw(raw.normal()), raw.featureType(), raw.featureId());
68076807- raw.free();
68086808- return result;
68096809- }
68106810-};
68116811-var RayColliderHit = class _RayColliderHit {
68126812- constructor(collider, timeOfImpact) {
68136813- this.collider = collider;
68146814- this.timeOfImpact = timeOfImpact;
68156815- }
68166816- static fromRaw(colliderSet, raw) {
68176817- if (!raw)
68186818- return null;
68196819- const result = new _RayColliderHit(colliderSet.get(raw.colliderHandle()), raw.timeOfImpact());
68206820- raw.free();
68216821- return result;
68226822- }
68236823-};
68246824-68256825-// ../node_modules/@dimforge/rapier2d/geometry/toi.js
68266826-var ShapeCastHit = class _ShapeCastHit {
68276827- constructor(time_of_impact, witness1, witness2, normal1, normal2) {
68286828- this.time_of_impact = time_of_impact;
68296829- this.witness1 = witness1;
68306830- this.witness2 = witness2;
68316831- this.normal1 = normal1;
68326832- this.normal2 = normal2;
68336833- }
68346834- static fromRaw(colliderSet, raw) {
68356835- if (!raw)
68366836- return null;
68376837- const result = new _ShapeCastHit(raw.time_of_impact(), VectorOps.fromRaw(raw.witness1()), VectorOps.fromRaw(raw.witness2()), VectorOps.fromRaw(raw.normal1()), VectorOps.fromRaw(raw.normal2()));
68386838- raw.free();
68396839- return result;
68406840- }
68416841-};
68426842-var ColliderShapeCastHit = class _ColliderShapeCastHit extends ShapeCastHit {
68436843- constructor(collider, time_of_impact, witness1, witness2, normal1, normal2) {
68446844- super(time_of_impact, witness1, witness2, normal1, normal2);
68456845- this.collider = collider;
68466846- }
68476847- static fromRaw(colliderSet, raw) {
68486848- if (!raw)
68496849- return null;
68506850- const result = new _ColliderShapeCastHit(colliderSet.get(raw.colliderHandle()), raw.time_of_impact(), VectorOps.fromRaw(raw.witness1()), VectorOps.fromRaw(raw.witness2()), VectorOps.fromRaw(raw.normal1()), VectorOps.fromRaw(raw.normal2()));
68516851- raw.free();
68526852- return result;
68536853- }
68546854-};
68556855-68566856-// ../node_modules/@dimforge/rapier2d/geometry/shape.js
68576857-var Shape = class {
68586858- /**
68596859- * instant mode without cache
68606860- */
68616861- static fromRaw(rawSet, handle) {
68626862- const rawType = rawSet.coShapeType(handle);
68636863- let extents;
68646864- let borderRadius;
68656865- let vs;
68666866- let indices;
68676867- let halfHeight;
68686868- let radius;
68696869- let normal;
68706870- switch (rawType) {
68716871- case RawShapeType.Ball:
68726872- return new Ball(rawSet.coRadius(handle));
68736873- case RawShapeType.Cuboid:
68746874- extents = rawSet.coHalfExtents(handle);
68756875- return new Cuboid(extents.x, extents.y);
68766876- case RawShapeType.RoundCuboid:
68776877- extents = rawSet.coHalfExtents(handle);
68786878- borderRadius = rawSet.coRoundRadius(handle);
68796879- return new RoundCuboid(extents.x, extents.y, borderRadius);
68806880- case RawShapeType.Capsule:
68816881- halfHeight = rawSet.coHalfHeight(handle);
68826882- radius = rawSet.coRadius(handle);
68836883- return new Capsule(halfHeight, radius);
68846884- case RawShapeType.Segment:
68856885- vs = rawSet.coVertices(handle);
68866886- return new Segment(VectorOps.new(vs[0], vs[1]), VectorOps.new(vs[2], vs[3]));
68876887- case RawShapeType.Polyline:
68886888- vs = rawSet.coVertices(handle);
68896889- indices = rawSet.coIndices(handle);
68906890- return new Polyline(vs, indices);
68916891- case RawShapeType.Triangle:
68926892- vs = rawSet.coVertices(handle);
68936893- return new Triangle(VectorOps.new(vs[0], vs[1]), VectorOps.new(vs[2], vs[3]), VectorOps.new(vs[4], vs[5]));
68946894- case RawShapeType.RoundTriangle:
68956895- vs = rawSet.coVertices(handle);
68966896- borderRadius = rawSet.coRoundRadius(handle);
68976897- return new RoundTriangle(VectorOps.new(vs[0], vs[1]), VectorOps.new(vs[2], vs[3]), VectorOps.new(vs[4], vs[5]), borderRadius);
68986898- case RawShapeType.HalfSpace:
68996899- normal = VectorOps.fromRaw(rawSet.coHalfspaceNormal(handle));
69006900- return new HalfSpace(normal);
69016901- case RawShapeType.TriMesh:
69026902- vs = rawSet.coVertices(handle);
69036903- indices = rawSet.coIndices(handle);
69046904- const tri_flags = rawSet.coTriMeshFlags(handle);
69056905- return new TriMesh(vs, indices, tri_flags);
69066906- case RawShapeType.HeightField:
69076907- const scale = rawSet.coHeightfieldScale(handle);
69086908- const heights = rawSet.coHeightfieldHeights(handle);
69096909- return new Heightfield(heights, scale);
69106910- case RawShapeType.ConvexPolygon:
69116911- vs = rawSet.coVertices(handle);
69126912- return new ConvexPolygon(vs, false);
69136913- case RawShapeType.RoundConvexPolygon:
69146914- vs = rawSet.coVertices(handle);
69156915- borderRadius = rawSet.coRoundRadius(handle);
69166916- return new RoundConvexPolygon(vs, borderRadius, false);
69176917- default:
69186918- throw new Error("unknown shape type: " + rawType);
69196919- }
69206920- }
69216921- /**
69226922- * Computes the time of impact between two moving shapes.
69236923- * @param shapePos1 - The initial position of this sahpe.
69246924- * @param shapeRot1 - The rotation of this shape.
69256925- * @param shapeVel1 - The velocity of this shape.
69266926- * @param shape2 - The second moving shape.
69276927- * @param shapePos2 - The initial position of the second shape.
69286928- * @param shapeRot2 - The rotation of the second shape.
69296929- * @param shapeVel2 - The velocity of the second shape.
69306930- * @param targetDistance − If the shape moves closer to this distance from a collider, a hit
69316931- * will be returned.
69326932- * @param maxToi - The maximum time when the impact can happen.
69336933- * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if
69346934- * the shape is penetrating another shape at its starting point **and** its trajectory is such
69356935- * that it’s on a path to exist that penetration state.
69366936- * @returns If the two moving shapes collider at some point along their trajectories, this returns the
69376937- * time at which the two shape collider as well as the contact information during the impact. Returns
69386938- * `null`if the two shapes never collide along their paths.
69396939- */
69406940- castShape(shapePos1, shapeRot1, shapeVel1, shape2, shapePos2, shapeRot2, shapeVel2, targetDistance, maxToi, stopAtPenetration) {
69416941- let rawPos1 = VectorOps.intoRaw(shapePos1);
69426942- let rawRot1 = RotationOps.intoRaw(shapeRot1);
69436943- let rawVel1 = VectorOps.intoRaw(shapeVel1);
69446944- let rawPos2 = VectorOps.intoRaw(shapePos2);
69456945- let rawRot2 = RotationOps.intoRaw(shapeRot2);
69466946- let rawVel2 = VectorOps.intoRaw(shapeVel2);
69476947- let rawShape1 = this.intoRaw();
69486948- let rawShape2 = shape2.intoRaw();
69496949- let result = ShapeCastHit.fromRaw(null, rawShape1.castShape(rawPos1, rawRot1, rawVel1, rawShape2, rawPos2, rawRot2, rawVel2, targetDistance, maxToi, stopAtPenetration));
69506950- rawPos1.free();
69516951- rawRot1.free();
69526952- rawVel1.free();
69536953- rawPos2.free();
69546954- rawRot2.free();
69556955- rawVel2.free();
69566956- rawShape1.free();
69576957- rawShape2.free();
69586958- return result;
69596959- }
69606960- /**
69616961- * Tests if this shape intersects another shape.
69626962- *
69636963- * @param shapePos1 - The position of this shape.
69646964- * @param shapeRot1 - The rotation of this shape.
69656965- * @param shape2 - The second shape to test.
69666966- * @param shapePos2 - The position of the second shape.
69676967- * @param shapeRot2 - The rotation of the second shape.
69686968- * @returns `true` if the two shapes intersect, `false` if they don’t.
69696969- */
69706970- intersectsShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2) {
69716971- let rawPos1 = VectorOps.intoRaw(shapePos1);
69726972- let rawRot1 = RotationOps.intoRaw(shapeRot1);
69736973- let rawPos2 = VectorOps.intoRaw(shapePos2);
69746974- let rawRot2 = RotationOps.intoRaw(shapeRot2);
69756975- let rawShape1 = this.intoRaw();
69766976- let rawShape2 = shape2.intoRaw();
69776977- let result = rawShape1.intersectsShape(rawPos1, rawRot1, rawShape2, rawPos2, rawRot2);
69786978- rawPos1.free();
69796979- rawRot1.free();
69806980- rawPos2.free();
69816981- rawRot2.free();
69826982- rawShape1.free();
69836983- rawShape2.free();
69846984- return result;
69856985- }
69866986- /**
69876987- * Computes one pair of contact points between two shapes.
69886988- *
69896989- * @param shapePos1 - The initial position of this sahpe.
69906990- * @param shapeRot1 - The rotation of this shape.
69916991- * @param shape2 - The second shape.
69926992- * @param shapePos2 - The initial position of the second shape.
69936993- * @param shapeRot2 - The rotation of the second shape.
69946994- * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail.
69956995- * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space.
69966996- */
69976997- contactShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2, prediction) {
69986998- let rawPos1 = VectorOps.intoRaw(shapePos1);
69996999- let rawRot1 = RotationOps.intoRaw(shapeRot1);
70007000- let rawPos2 = VectorOps.intoRaw(shapePos2);
70017001- let rawRot2 = RotationOps.intoRaw(shapeRot2);
70027002- let rawShape1 = this.intoRaw();
70037003- let rawShape2 = shape2.intoRaw();
70047004- let result = ShapeContact.fromRaw(rawShape1.contactShape(rawPos1, rawRot1, rawShape2, rawPos2, rawRot2, prediction));
70057005- rawPos1.free();
70067006- rawRot1.free();
70077007- rawPos2.free();
70087008- rawRot2.free();
70097009- rawShape1.free();
70107010- rawShape2.free();
70117011- return result;
70127012- }
70137013- containsPoint(shapePos, shapeRot, point) {
70147014- let rawPos = VectorOps.intoRaw(shapePos);
70157015- let rawRot = RotationOps.intoRaw(shapeRot);
70167016- let rawPoint = VectorOps.intoRaw(point);
70177017- let rawShape = this.intoRaw();
70187018- let result = rawShape.containsPoint(rawPos, rawRot, rawPoint);
70197019- rawPos.free();
70207020- rawRot.free();
70217021- rawPoint.free();
70227022- rawShape.free();
70237023- return result;
70247024- }
70257025- projectPoint(shapePos, shapeRot, point, solid) {
70267026- let rawPos = VectorOps.intoRaw(shapePos);
70277027- let rawRot = RotationOps.intoRaw(shapeRot);
70287028- let rawPoint = VectorOps.intoRaw(point);
70297029- let rawShape = this.intoRaw();
70307030- let result = PointProjection.fromRaw(rawShape.projectPoint(rawPos, rawRot, rawPoint, solid));
70317031- rawPos.free();
70327032- rawRot.free();
70337033- rawPoint.free();
70347034- rawShape.free();
70357035- return result;
70367036- }
70377037- intersectsRay(ray, shapePos, shapeRot, maxToi) {
70387038- let rawPos = VectorOps.intoRaw(shapePos);
70397039- let rawRot = RotationOps.intoRaw(shapeRot);
70407040- let rawRayOrig = VectorOps.intoRaw(ray.origin);
70417041- let rawRayDir = VectorOps.intoRaw(ray.dir);
70427042- let rawShape = this.intoRaw();
70437043- let result = rawShape.intersectsRay(rawPos, rawRot, rawRayOrig, rawRayDir, maxToi);
70447044- rawPos.free();
70457045- rawRot.free();
70467046- rawRayOrig.free();
70477047- rawRayDir.free();
70487048- rawShape.free();
70497049- return result;
70507050- }
70517051- castRay(ray, shapePos, shapeRot, maxToi, solid) {
70527052- let rawPos = VectorOps.intoRaw(shapePos);
70537053- let rawRot = RotationOps.intoRaw(shapeRot);
70547054- let rawRayOrig = VectorOps.intoRaw(ray.origin);
70557055- let rawRayDir = VectorOps.intoRaw(ray.dir);
70567056- let rawShape = this.intoRaw();
70577057- let result = rawShape.castRay(rawPos, rawRot, rawRayOrig, rawRayDir, maxToi, solid);
70587058- rawPos.free();
70597059- rawRot.free();
70607060- rawRayOrig.free();
70617061- rawRayDir.free();
70627062- rawShape.free();
70637063- return result;
70647064- }
70657065- castRayAndGetNormal(ray, shapePos, shapeRot, maxToi, solid) {
70667066- let rawPos = VectorOps.intoRaw(shapePos);
70677067- let rawRot = RotationOps.intoRaw(shapeRot);
70687068- let rawRayOrig = VectorOps.intoRaw(ray.origin);
70697069- let rawRayDir = VectorOps.intoRaw(ray.dir);
70707070- let rawShape = this.intoRaw();
70717071- let result = RayIntersection.fromRaw(rawShape.castRayAndGetNormal(rawPos, rawRot, rawRayOrig, rawRayDir, maxToi, solid));
70727072- rawPos.free();
70737073- rawRot.free();
70747074- rawRayOrig.free();
70757075- rawRayDir.free();
70767076- rawShape.free();
70777077- return result;
70787078- }
70797079-};
70807080-var ShapeType;
70817081-(function(ShapeType2) {
70827082- ShapeType2[ShapeType2["Ball"] = 0] = "Ball";
70837083- ShapeType2[ShapeType2["Cuboid"] = 1] = "Cuboid";
70847084- ShapeType2[ShapeType2["Capsule"] = 2] = "Capsule";
70857085- ShapeType2[ShapeType2["Segment"] = 3] = "Segment";
70867086- ShapeType2[ShapeType2["Polyline"] = 4] = "Polyline";
70877087- ShapeType2[ShapeType2["Triangle"] = 5] = "Triangle";
70887088- ShapeType2[ShapeType2["TriMesh"] = 6] = "TriMesh";
70897089- ShapeType2[ShapeType2["HeightField"] = 7] = "HeightField";
70907090- ShapeType2[ShapeType2["ConvexPolygon"] = 9] = "ConvexPolygon";
70917091- ShapeType2[ShapeType2["RoundCuboid"] = 10] = "RoundCuboid";
70927092- ShapeType2[ShapeType2["RoundTriangle"] = 11] = "RoundTriangle";
70937093- ShapeType2[ShapeType2["RoundConvexPolygon"] = 12] = "RoundConvexPolygon";
70947094- ShapeType2[ShapeType2["HalfSpace"] = 13] = "HalfSpace";
70957095-})(ShapeType || (ShapeType = {}));
70967096-var TriMeshFlags;
70977097-(function(TriMeshFlags2) {
70987098- TriMeshFlags2[TriMeshFlags2["DELETE_BAD_TOPOLOGY_TRIANGLES"] = 4] = "DELETE_BAD_TOPOLOGY_TRIANGLES";
70997099- TriMeshFlags2[TriMeshFlags2["ORIENTED"] = 8] = "ORIENTED";
71007100- TriMeshFlags2[TriMeshFlags2["MERGE_DUPLICATE_VERTICES"] = 16] = "MERGE_DUPLICATE_VERTICES";
71017101- TriMeshFlags2[TriMeshFlags2["DELETE_DEGENERATE_TRIANGLES"] = 32] = "DELETE_DEGENERATE_TRIANGLES";
71027102- TriMeshFlags2[TriMeshFlags2["DELETE_DUPLICATE_TRIANGLES"] = 64] = "DELETE_DUPLICATE_TRIANGLES";
71037103- TriMeshFlags2[TriMeshFlags2["FIX_INTERNAL_EDGES"] = 152] = "FIX_INTERNAL_EDGES";
71047104-})(TriMeshFlags || (TriMeshFlags = {}));
71057105-var Ball = class extends Shape {
71067106- /**
71077107- * Creates a new ball with the given radius.
71087108- * @param radius - The balls radius.
71097109- */
71107110- constructor(radius) {
71117111- super();
71127112- this.type = ShapeType.Ball;
71137113- this.radius = radius;
71147114- }
71157115- intoRaw() {
71167116- return RawShape.ball(this.radius);
71177117- }
71187118-};
71197119-var HalfSpace = class extends Shape {
71207120- /**
71217121- * Creates a new halfspace delimited by an infinite plane.
71227122- *
71237123- * @param normal - The outward normal of the plane.
71247124- */
71257125- constructor(normal) {
71267126- super();
71277127- this.type = ShapeType.HalfSpace;
71287128- this.normal = normal;
71297129- }
71307130- intoRaw() {
71317131- let n = VectorOps.intoRaw(this.normal);
71327132- let result = RawShape.halfspace(n);
71337133- n.free();
71347134- return result;
71357135- }
71367136-};
71377137-var Cuboid = class extends Shape {
71387138- // #if DIM2
71397139- /**
71407140- * Creates a new 2D rectangle.
71417141- * @param hx - The half width of the rectangle.
71427142- * @param hy - The helf height of the rectangle.
71437143- */
71447144- constructor(hx, hy) {
71457145- super();
71467146- this.type = ShapeType.Cuboid;
71477147- this.halfExtents = VectorOps.new(hx, hy);
71487148- }
71497149- // #endif
71507150- intoRaw() {
71517151- return RawShape.cuboid(this.halfExtents.x, this.halfExtents.y);
71527152- }
71537153-};
71547154-var RoundCuboid = class extends Shape {
71557155- // #if DIM2
71567156- /**
71577157- * Creates a new 2D rectangle.
71587158- * @param hx - The half width of the rectangle.
71597159- * @param hy - The helf height of the rectangle.
71607160- * @param borderRadius - The radius of the borders of this cuboid. This will
71617161- * effectively increase the half-extents of the cuboid by this radius.
71627162- */
71637163- constructor(hx, hy, borderRadius) {
71647164- super();
71657165- this.type = ShapeType.RoundCuboid;
71667166- this.halfExtents = VectorOps.new(hx, hy);
71677167- this.borderRadius = borderRadius;
71687168- }
71697169- // #endif
71707170- intoRaw() {
71717171- return RawShape.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
71727172- }
71737173-};
71747174-var Capsule = class extends Shape {
71757175- /**
71767176- * Creates a new capsule with the given radius and half-height.
71777177- * @param halfHeight - The balls half-height along the `y` axis.
71787178- * @param radius - The balls radius.
71797179- */
71807180- constructor(halfHeight, radius) {
71817181- super();
71827182- this.type = ShapeType.Capsule;
71837183- this.halfHeight = halfHeight;
71847184- this.radius = radius;
71857185- }
71867186- intoRaw() {
71877187- return RawShape.capsule(this.halfHeight, this.radius);
71887188- }
71897189-};
71907190-var Segment = class extends Shape {
71917191- /**
71927192- * Creates a new segment shape.
71937193- * @param a - The first point of the segment.
71947194- * @param b - The second point of the segment.
71957195- */
71967196- constructor(a, b) {
71977197- super();
71987198- this.type = ShapeType.Segment;
71997199- this.a = a;
72007200- this.b = b;
72017201- }
72027202- intoRaw() {
72037203- let ra = VectorOps.intoRaw(this.a);
72047204- let rb = VectorOps.intoRaw(this.b);
72057205- let result = RawShape.segment(ra, rb);
72067206- ra.free();
72077207- rb.free();
72087208- return result;
72097209- }
72107210-};
72117211-var Triangle = class extends Shape {
72127212- /**
72137213- * Creates a new triangle shape.
72147214- *
72157215- * @param a - The first point of the triangle.
72167216- * @param b - The second point of the triangle.
72177217- * @param c - The third point of the triangle.
72187218- */
72197219- constructor(a, b, c) {
72207220- super();
72217221- this.type = ShapeType.Triangle;
72227222- this.a = a;
72237223- this.b = b;
72247224- this.c = c;
72257225- }
72267226- intoRaw() {
72277227- let ra = VectorOps.intoRaw(this.a);
72287228- let rb = VectorOps.intoRaw(this.b);
72297229- let rc = VectorOps.intoRaw(this.c);
72307230- let result = RawShape.triangle(ra, rb, rc);
72317231- ra.free();
72327232- rb.free();
72337233- rc.free();
72347234- return result;
72357235- }
72367236-};
72377237-var RoundTriangle = class extends Shape {
72387238- /**
72397239- * Creates a new triangle shape with round corners.
72407240- *
72417241- * @param a - The first point of the triangle.
72427242- * @param b - The second point of the triangle.
72437243- * @param c - The third point of the triangle.
72447244- * @param borderRadius - The radius of the borders of this triangle. In 3D,
72457245- * this is also equal to half the thickness of the triangle.
72467246- */
72477247- constructor(a, b, c, borderRadius) {
72487248- super();
72497249- this.type = ShapeType.RoundTriangle;
72507250- this.a = a;
72517251- this.b = b;
72527252- this.c = c;
72537253- this.borderRadius = borderRadius;
72547254- }
72557255- intoRaw() {
72567256- let ra = VectorOps.intoRaw(this.a);
72577257- let rb = VectorOps.intoRaw(this.b);
72587258- let rc = VectorOps.intoRaw(this.c);
72597259- let result = RawShape.roundTriangle(ra, rb, rc, this.borderRadius);
72607260- ra.free();
72617261- rb.free();
72627262- rc.free();
72637263- return result;
72647264- }
72657265-};
72667266-var Polyline = class extends Shape {
72677267- /**
72687268- * Creates a new polyline shape.
72697269- *
72707270- * @param vertices - The coordinates of the polyline's vertices.
72717271- * @param indices - The indices of the polyline's segments. If this is `null` or not provided, then
72727272- * the vertices are assumed to form a line strip.
72737273- */
72747274- constructor(vertices, indices) {
72757275- super();
72767276- this.type = ShapeType.Polyline;
72777277- this.vertices = vertices;
72787278- this.indices = indices !== null && indices !== void 0 ? indices : new Uint32Array(0);
72797279- }
72807280- intoRaw() {
72817281- return RawShape.polyline(this.vertices, this.indices);
72827282- }
72837283-};
72847284-var TriMesh = class extends Shape {
72857285- /**
72867286- * Creates a new triangle mesh shape.
72877287- *
72887288- * @param vertices - The coordinates of the triangle mesh's vertices.
72897289- * @param indices - The indices of the triangle mesh's triangles.
72907290- */
72917291- constructor(vertices, indices, flags) {
72927292- super();
72937293- this.type = ShapeType.TriMesh;
72947294- this.vertices = vertices;
72957295- this.indices = indices;
72967296- this.flags = flags;
72977297- }
72987298- intoRaw() {
72997299- return RawShape.trimesh(this.vertices, this.indices, this.flags);
73007300- }
73017301-};
73027302-var ConvexPolygon = class extends Shape {
73037303- /**
73047304- * Creates a new convex polygon shape.
73057305- *
73067306- * @param vertices - The coordinates of the convex polygon's vertices.
73077307- * @param skipConvexHullComputation - If set to `true`, the input points will
73087308- * be assumed to form a convex polyline and no convex-hull computation will
73097309- * be done automatically.
73107310- */
73117311- constructor(vertices, skipConvexHullComputation) {
73127312- super();
73137313- this.type = ShapeType.ConvexPolygon;
73147314- this.vertices = vertices;
73157315- this.skipConvexHullComputation = !!skipConvexHullComputation;
73167316- }
73177317- intoRaw() {
73187318- if (this.skipConvexHullComputation) {
73197319- return RawShape.convexPolyline(this.vertices);
73207320- } else {
73217321- return RawShape.convexHull(this.vertices);
73227322- }
73237323- }
73247324-};
73257325-var RoundConvexPolygon = class extends Shape {
73267326- /**
73277327- * Creates a new convex polygon shape.
73287328- *
73297329- * @param vertices - The coordinates of the convex polygon's vertices.
73307330- * @param borderRadius - The radius of the borders of this convex polygon.
73317331- * @param skipConvexHullComputation - If set to `true`, the input points will
73327332- * be assumed to form a convex polyline and no convex-hull computation will
73337333- * be done automatically.
73347334- */
73357335- constructor(vertices, borderRadius, skipConvexHullComputation) {
73367336- super();
73377337- this.type = ShapeType.RoundConvexPolygon;
73387338- this.vertices = vertices;
73397339- this.borderRadius = borderRadius;
73407340- this.skipConvexHullComputation = !!skipConvexHullComputation;
73417341- }
73427342- intoRaw() {
73437343- if (this.skipConvexHullComputation) {
73447344- return RawShape.roundConvexPolyline(this.vertices, this.borderRadius);
73457345- } else {
73467346- return RawShape.roundConvexHull(this.vertices, this.borderRadius);
73477347- }
73487348- }
73497349-};
73507350-var Heightfield = class extends Shape {
73517351- /**
73527352- * Creates a new heightfield shape.
73537353- *
73547354- * @param heights - The heights of the heightfield, along its local `y` axis.
73557355- * @param scale - The scale factor applied to the heightfield.
73567356- */
73577357- constructor(heights, scale) {
73587358- super();
73597359- this.type = ShapeType.HeightField;
73607360- this.heights = heights;
73617361- this.scale = scale;
73627362- }
73637363- intoRaw() {
73647364- let rawScale = VectorOps.intoRaw(this.scale);
73657365- let rawShape = RawShape.heightfield(this.heights, rawScale);
73667366- rawScale.free();
73677367- return rawShape;
73687368- }
73697369-};
73707370-73717371-// ../node_modules/@dimforge/rapier2d/pipeline/physics_pipeline.js
73727372-var PhysicsPipeline = class {
73737373- constructor(raw) {
73747374- this.raw = raw || new RawPhysicsPipeline();
73757375- }
73767376- free() {
73777377- if (!!this.raw) {
73787378- this.raw.free();
73797379- }
73807380- this.raw = void 0;
73817381- }
73827382- step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulseJoints, multibodyJoints, ccdSolver, eventQueue, hooks) {
73837383- let rawG = VectorOps.intoRaw(gravity);
73847384- if (!!eventQueue) {
73857385- this.raw.stepWithEvents(rawG, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw, ccdSolver.raw, eventQueue.raw, hooks, !!hooks ? hooks.filterContactPair : null, !!hooks ? hooks.filterIntersectionPair : null);
73867386- } else {
73877387- this.raw.step(rawG, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw, ccdSolver.raw);
73887388- }
73897389- rawG.free();
73907390- }
73917391-};
73927392-73937393-// ../node_modules/@dimforge/rapier2d/pipeline/query_pipeline.js
73947394-var QueryFilterFlags;
73957395-(function(QueryFilterFlags2) {
73967396- QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_FIXED"] = 1] = "EXCLUDE_FIXED";
73977397- QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_KINEMATIC"] = 2] = "EXCLUDE_KINEMATIC";
73987398- QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_DYNAMIC"] = 4] = "EXCLUDE_DYNAMIC";
73997399- QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_SENSORS"] = 8] = "EXCLUDE_SENSORS";
74007400- QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_SOLIDS"] = 16] = "EXCLUDE_SOLIDS";
74017401- QueryFilterFlags2[QueryFilterFlags2["ONLY_DYNAMIC"] = 3] = "ONLY_DYNAMIC";
74027402- QueryFilterFlags2[QueryFilterFlags2["ONLY_KINEMATIC"] = 5] = "ONLY_KINEMATIC";
74037403- QueryFilterFlags2[QueryFilterFlags2["ONLY_FIXED"] = 6] = "ONLY_FIXED";
74047404-})(QueryFilterFlags || (QueryFilterFlags = {}));
74057405-var QueryPipeline = class {
74067406- constructor(raw) {
74077407- this.raw = raw || new RawQueryPipeline();
74087408- }
74097409- /**
74107410- * Release the WASM memory occupied by this query pipeline.
74117411- */
74127412- free() {
74137413- if (!!this.raw) {
74147414- this.raw.free();
74157415- }
74167416- this.raw = void 0;
74177417- }
74187418- /**
74197419- * Updates the acceleration structure of the query pipeline.
74207420- * @param bodies - The set of rigid-bodies taking part in this pipeline.
74217421- * @param colliders - The set of colliders taking part in this pipeline.
74227422- */
74237423- update(bodies, colliders) {
74247424- this.raw.update(bodies.raw, colliders.raw);
74257425- }
74267426- /**
74277427- * Find the closest intersection between a ray and a set of collider.
74287428- *
74297429- * @param colliders - The set of colliders taking part in this pipeline.
74307430- * @param ray - The ray to cast.
74317431- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
74327432- * limits the length of the ray to `ray.dir.norm() * maxToi`.
74337433- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
74347434- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
74357435- * whereas `false` implies that all shapes are hollow for this ray-cast.
74367436- * @param groups - Used to filter the colliders that can or cannot be hit by the ray.
74377437- * @param filter - The callback to filter out which collider will be hit.
74387438- */
74397439- castRay(bodies, colliders, ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
74407440- let rawOrig = VectorOps.intoRaw(ray.origin);
74417441- let rawDir = VectorOps.intoRaw(ray.dir);
74427442- let result = RayColliderHit.fromRaw(colliders, this.raw.castRay(bodies.raw, colliders.raw, rawOrig, rawDir, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate));
74437443- rawOrig.free();
74447444- rawDir.free();
74457445- return result;
74467446- }
74477447- /**
74487448- * Find the closest intersection between a ray and a set of collider.
74497449- *
74507450- * This also computes the normal at the hit point.
74517451- * @param colliders - The set of colliders taking part in this pipeline.
74527452- * @param ray - The ray to cast.
74537453- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
74547454- * limits the length of the ray to `ray.dir.norm() * maxToi`.
74557455- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
74567456- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
74577457- * whereas `false` implies that all shapes are hollow for this ray-cast.
74587458- * @param groups - Used to filter the colliders that can or cannot be hit by the ray.
74597459- */
74607460- castRayAndGetNormal(bodies, colliders, ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
74617461- let rawOrig = VectorOps.intoRaw(ray.origin);
74627462- let rawDir = VectorOps.intoRaw(ray.dir);
74637463- let result = RayColliderIntersection.fromRaw(colliders, this.raw.castRayAndGetNormal(bodies.raw, colliders.raw, rawOrig, rawDir, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate));
74647464- rawOrig.free();
74657465- rawDir.free();
74667466- return result;
74677467- }
74687468- /**
74697469- * Cast a ray and collects all the intersections between a ray and the scene.
74707470- *
74717471- * @param colliders - The set of colliders taking part in this pipeline.
74727472- * @param ray - The ray to cast.
74737473- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
74747474- * limits the length of the ray to `ray.dir.norm() * maxToi`.
74757475- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
74767476- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
74777477- * whereas `false` implies that all shapes are hollow for this ray-cast.
74787478- * @param groups - Used to filter the colliders that can or cannot be hit by the ray.
74797479- * @param callback - The callback called once per hit (in no particular order) between a ray and a collider.
74807480- * If this callback returns `false`, then the cast will stop and no further hits will be detected/reported.
74817481- */
74827482- intersectionsWithRay(bodies, colliders, ray, maxToi, solid, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
74837483- let rawOrig = VectorOps.intoRaw(ray.origin);
74847484- let rawDir = VectorOps.intoRaw(ray.dir);
74857485- let rawCallback = (rawInter) => {
74867486- return callback(RayColliderIntersection.fromRaw(colliders, rawInter));
74877487- };
74887488- this.raw.intersectionsWithRay(bodies.raw, colliders.raw, rawOrig, rawDir, maxToi, solid, rawCallback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate);
74897489- rawOrig.free();
74907490- rawDir.free();
74917491- }
74927492- /**
74937493- * Gets the handle of up to one collider intersecting the given shape.
74947494- *
74957495- * @param colliders - The set of colliders taking part in this pipeline.
74967496- * @param shapePos - The position of the shape used for the intersection test.
74977497- * @param shapeRot - The orientation of the shape used for the intersection test.
74987498- * @param shape - The shape used for the intersection test.
74997499- * @param groups - The bit groups and filter associated to the ray, in order to only
75007500- * hit the colliders with collision groups compatible with the ray's group.
75017501- */
75027502- intersectionWithShape(bodies, colliders, shapePos, shapeRot, shape, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
75037503- let rawPos = VectorOps.intoRaw(shapePos);
75047504- let rawRot = RotationOps.intoRaw(shapeRot);
75057505- let rawShape = shape.intoRaw();
75067506- let result = this.raw.intersectionWithShape(bodies.raw, colliders.raw, rawPos, rawRot, rawShape, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate);
75077507- rawPos.free();
75087508- rawRot.free();
75097509- rawShape.free();
75107510- return result;
75117511- }
75127512- /**
75137513- * Find the projection of a point on the closest collider.
75147514- *
75157515- * @param colliders - The set of colliders taking part in this pipeline.
75167516- * @param point - The point to project.
75177517- * @param solid - If this is set to `true` then the collider shapes are considered to
75187518- * be plain (if the point is located inside of a plain shape, its projection is the point
75197519- * itself). If it is set to `false` the collider shapes are considered to be hollow
75207520- * (if the point is located inside of an hollow shape, it is projected on the shape's
75217521- * boundary).
75227522- * @param groups - The bit groups and filter associated to the point to project, in order to only
75237523- * project on colliders with collision groups compatible with the ray's group.
75247524- */
75257525- projectPoint(bodies, colliders, point, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
75267526- let rawPoint = VectorOps.intoRaw(point);
75277527- let result = PointColliderProjection.fromRaw(colliders, this.raw.projectPoint(bodies.raw, colliders.raw, rawPoint, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate));
75287528- rawPoint.free();
75297529- return result;
75307530- }
75317531- /**
75327532- * Find the projection of a point on the closest collider.
75337533- *
75347534- * @param colliders - The set of colliders taking part in this pipeline.
75357535- * @param point - The point to project.
75367536- * @param groups - The bit groups and filter associated to the point to project, in order to only
75377537- * project on colliders with collision groups compatible with the ray's group.
75387538- */
75397539- projectPointAndGetFeature(bodies, colliders, point, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
75407540- let rawPoint = VectorOps.intoRaw(point);
75417541- let result = PointColliderProjection.fromRaw(colliders, this.raw.projectPointAndGetFeature(bodies.raw, colliders.raw, rawPoint, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate));
75427542- rawPoint.free();
75437543- return result;
75447544- }
75457545- /**
75467546- * Find all the colliders containing the given point.
75477547- *
75487548- * @param colliders - The set of colliders taking part in this pipeline.
75497549- * @param point - The point used for the containment test.
75507550- * @param groups - The bit groups and filter associated to the point to test, in order to only
75517551- * test on colliders with collision groups compatible with the ray's group.
75527552- * @param callback - A function called with the handles of each collider with a shape
75537553- * containing the `point`.
75547554- */
75557555- intersectionsWithPoint(bodies, colliders, point, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
75567556- let rawPoint = VectorOps.intoRaw(point);
75577557- this.raw.intersectionsWithPoint(bodies.raw, colliders.raw, rawPoint, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate);
75587558- rawPoint.free();
75597559- }
75607560- /**
75617561- * Casts a shape at a constant linear velocity and retrieve the first collider it hits.
75627562- * This is similar to ray-casting except that we are casting a whole shape instead of
75637563- * just a point (the ray origin).
75647564- *
75657565- * @param colliders - The set of colliders taking part in this pipeline.
75667566- * @param shapePos - The initial position of the shape to cast.
75677567- * @param shapeRot - The initial rotation of the shape to cast.
75687568- * @param shapeVel - The constant velocity of the shape to cast (i.e. the cast direction).
75697569- * @param shape - The shape to cast.
75707570- * @param targetDistance − If the shape moves closer to this distance from a collider, a hit
75717571- * will be returned.
75727572- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
75737573- * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.
75747574- * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if
75757575- * the shape is penetrating another shape at its starting point **and** its trajectory is such
75767576- * that it’s on a path to exist that penetration state.
75777577- * @param groups - The bit groups and filter associated to the shape to cast, in order to only
75787578- * test on colliders with collision groups compatible with this group.
75797579- */
75807580- castShape(bodies, colliders, shapePos, shapeRot, shapeVel, shape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
75817581- let rawPos = VectorOps.intoRaw(shapePos);
75827582- let rawRot = RotationOps.intoRaw(shapeRot);
75837583- let rawVel = VectorOps.intoRaw(shapeVel);
75847584- let rawShape = shape.intoRaw();
75857585- let result = ColliderShapeCastHit.fromRaw(colliders, this.raw.castShape(bodies.raw, colliders.raw, rawPos, rawRot, rawVel, rawShape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate));
75867586- rawPos.free();
75877587- rawRot.free();
75887588- rawVel.free();
75897589- rawShape.free();
75907590- return result;
75917591- }
75927592- /**
75937593- * Retrieve all the colliders intersecting the given shape.
75947594- *
75957595- * @param colliders - The set of colliders taking part in this pipeline.
75967596- * @param shapePos - The position of the shape to test.
75977597- * @param shapeRot - The orientation of the shape to test.
75987598- * @param shape - The shape to test.
75997599- * @param groups - The bit groups and filter associated to the shape to test, in order to only
76007600- * test on colliders with collision groups compatible with this group.
76017601- * @param callback - A function called with the handles of each collider intersecting the `shape`.
76027602- */
76037603- intersectionsWithShape(bodies, colliders, shapePos, shapeRot, shape, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
76047604- let rawPos = VectorOps.intoRaw(shapePos);
76057605- let rawRot = RotationOps.intoRaw(shapeRot);
76067606- let rawShape = shape.intoRaw();
76077607- this.raw.intersectionsWithShape(bodies.raw, colliders.raw, rawPos, rawRot, rawShape, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate);
76087608- rawPos.free();
76097609- rawRot.free();
76107610- rawShape.free();
76117611- }
76127612- /**
76137613- * Finds the handles of all the colliders with an AABB intersecting the given AABB.
76147614- *
76157615- * @param aabbCenter - The center of the AABB to test.
76167616- * @param aabbHalfExtents - The half-extents of the AABB to test.
76177617- * @param callback - The callback that will be called with the handles of all the colliders
76187618- * currently intersecting the given AABB.
76197619- */
76207620- collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) {
76217621- let rawCenter = VectorOps.intoRaw(aabbCenter);
76227622- let rawHalfExtents = VectorOps.intoRaw(aabbHalfExtents);
76237623- this.raw.collidersWithAabbIntersectingAabb(rawCenter, rawHalfExtents, callback);
76247624- rawCenter.free();
76257625- rawHalfExtents.free();
76267626- }
76277627-};
76287628-76297629-// ../node_modules/@dimforge/rapier2d/pipeline/serialization_pipeline.js
76307630-var SerializationPipeline = class {
76317631- constructor(raw) {
76327632- this.raw = raw || new RawSerializationPipeline();
76337633- }
76347634- /**
76357635- * Release the WASM memory occupied by this serialization pipeline.
76367636- */
76377637- free() {
76387638- if (!!this.raw) {
76397639- this.raw.free();
76407640- }
76417641- this.raw = void 0;
76427642- }
76437643- /**
76447644- * Serialize a complete physics state into a single byte array.
76457645- * @param gravity - The current gravity affecting the simulation.
76467646- * @param integrationParameters - The integration parameters of the simulation.
76477647- * @param broadPhase - The broad-phase of the simulation.
76487648- * @param narrowPhase - The narrow-phase of the simulation.
76497649- * @param bodies - The rigid-bodies taking part into the simulation.
76507650- * @param colliders - The colliders taking part into the simulation.
76517651- * @param impulseJoints - The impulse joints taking part into the simulation.
76527652- * @param multibodyJoints - The multibody joints taking part into the simulation.
76537653- */
76547654- serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulseJoints, multibodyJoints) {
76557655- let rawGra = VectorOps.intoRaw(gravity);
76567656- const res = this.raw.serializeAll(rawGra, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw);
76577657- rawGra.free();
76587658- return res;
76597659- }
76607660- /**
76617661- * Deserialize the complete physics state from a single byte array.
76627662- *
76637663- * @param data - The byte array to deserialize.
76647664- */
76657665- deserializeAll(data) {
76667666- return World.fromRaw(this.raw.deserializeAll(data));
76677667- }
76687668-};
76697669-76707670-// ../node_modules/@dimforge/rapier2d/pipeline/debug_render_pipeline.js
76717671-var DebugRenderBuffers = class {
76727672- constructor(vertices, colors) {
76737673- this.vertices = vertices;
76747674- this.colors = colors;
76757675- }
76767676-};
76777677-var DebugRenderPipeline = class {
76787678- constructor(raw) {
76797679- this.raw = raw || new RawDebugRenderPipeline();
76807680- }
76817681- /**
76827682- * Release the WASM memory occupied by this serialization pipeline.
76837683- */
76847684- free() {
76857685- if (!!this.raw) {
76867686- this.raw.free();
76877687- }
76887688- this.raw = void 0;
76897689- this.vertices = void 0;
76907690- this.colors = void 0;
76917691- }
76927692- render(bodies, colliders, impulse_joints, multibody_joints, narrow_phase) {
76937693- this.raw.render(bodies.raw, colliders.raw, impulse_joints.raw, multibody_joints.raw, narrow_phase.raw);
76947694- this.vertices = this.raw.vertices();
76957695- this.colors = this.raw.colors();
76967696- }
76977697-};
76987698-76997699-// ../node_modules/@dimforge/rapier2d/control/character_controller.js
77007700-var CharacterCollision = class {
77017701-};
77027702-var KinematicCharacterController = class {
77037703- constructor(offset, params, bodies, colliders, queries) {
77047704- this.params = params;
77057705- this.bodies = bodies;
77067706- this.colliders = colliders;
77077707- this.queries = queries;
77087708- this.raw = new RawKinematicCharacterController(offset);
77097709- this.rawCharacterCollision = new RawCharacterCollision();
77107710- this._applyImpulsesToDynamicBodies = false;
77117711- this._characterMass = null;
77127712- }
77137713- /** @internal */
77147714- free() {
77157715- if (!!this.raw) {
77167716- this.raw.free();
77177717- this.rawCharacterCollision.free();
77187718- }
77197719- this.raw = void 0;
77207720- this.rawCharacterCollision = void 0;
77217721- }
77227722- /**
77237723- * The direction that goes "up". Used to determine where the floor is, and the floor’s angle.
77247724- */
77257725- up() {
77267726- return this.raw.up();
77277727- }
77287728- /**
77297729- * Sets the direction that goes "up". Used to determine where the floor is, and the floor’s angle.
77307730- */
77317731- setUp(vector) {
77327732- let rawVect = VectorOps.intoRaw(vector);
77337733- return this.raw.setUp(rawVect);
77347734- rawVect.free();
77357735- }
77367736- applyImpulsesToDynamicBodies() {
77377737- return this._applyImpulsesToDynamicBodies;
77387738- }
77397739- setApplyImpulsesToDynamicBodies(enabled) {
77407740- this._applyImpulsesToDynamicBodies = enabled;
77417741- }
77427742- /**
77437743- * Returns the custom value of the character mass, if it was set by `this.setCharacterMass`.
77447744- */
77457745- characterMass() {
77467746- return this._characterMass;
77477747- }
77487748- /**
77497749- * Set the mass of the character to be used for impulse resolution if `self.applyImpulsesToDynamicBodies`
77507750- * is set to `true`.
77517751- *
77527752- * If no character mass is set explicitly (or if it is set to `null`) it is automatically assumed to be equal
77537753- * to the mass of the rigid-body the character collider is attached to; or equal to 0 if the character collider
77547754- * isn’t attached to any rigid-body.
77557755- *
77567756- * @param mass - The mass to set.
77577757- */
77587758- setCharacterMass(mass) {
77597759- this._characterMass = mass;
77607760- }
77617761- /**
77627762- * A small gap to preserve between the character and its surroundings.
77637763- *
77647764- * This value should not be too large to avoid visual artifacts, but shouldn’t be too small
77657765- * (must not be zero) to improve numerical stability of the character controller.
77667766- */
77677767- offset() {
77687768- return this.raw.offset();
77697769- }
77707770- /**
77717771- * Sets a small gap to preserve between the character and its surroundings.
77727772- *
77737773- * This value should not be too large to avoid visual artifacts, but shouldn’t be too small
77747774- * (must not be zero) to improve numerical stability of the character controller.
77757775- */
77767776- setOffset(value) {
77777777- this.raw.setOffset(value);
77787778- }
77797779- /// Increase this number if your character appears to get stuck when sliding against surfaces.
77807780- ///
77817781- /// This is a small distance applied to the movement toward the contact normals of shapes hit
77827782- /// by the character controller. This helps shape-casting not getting stuck in an always-penetrating
77837783- /// state during the sliding calculation.
77847784- ///
77857785- /// This value should remain fairly small since it can introduce artificial "bumps" when sliding
77867786- /// along a flat surface.
77877787- normalNudgeFactor() {
77887788- return this.raw.normalNudgeFactor();
77897789- }
77907790- /// Increase this number if your character appears to get stuck when sliding against surfaces.
77917791- ///
77927792- /// This is a small distance applied to the movement toward the contact normals of shapes hit
77937793- /// by the character controller. This helps shape-casting not getting stuck in an always-penetrating
77947794- /// state during the sliding calculation.
77957795- ///
77967796- /// This value should remain fairly small since it can introduce artificial "bumps" when sliding
77977797- /// along a flat surface.
77987798- setNormalNudgeFactor(value) {
77997799- this.raw.setNormalNudgeFactor(value);
78007800- }
78017801- /**
78027802- * Is sliding against obstacles enabled?
78037803- */
78047804- slideEnabled() {
78057805- return this.raw.slideEnabled();
78067806- }
78077807- /**
78087808- * Enable or disable sliding against obstacles.
78097809- */
78107810- setSlideEnabled(enabled) {
78117811- this.raw.setSlideEnabled(enabled);
78127812- }
78137813- /**
78147814- * The maximum step height a character can automatically step over.
78157815- */
78167816- autostepMaxHeight() {
78177817- return this.raw.autostepMaxHeight();
78187818- }
78197819- /**
78207820- * The minimum width of free space that must be available after stepping on a stair.
78217821- */
78227822- autostepMinWidth() {
78237823- return this.raw.autostepMinWidth();
78247824- }
78257825- /**
78267826- * Can the character automatically step over dynamic bodies too?
78277827- */
78287828- autostepIncludesDynamicBodies() {
78297829- return this.raw.autostepIncludesDynamicBodies();
78307830- }
78317831- /**
78327832- * Is automatically stepping over small objects enabled?
78337833- */
78347834- autostepEnabled() {
78357835- return this.raw.autostepEnabled();
78367836- }
78377837- /**
78387838- * Enabled automatically stepping over small objects.
78397839- *
78407840- * @param maxHeight - The maximum step height a character can automatically step over.
78417841- * @param minWidth - The minimum width of free space that must be available after stepping on a stair.
78427842- * @param includeDynamicBodies - Can the character automatically step over dynamic bodies too?
78437843- */
78447844- enableAutostep(maxHeight, minWidth, includeDynamicBodies) {
78457845- this.raw.enableAutostep(maxHeight, minWidth, includeDynamicBodies);
78467846- }
78477847- /**
78487848- * Disable automatically stepping over small objects.
78497849- */
78507850- disableAutostep() {
78517851- return this.raw.disableAutostep();
78527852- }
78537853- /**
78547854- * The maximum angle (radians) between the floor’s normal and the `up` vector that the
78557855- * character is able to climb.
78567856- */
78577857- maxSlopeClimbAngle() {
78587858- return this.raw.maxSlopeClimbAngle();
78597859- }
78607860- /**
78617861- * Sets the maximum angle (radians) between the floor’s normal and the `up` vector that the
78627862- * character is able to climb.
78637863- */
78647864- setMaxSlopeClimbAngle(angle) {
78657865- this.raw.setMaxSlopeClimbAngle(angle);
78667866- }
78677867- /**
78687868- * The minimum angle (radians) between the floor’s normal and the `up` vector before the
78697869- * character starts to slide down automatically.
78707870- */
78717871- minSlopeSlideAngle() {
78727872- return this.raw.minSlopeSlideAngle();
78737873- }
78747874- /**
78757875- * Sets the minimum angle (radians) between the floor’s normal and the `up` vector before the
78767876- * character starts to slide down automatically.
78777877- */
78787878- setMinSlopeSlideAngle(angle) {
78797879- this.raw.setMinSlopeSlideAngle(angle);
78807880- }
78817881- /**
78827882- * If snap-to-ground is enabled, should the character be automatically snapped to the ground if
78837883- * the distance between the ground and its feet are smaller than the specified threshold?
78847884- */
78857885- snapToGroundDistance() {
78867886- return this.raw.snapToGroundDistance();
78877887- }
78887888- /**
78897889- * Enables automatically snapping the character to the ground if the distance between
78907890- * the ground and its feet are smaller than the specified threshold.
78917891- */
78927892- enableSnapToGround(distance) {
78937893- this.raw.enableSnapToGround(distance);
78947894- }
78957895- /**
78967896- * Disables automatically snapping the character to the ground.
78977897- */
78987898- disableSnapToGround() {
78997899- this.raw.disableSnapToGround();
79007900- }
79017901- /**
79027902- * Is automatically snapping the character to the ground enabled?
79037903- */
79047904- snapToGroundEnabled() {
79057905- return this.raw.snapToGroundEnabled();
79067906- }
79077907- /**
79087908- * Computes the movement the given collider is able to execute after hitting and sliding on obstacles.
79097909- *
79107910- * @param collider - The collider to move.
79117911- * @param desiredTranslationDelta - The desired collider movement.
79127912- * @param filterFlags - Flags for excluding whole subsets of colliders from the obstacles taken into account.
79137913- * @param filterGroups - Groups for excluding colliders with incompatible collision groups from the obstacles
79147914- * taken into account.
79157915- * @param filterPredicate - Any collider for which this closure returns `false` will be excluded from the
79167916- * obstacles taken into account.
79177917- */
79187918- computeColliderMovement(collider, desiredTranslationDelta, filterFlags, filterGroups, filterPredicate) {
79197919- let rawTranslationDelta = VectorOps.intoRaw(desiredTranslationDelta);
79207920- this.raw.computeColliderMovement(this.params.dt, this.bodies.raw, this.colliders.raw, this.queries.raw, collider.handle, rawTranslationDelta, this._applyImpulsesToDynamicBodies, this._characterMass, filterFlags, filterGroups, this.colliders.castClosure(filterPredicate));
79217921- rawTranslationDelta.free();
79227922- }
79237923- /**
79247924- * The movement computed by the last call to `this.computeColliderMovement`.
79257925- */
79267926- computedMovement() {
79277927- return VectorOps.fromRaw(this.raw.computedMovement());
79287928- }
79297929- /**
79307930- * The result of ground detection computed by the last call to `this.computeColliderMovement`.
79317931- */
79327932- computedGrounded() {
79337933- return this.raw.computedGrounded();
79347934- }
79357935- /**
79367936- * The number of collisions against obstacles detected along the path of the last call
79377937- * to `this.computeColliderMovement`.
79387938- */
79397939- numComputedCollisions() {
79407940- return this.raw.numComputedCollisions();
79417941- }
79427942- /**
79437943- * Returns the collision against one of the obstacles detected along the path of the last
79447944- * call to `this.computeColliderMovement`.
79457945- *
79467946- * @param i - The i-th collision will be returned.
79477947- * @param out - If this argument is set, it will be filled with the collision information.
79487948- */
79497949- computedCollision(i, out) {
79507950- if (!this.raw.computedCollision(i, this.rawCharacterCollision)) {
79517951- return null;
79527952- } else {
79537953- let c = this.rawCharacterCollision;
79547954- out = out !== null && out !== void 0 ? out : new CharacterCollision();
79557955- out.translationDeltaApplied = VectorOps.fromRaw(c.translationDeltaApplied());
79567956- out.translationDeltaRemaining = VectorOps.fromRaw(c.translationDeltaRemaining());
79577957- out.toi = c.toi();
79587958- out.witness1 = VectorOps.fromRaw(c.worldWitness1());
79597959- out.witness2 = VectorOps.fromRaw(c.worldWitness2());
79607960- out.normal1 = VectorOps.fromRaw(c.worldNormal1());
79617961- out.normal2 = VectorOps.fromRaw(c.worldNormal2());
79627962- out.collider = this.colliders.get(c.handle());
79637963- return out;
79647964- }
79657965- }
79667966-};
79677967-79687968-// ../node_modules/@dimforge/rapier2d/pipeline/world.js
79697969-var World = class _World {
79707970- constructor(gravity, rawIntegrationParameters, rawIslands, rawBroadPhase, rawNarrowPhase, rawBodies, rawColliders, rawImpulseJoints, rawMultibodyJoints, rawCCDSolver, rawQueryPipeline, rawPhysicsPipeline, rawSerializationPipeline, rawDebugRenderPipeline) {
79717971- this.gravity = gravity;
79727972- this.integrationParameters = new IntegrationParameters(rawIntegrationParameters);
79737973- this.islands = new IslandManager(rawIslands);
79747974- this.broadPhase = new BroadPhase(rawBroadPhase);
79757975- this.narrowPhase = new NarrowPhase(rawNarrowPhase);
79767976- this.bodies = new RigidBodySet(rawBodies);
79777977- this.colliders = new ColliderSet(rawColliders);
79787978- this.impulseJoints = new ImpulseJointSet(rawImpulseJoints);
79797979- this.multibodyJoints = new MultibodyJointSet(rawMultibodyJoints);
79807980- this.ccdSolver = new CCDSolver(rawCCDSolver);
79817981- this.queryPipeline = new QueryPipeline(rawQueryPipeline);
79827982- this.physicsPipeline = new PhysicsPipeline(rawPhysicsPipeline);
79837983- this.serializationPipeline = new SerializationPipeline(rawSerializationPipeline);
79847984- this.debugRenderPipeline = new DebugRenderPipeline(rawDebugRenderPipeline);
79857985- this.characterControllers = /* @__PURE__ */ new Set();
79867986- this.impulseJoints.finalizeDeserialization(this.bodies);
79877987- this.bodies.finalizeDeserialization(this.colliders);
79887988- this.colliders.finalizeDeserialization(this.bodies);
79897989- }
79907990- /**
79917991- * Release the WASM memory occupied by this physics world.
79927992- *
79937993- * All the fields of this physics world will be freed as well,
79947994- * so there is no need to call their `.free()` methods individually.
79957995- */
79967996- free() {
79977997- this.integrationParameters.free();
79987998- this.islands.free();
79997999- this.broadPhase.free();
80008000- this.narrowPhase.free();
80018001- this.bodies.free();
80028002- this.colliders.free();
80038003- this.impulseJoints.free();
80048004- this.multibodyJoints.free();
80058005- this.ccdSolver.free();
80068006- this.queryPipeline.free();
80078007- this.physicsPipeline.free();
80088008- this.serializationPipeline.free();
80098009- this.debugRenderPipeline.free();
80108010- this.characterControllers.forEach((controller) => controller.free());
80118011- this.integrationParameters = void 0;
80128012- this.islands = void 0;
80138013- this.broadPhase = void 0;
80148014- this.narrowPhase = void 0;
80158015- this.bodies = void 0;
80168016- this.colliders = void 0;
80178017- this.ccdSolver = void 0;
80188018- this.impulseJoints = void 0;
80198019- this.multibodyJoints = void 0;
80208020- this.queryPipeline = void 0;
80218021- this.physicsPipeline = void 0;
80228022- this.serializationPipeline = void 0;
80238023- this.debugRenderPipeline = void 0;
80248024- this.characterControllers = void 0;
80258025- }
80268026- static fromRaw(raw) {
80278027- if (!raw)
80288028- return null;
80298029- return new _World(VectorOps.fromRaw(raw.takeGravity()), raw.takeIntegrationParameters(), raw.takeIslandManager(), raw.takeBroadPhase(), raw.takeNarrowPhase(), raw.takeBodies(), raw.takeColliders(), raw.takeImpulseJoints(), raw.takeMultibodyJoints());
80308030- }
80318031- /**
80328032- * Takes a snapshot of this world.
80338033- *
80348034- * Use `World.restoreSnapshot` to create a new physics world with a state identical to
80358035- * the state when `.takeSnapshot()` is called.
80368036- */
80378037- takeSnapshot() {
80388038- return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints);
80398039- }
80408040- /**
80418041- * Creates a new physics world from a snapshot.
80428042- *
80438043- * This new physics world will be an identical copy of the snapshoted physics world.
80448044- */
80458045- static restoreSnapshot(data) {
80468046- let deser = new SerializationPipeline();
80478047- return deser.deserializeAll(data);
80488048- }
80498049- /**
80508050- * Computes all the lines (and their colors) needed to render the scene.
80518051- */
80528052- debugRender() {
80538053- this.debugRenderPipeline.render(this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints, this.narrowPhase);
80548054- return new DebugRenderBuffers(this.debugRenderPipeline.vertices, this.debugRenderPipeline.colors);
80558055- }
80568056- /**
80578057- * Advance the simulation by one time step.
80588058- *
80598059- * All events generated by the physics engine are ignored.
80608060- *
80618061- * @param EventQueue - (optional) structure responsible for collecting
80628062- * events generated by the physics engine.
80638063- */
80648064- step(eventQueue, hooks) {
80658065- this.physicsPipeline.step(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints, this.ccdSolver, eventQueue, hooks);
80668066- this.queryPipeline.update(this.bodies, this.colliders);
80678067- }
80688068- /**
80698069- * Update colliders positions after rigid-bodies moved.
80708070- *
80718071- * When a rigid-body moves, the positions of the colliders attached to it need to be updated. This update is
80728072- * generally automatically done at the beginning and the end of each simulation step with World.step.
80738073- * If the positions need to be updated without running a simulation step this method can be called manually.
80748074- */
80758075- propagateModifiedBodyPositionsToColliders() {
80768076- this.bodies.raw.propagateModifiedBodyPositionsToColliders(this.colliders.raw);
80778077- }
80788078- /**
80798079- * Ensure subsequent scene queries take into account the collider positions set before this method is called.
80808080- *
80818081- * This does not step the physics simulation forward.
80828082- */
80838083- updateSceneQueries() {
80848084- this.propagateModifiedBodyPositionsToColliders();
80858085- this.queryPipeline.update(this.bodies, this.colliders);
80868086- }
80878087- /**
80888088- * The current simulation timestep.
80898089- */
80908090- get timestep() {
80918091- return this.integrationParameters.dt;
80928092- }
80938093- /**
80948094- * Sets the new simulation timestep.
80958095- *
80968096- * The simulation timestep governs by how much the physics state of the world will
80978097- * be integrated. A simulation timestep should:
80988098- * - be as small as possible. Typical values evolve around 0.016 (assuming the chosen unit is milliseconds,
80998099- * corresponds to the time between two frames of a game running at 60FPS).
81008100- * - not vary too much during the course of the simulation. A timestep with large variations may
81018101- * cause instabilities in the simulation.
81028102- *
81038103- * @param dt - The timestep length, in seconds.
81048104- */
81058105- set timestep(dt) {
81068106- this.integrationParameters.dt = dt;
81078107- }
81088108- /**
81098109- * The approximate size of most dynamic objects in the scene.
81108110- *
81118111- * See the documentation of the `World.lengthUnit` setter for further details.
81128112- */
81138113- get lengthUnit() {
81148114- return this.integrationParameters.lengthUnit;
81158115- }
81168116- /**
81178117- * The approximate size of most dynamic objects in the scene.
81188118- *
81198119- * This value is used internally to estimate some length-based tolerance. In particular, the
81208120- * values `IntegrationParameters.allowedLinearError`,
81218121- * `IntegrationParameters.maxPenetrationCorrection`,
81228122- * `IntegrationParameters.predictionDistance`, `RigidBodyActivation.linearThreshold`
81238123- * are scaled by this value implicitly.
81248124- *
81258125- * This value can be understood as the number of units-per-meter in your physical world compared
81268126- * to a human-sized world in meter. For example, in a 2d game, if your typical object size is 100
81278127- * pixels, set the `[`Self::length_unit`]` parameter to 100.0. The physics engine will interpret
81288128- * it as if 100 pixels is equivalent to 1 meter in its various internal threshold.
81298129- * (default `1.0`).
81308130- */
81318131- set lengthUnit(unitsPerMeter) {
81328132- this.integrationParameters.lengthUnit = unitsPerMeter;
81338133- }
81348134- /**
81358135- * The number of solver iterations run by the constraints solver for calculating forces (default: `4`).
81368136- */
81378137- get numSolverIterations() {
81388138- return this.integrationParameters.numSolverIterations;
81398139- }
81408140- /**
81418141- * Sets the number of solver iterations run by the constraints solver for calculating forces (default: `4`).
81428142- *
81438143- * The greater this value is, the most rigid and realistic the physics simulation will be.
81448144- * However a greater number of iterations is more computationally intensive.
81458145- *
81468146- * @param niter - The new number of solver iterations.
81478147- */
81488148- set numSolverIterations(niter) {
81498149- this.integrationParameters.numSolverIterations = niter;
81508150- }
81518151- /**
81528152- * Number of addition friction resolution iteration run during the last solver sub-step (default: `4`).
81538153- */
81548154- get numAdditionalFrictionIterations() {
81558155- return this.integrationParameters.numAdditionalFrictionIterations;
81568156- }
81578157- /**
81588158- * Sets the number of addition friction resolution iteration run during the last solver sub-step (default: `4`).
81598159- *
81608160- * The greater this value is, the most realistic friction will be.
81618161- * However a greater number of iterations is more computationally intensive.
81628162- *
81638163- * @param niter - The new number of additional friction iterations.
81648164- */
81658165- set numAdditionalFrictionIterations(niter) {
81668166- this.integrationParameters.numAdditionalFrictionIterations = niter;
81678167- }
81688168- /**
81698169- * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).
81708170- */
81718171- get numInternalPgsIterations() {
81728172- return this.integrationParameters.numInternalPgsIterations;
81738173- }
81748174- /**
81758175- * Sets the Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).
81768176- *
81778177- * Increasing this parameter will improve stability of the simulation. It will have a lesser effect than
81788178- * increasing `numSolverIterations` but is also less computationally expensive.
81798179- *
81808180- * @param niter - The new number of internal PGS iterations.
81818181- */
81828182- set numInternalPgsIterations(niter) {
81838183- this.integrationParameters.numInternalPgsIterations = niter;
81848184- }
81858185- /// Configures the integration parameters to match the old PGS solver
81868186- /// from Rapier JS version <= 0.11.
81878187- ///
81888188- /// This solver was slightly faster than the new one but resulted
81898189- /// in less stable joints and worse convergence rates.
81908190- ///
81918191- /// This should only be used for comparison purpose or if you are
81928192- /// experiencing problems with the new solver.
81938193- ///
81948194- /// NOTE: this does not affect any `RigidBody.additional_solver_iterations` that will
81958195- /// still create solver iterations based on the new "small-steps" PGS solver.
81968196- switchToStandardPgsSolver() {
81978197- this.integrationParameters.switchToStandardPgsSolver();
81988198- }
81998199- /// Configures the integration parameters to match the new "small-steps" PGS solver
82008200- /// from Rapier version >= 0.12.
82018201- ///
82028202- /// The "small-steps" PGS solver is the default one when creating the physics world. So
82038203- /// calling this function is generally not needed unless `World.switch_to_standard_pgs_solver`
82048204- /// was called.
82058205- ///
82068206- /// This solver results in more stable joints and significantly better convergence
82078207- /// rates but is slightly slower in its default settings.
82088208- switchToSmallStepsPgsSolver() {
82098209- this.integrationParameters.switchToSmallStepsPgsSolver();
82108210- }
82118211- /// Configures the integration parameters to match the new "small-steps" PGS solver
82128212- /// from Rapier version >= 0.12. Warmstarting is disabled.
82138213- ///
82148214- /// The "small-steps" PGS solver is the default one when creating the physics world. So
82158215- /// calling this function is generally not needed unless `World.switch_to_standard_pgs_solver`
82168216- /// was called.
82178217- ///
82188218- /// This solver results in more stable joints and significantly better convergence
82198219- /// rates but is slightly slower in its default settings.
82208220- switchToSmallStepsPgsSolverWithoutWarmstart() {
82218221- this.integrationParameters.switchToSmallStepsPgsSolverWithoutWarmstart();
82228222- }
82238223- /**
82248224- * Creates a new rigid-body from the given rigid-body descriptor.
82258225- *
82268226- * @param body - The description of the rigid-body to create.
82278227- */
82288228- createRigidBody(body) {
82298229- return this.bodies.createRigidBody(this.colliders, body);
82308230- }
82318231- /**
82328232- * Creates a new character controller.
82338233- *
82348234- * @param offset - The artificial gap added between the character’s chape and its environment.
82358235- */
82368236- createCharacterController(offset) {
82378237- let controller = new KinematicCharacterController(offset, this.integrationParameters, this.bodies, this.colliders, this.queryPipeline);
82388238- this.characterControllers.add(controller);
82398239- return controller;
82408240- }
82418241- /**
82428242- * Removes a character controller from this world.
82438243- *
82448244- * @param controller - The character controller to remove.
82458245- */
82468246- removeCharacterController(controller) {
82478247- this.characterControllers.delete(controller);
82488248- controller.free();
82498249- }
82508250- /**
82518251- * Creates a new collider.
82528252- *
82538253- * @param desc - The description of the collider.
82548254- * @param parent - The rigid-body this collider is attached to.
82558255- */
82568256- createCollider(desc, parent) {
82578257- let parentHandle = parent ? parent.handle : void 0;
82588258- return this.colliders.createCollider(this.bodies, desc, parentHandle);
82598259- }
82608260- /**
82618261- * Creates a new impulse joint from the given joint descriptor.
82628262- *
82638263- * @param params - The description of the joint to create.
82648264- * @param parent1 - The first rigid-body attached to this joint.
82658265- * @param parent2 - The second rigid-body attached to this joint.
82668266- * @param wakeUp - Should the attached rigid-bodies be awakened?
82678267- */
82688268- createImpulseJoint(params, parent1, parent2, wakeUp) {
82698269- return this.impulseJoints.createJoint(this.bodies, params, parent1.handle, parent2.handle, wakeUp);
82708270- }
82718271- /**
82728272- * Creates a new multibody joint from the given joint descriptor.
82738273- *
82748274- * @param params - The description of the joint to create.
82758275- * @param parent1 - The first rigid-body attached to this joint.
82768276- * @param parent2 - The second rigid-body attached to this joint.
82778277- * @param wakeUp - Should the attached rigid-bodies be awakened?
82788278- */
82798279- createMultibodyJoint(params, parent1, parent2, wakeUp) {
82808280- return this.multibodyJoints.createJoint(params, parent1.handle, parent2.handle, wakeUp);
82818281- }
82828282- /**
82838283- * Retrieves a rigid-body from its handle.
82848284- *
82858285- * @param handle - The integer handle of the rigid-body to retrieve.
82868286- */
82878287- getRigidBody(handle) {
82888288- return this.bodies.get(handle);
82898289- }
82908290- /**
82918291- * Retrieves a collider from its handle.
82928292- *
82938293- * @param handle - The integer handle of the collider to retrieve.
82948294- */
82958295- getCollider(handle) {
82968296- return this.colliders.get(handle);
82978297- }
82988298- /**
82998299- * Retrieves an impulse joint from its handle.
83008300- *
83018301- * @param handle - The integer handle of the impulse joint to retrieve.
83028302- */
83038303- getImpulseJoint(handle) {
83048304- return this.impulseJoints.get(handle);
83058305- }
83068306- /**
83078307- * Retrieves an multibody joint from its handle.
83088308- *
83098309- * @param handle - The integer handle of the multibody joint to retrieve.
83108310- */
83118311- getMultibodyJoint(handle) {
83128312- return this.multibodyJoints.get(handle);
83138313- }
83148314- /**
83158315- * Removes the given rigid-body from this physics world.
83168316- *
83178317- * This will remove this rigid-body as well as all its attached colliders and joints.
83188318- * Every other bodies touching or attached by joints to this rigid-body will be woken-up.
83198319- *
83208320- * @param body - The rigid-body to remove.
83218321- */
83228322- removeRigidBody(body) {
83238323- if (this.bodies) {
83248324- this.bodies.remove(body.handle, this.islands, this.colliders, this.impulseJoints, this.multibodyJoints);
83258325- }
83268326- }
83278327- /**
83288328- * Removes the given collider from this physics world.
83298329- *
83308330- * @param collider - The collider to remove.
83318331- * @param wakeUp - If set to `true`, the rigid-body this collider is attached to will be awaken.
83328332- */
83338333- removeCollider(collider, wakeUp) {
83348334- if (this.colliders) {
83358335- this.colliders.remove(collider.handle, this.islands, this.bodies, wakeUp);
83368336- }
83378337- }
83388338- /**
83398339- * Removes the given impulse joint from this physics world.
83408340- *
83418341- * @param joint - The impulse joint to remove.
83428342- * @param wakeUp - If set to `true`, the rigid-bodies attached by this joint will be awaken.
83438343- */
83448344- removeImpulseJoint(joint, wakeUp) {
83458345- if (this.impulseJoints) {
83468346- this.impulseJoints.remove(joint.handle, wakeUp);
83478347- }
83488348- }
83498349- /**
83508350- * Removes the given multibody joint from this physics world.
83518351- *
83528352- * @param joint - The multibody joint to remove.
83538353- * @param wakeUp - If set to `true`, the rigid-bodies attached by this joint will be awaken.
83548354- */
83558355- removeMultibodyJoint(joint, wakeUp) {
83568356- if (this.impulseJoints) {
83578357- this.multibodyJoints.remove(joint.handle, wakeUp);
83588358- }
83598359- }
83608360- /**
83618361- * Applies the given closure to each collider managed by this physics world.
83628362- *
83638363- * @param f(collider) - The function to apply to each collider managed by this physics world. Called as `f(collider)`.
83648364- */
83658365- forEachCollider(f) {
83668366- this.colliders.forEach(f);
83678367- }
83688368- /**
83698369- * Applies the given closure to each rigid-body managed by this physics world.
83708370- *
83718371- * @param f(body) - The function to apply to each rigid-body managed by this physics world. Called as `f(collider)`.
83728372- */
83738373- forEachRigidBody(f) {
83748374- this.bodies.forEach(f);
83758375- }
83768376- /**
83778377- * Applies the given closure to each active rigid-body managed by this physics world.
83788378- *
83798379- * After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by
83808380- * the physics engine in order to save computational power. A sleeping rigid-body never moves
83818381- * unless it is moved manually by the user.
83828382- *
83838383- * @param f - The function to apply to each active rigid-body managed by this physics world. Called as `f(collider)`.
83848384- */
83858385- forEachActiveRigidBody(f) {
83868386- this.bodies.forEachActiveRigidBody(this.islands, f);
83878387- }
83888388- /**
83898389- * Find the closest intersection between a ray and the physics world.
83908390- *
83918391- * @param ray - The ray to cast.
83928392- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
83938393- * limits the length of the ray to `ray.dir.norm() * maxToi`.
83948394- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
83958395- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
83968396- * whereas `false` implies that all shapes are hollow for this ray-cast.
83978397- * @param groups - Used to filter the colliders that can or cannot be hit by the ray.
83988398- * @param filter - The callback to filter out which collider will be hit.
83998399- */
84008400- castRay(ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84018401- return this.queryPipeline.castRay(this.bodies, this.colliders, ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84028402- }
84038403- /**
84048404- * Find the closest intersection between a ray and the physics world.
84058405- *
84068406- * This also computes the normal at the hit point.
84078407- * @param ray - The ray to cast.
84088408- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
84098409- * limits the length of the ray to `ray.dir.norm() * maxToi`.
84108410- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
84118411- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
84128412- * whereas `false` implies that all shapes are hollow for this ray-cast.
84138413- * @param groups - Used to filter the colliders that can or cannot be hit by the ray.
84148414- */
84158415- castRayAndGetNormal(ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84168416- return this.queryPipeline.castRayAndGetNormal(this.bodies, this.colliders, ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84178417- }
84188418- /**
84198419- * Cast a ray and collects all the intersections between a ray and the scene.
84208420- *
84218421- * @param ray - The ray to cast.
84228422- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
84238423- * limits the length of the ray to `ray.dir.norm() * maxToi`.
84248424- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
84258425- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
84268426- * whereas `false` implies that all shapes are hollow for this ray-cast.
84278427- * @param groups - Used to filter the colliders that can or cannot be hit by the ray.
84288428- * @param callback - The callback called once per hit (in no particular order) between a ray and a collider.
84298429- * If this callback returns `false`, then the cast will stop and no further hits will be detected/reported.
84308430- */
84318431- intersectionsWithRay(ray, maxToi, solid, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84328432- this.queryPipeline.intersectionsWithRay(this.bodies, this.colliders, ray, maxToi, solid, callback, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84338433- }
84348434- /**
84358435- * Gets the handle of up to one collider intersecting the given shape.
84368436- *
84378437- * @param shapePos - The position of the shape used for the intersection test.
84388438- * @param shapeRot - The orientation of the shape used for the intersection test.
84398439- * @param shape - The shape used for the intersection test.
84408440- * @param groups - The bit groups and filter associated to the ray, in order to only
84418441- * hit the colliders with collision groups compatible with the ray's group.
84428442- */
84438443- intersectionWithShape(shapePos, shapeRot, shape, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84448444- let handle = this.queryPipeline.intersectionWithShape(this.bodies, this.colliders, shapePos, shapeRot, shape, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84458445- return handle != null ? this.colliders.get(handle) : null;
84468446- }
84478447- /**
84488448- * Find the projection of a point on the closest collider.
84498449- *
84508450- * @param point - The point to project.
84518451- * @param solid - If this is set to `true` then the collider shapes are considered to
84528452- * be plain (if the point is located inside of a plain shape, its projection is the point
84538453- * itself). If it is set to `false` the collider shapes are considered to be hollow
84548454- * (if the point is located inside of an hollow shape, it is projected on the shape's
84558455- * boundary).
84568456- * @param groups - The bit groups and filter associated to the point to project, in order to only
84578457- * project on colliders with collision groups compatible with the ray's group.
84588458- */
84598459- projectPoint(point, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84608460- return this.queryPipeline.projectPoint(this.bodies, this.colliders, point, solid, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84618461- }
84628462- /**
84638463- * Find the projection of a point on the closest collider.
84648464- *
84658465- * @param point - The point to project.
84668466- * @param groups - The bit groups and filter associated to the point to project, in order to only
84678467- * project on colliders with collision groups compatible with the ray's group.
84688468- */
84698469- projectPointAndGetFeature(point, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84708470- return this.queryPipeline.projectPointAndGetFeature(this.bodies, this.colliders, point, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84718471- }
84728472- /**
84738473- * Find all the colliders containing the given point.
84748474- *
84758475- * @param point - The point used for the containment test.
84768476- * @param groups - The bit groups and filter associated to the point to test, in order to only
84778477- * test on colliders with collision groups compatible with the ray's group.
84788478- * @param callback - A function called with the handles of each collider with a shape
84798479- * containing the `point`.
84808480- */
84818481- intersectionsWithPoint(point, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
84828482- this.queryPipeline.intersectionsWithPoint(this.bodies, this.colliders, point, this.colliders.castClosure(callback), filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
84838483- }
84848484- /**
84858485- * Casts a shape at a constant linear velocity and retrieve the first collider it hits.
84868486- * This is similar to ray-casting except that we are casting a whole shape instead of
84878487- * just a point (the ray origin).
84888488- *
84898489- * @param shapePos - The initial position of the shape to cast.
84908490- * @param shapeRot - The initial rotation of the shape to cast.
84918491- * @param shapeVel - The constant velocity of the shape to cast (i.e. the cast direction).
84928492- * @param shape - The shape to cast.
84938493- * @param targetDistance − If the shape moves closer to this distance from a collider, a hit
84948494- * will be returned.
84958495- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
84968496- * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.
84978497- * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if
84988498- * the shape is penetrating another shape at its starting point **and** its trajectory is such
84998499- * that it’s on a path to exist that penetration state.
85008500- * @param groups - The bit groups and filter associated to the shape to cast, in order to only
85018501- * test on colliders with collision groups compatible with this group.
85028502- */
85038503- castShape(shapePos, shapeRot, shapeVel, shape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
85048504- return this.queryPipeline.castShape(this.bodies, this.colliders, shapePos, shapeRot, shapeVel, shape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
85058505- }
85068506- /**
85078507- * Retrieve all the colliders intersecting the given shape.
85088508- *
85098509- * @param shapePos - The position of the shape to test.
85108510- * @param shapeRot - The orientation of the shape to test.
85118511- * @param shape - The shape to test.
85128512- * @param groups - The bit groups and filter associated to the shape to test, in order to only
85138513- * test on colliders with collision groups compatible with this group.
85148514- * @param callback - A function called with the handles of each collider intersecting the `shape`.
85158515- */
85168516- intersectionsWithShape(shapePos, shapeRot, shape, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) {
85178517- this.queryPipeline.intersectionsWithShape(this.bodies, this.colliders, shapePos, shapeRot, shape, this.colliders.castClosure(callback), filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate));
85188518- }
85198519- /**
85208520- * Finds the handles of all the colliders with an AABB intersecting the given AABB.
85218521- *
85228522- * @param aabbCenter - The center of the AABB to test.
85238523- * @param aabbHalfExtents - The half-extents of the AABB to test.
85248524- * @param callback - The callback that will be called with the handles of all the colliders
85258525- * currently intersecting the given AABB.
85268526- */
85278527- collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) {
85288528- this.queryPipeline.collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, this.colliders.castClosure(callback));
85298529- }
85308530- /**
85318531- * Enumerates all the colliders potentially in contact with the given collider.
85328532- *
85338533- * @param collider1 - The second collider involved in the contact.
85348534- * @param f - Closure that will be called on each collider that is in contact with `collider1`.
85358535- */
85368536- contactPairsWith(collider1, f) {
85378537- this.narrowPhase.contactPairsWith(collider1.handle, this.colliders.castClosure(f));
85388538- }
85398539- /**
85408540- * Enumerates all the colliders intersecting the given colliders, assuming one of them
85418541- * is a sensor.
85428542- */
85438543- intersectionPairsWith(collider1, f) {
85448544- this.narrowPhase.intersectionPairsWith(collider1.handle, this.colliders.castClosure(f));
85458545- }
85468546- /**
85478547- * Iterates through all the contact manifolds between the given pair of colliders.
85488548- *
85498549- * @param collider1 - The first collider involved in the contact.
85508550- * @param collider2 - The second collider involved in the contact.
85518551- * @param f - Closure that will be called on each contact manifold between the two colliders. If the second argument
85528552- * passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1`
85538553- * actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`.
85548554- */
85558555- contactPair(collider1, collider2, f) {
85568556- this.narrowPhase.contactPair(collider1.handle, collider2.handle, f);
85578557- }
85588558- /**
85598559- * Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor.
85608560- * @param collider1 − The first collider involved in the intersection.
85618561- * @param collider2 − The second collider involved in the intersection.
85628562- */
85638563- intersectionPair(collider1, collider2) {
85648564- return this.narrowPhase.intersectionPair(collider1.handle, collider2.handle);
85658565- }
85668566-};
85678567-85688568-// ../node_modules/@dimforge/rapier2d/pipeline/event_queue.js
85698569-var ActiveEvents;
85708570-(function(ActiveEvents2) {
85718571- ActiveEvents2[ActiveEvents2["NONE"] = 0] = "NONE";
85728572- ActiveEvents2[ActiveEvents2["COLLISION_EVENTS"] = 1] = "COLLISION_EVENTS";
85738573- ActiveEvents2[ActiveEvents2["CONTACT_FORCE_EVENTS"] = 2] = "CONTACT_FORCE_EVENTS";
85748574-})(ActiveEvents || (ActiveEvents = {}));
85758575-var TempContactForceEvent = class {
85768576- free() {
85778577- if (!!this.raw) {
85788578- this.raw.free();
85798579- }
85808580- this.raw = void 0;
85818581- }
85828582- /**
85838583- * The first collider involved in the contact.
85848584- */
85858585- collider1() {
85868586- return this.raw.collider1();
85878587- }
85888588- /**
85898589- * The second collider involved in the contact.
85908590- */
85918591- collider2() {
85928592- return this.raw.collider2();
85938593- }
85948594- /**
85958595- * The sum of all the forces between the two colliders.
85968596- */
85978597- totalForce() {
85988598- return VectorOps.fromRaw(this.raw.total_force());
85998599- }
86008600- /**
86018601- * The sum of the magnitudes of each force between the two colliders.
86028602- *
86038603- * Note that this is **not** the same as the magnitude of `self.total_force`.
86048604- * Here we are summing the magnitude of all the forces, instead of taking
86058605- * the magnitude of their sum.
86068606- */
86078607- totalForceMagnitude() {
86088608- return this.raw.total_force_magnitude();
86098609- }
86108610- /**
86118611- * The world-space (unit) direction of the force with strongest magnitude.
86128612- */
86138613- maxForceDirection() {
86148614- return VectorOps.fromRaw(this.raw.max_force_direction());
86158615- }
86168616- /**
86178617- * The magnitude of the largest force at a contact point of this contact pair.
86188618- */
86198619- maxForceMagnitude() {
86208620- return this.raw.max_force_magnitude();
86218621- }
86228622-};
86238623-var EventQueue = class {
86248624- /**
86258625- * Creates a new event collector.
86268626- *
86278627- * @param autoDrain -setting this to `true` is strongly recommended. If true, the collector will
86288628- * be automatically drained before each `world.step(collector)`. If false, the collector will
86298629- * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of
86308630- * RAM if no drain is performed.
86318631- */
86328632- constructor(autoDrain, raw) {
86338633- this.raw = raw || new RawEventQueue(autoDrain);
86348634- }
86358635- /**
86368636- * Release the WASM memory occupied by this event-queue.
86378637- */
86388638- free() {
86398639- if (!!this.raw) {
86408640- this.raw.free();
86418641- }
86428642- this.raw = void 0;
86438643- }
86448644- /**
86458645- * Applies the given javascript closure on each collision event of this collector, then clear
86468646- * the internal collision event buffer.
86478647- *
86488648- * @param f - JavaScript closure applied to each collision event. The
86498649- * closure must take three arguments: two integers representing the handles of the colliders
86508650- * involved in the collision, and a boolean indicating if the collision started (true) or stopped
86518651- * (false).
86528652- */
86538653- drainCollisionEvents(f) {
86548654- this.raw.drainCollisionEvents(f);
86558655- }
86568656- /**
86578657- * Applies the given javascript closure on each contact force event of this collector, then clear
86588658- * the internal collision event buffer.
86598659- *
86608660- * @param f - JavaScript closure applied to each collision event. The
86618661- * closure must take one `TempContactForceEvent` argument.
86628662- */
86638663- drainContactForceEvents(f) {
86648664- let event = new TempContactForceEvent();
86658665- this.raw.drainContactForceEvents((raw) => {
86668666- event.raw = raw;
86678667- f(event);
86688668- event.free();
86698669- });
86708670- }
86718671- /**
86728672- * Removes all events contained by this collector
86738673- */
86748674- clear() {
86758675- this.raw.clear();
86768676- }
86778677-};
86788678-86798679-// ../node_modules/@dimforge/rapier2d/pipeline/physics_hooks.js
86808680-var ActiveHooks;
86818681-(function(ActiveHooks2) {
86828682- ActiveHooks2[ActiveHooks2["NONE"] = 0] = "NONE";
86838683- ActiveHooks2[ActiveHooks2["FILTER_CONTACT_PAIRS"] = 1] = "FILTER_CONTACT_PAIRS";
86848684- ActiveHooks2[ActiveHooks2["FILTER_INTERSECTION_PAIRS"] = 2] = "FILTER_INTERSECTION_PAIRS";
86858685-})(ActiveHooks || (ActiveHooks = {}));
86868686-var SolverFlags;
86878687-(function(SolverFlags2) {
86888688- SolverFlags2[SolverFlags2["EMPTY"] = 0] = "EMPTY";
86898689- SolverFlags2[SolverFlags2["COMPUTE_IMPULSE"] = 1] = "COMPUTE_IMPULSE";
86908690-})(SolverFlags || (SolverFlags = {}));
86918691-86928692-// ../node_modules/@dimforge/rapier2d/geometry/collider.js
86938693-var ActiveCollisionTypes;
86948694-(function(ActiveCollisionTypes2) {
86958695- ActiveCollisionTypes2[ActiveCollisionTypes2["DYNAMIC_DYNAMIC"] = 1] = "DYNAMIC_DYNAMIC";
86968696- ActiveCollisionTypes2[ActiveCollisionTypes2["DYNAMIC_KINEMATIC"] = 12] = "DYNAMIC_KINEMATIC";
86978697- ActiveCollisionTypes2[ActiveCollisionTypes2["DYNAMIC_FIXED"] = 2] = "DYNAMIC_FIXED";
86988698- ActiveCollisionTypes2[ActiveCollisionTypes2["KINEMATIC_KINEMATIC"] = 52224] = "KINEMATIC_KINEMATIC";
86998699- ActiveCollisionTypes2[ActiveCollisionTypes2["KINEMATIC_FIXED"] = 8704] = "KINEMATIC_FIXED";
87008700- ActiveCollisionTypes2[ActiveCollisionTypes2["FIXED_FIXED"] = 32] = "FIXED_FIXED";
87018701- ActiveCollisionTypes2[ActiveCollisionTypes2["DEFAULT"] = 15] = "DEFAULT";
87028702- ActiveCollisionTypes2[ActiveCollisionTypes2["ALL"] = 60943] = "ALL";
87038703-})(ActiveCollisionTypes || (ActiveCollisionTypes = {}));
87048704-var Collider = class {
87058705- constructor(colliderSet, handle, parent, shape) {
87068706- this.colliderSet = colliderSet;
87078707- this.handle = handle;
87088708- this._parent = parent;
87098709- this._shape = shape;
87108710- }
87118711- /** @internal */
87128712- finalizeDeserialization(bodies) {
87138713- if (this.handle != null) {
87148714- this._parent = bodies.get(this.colliderSet.raw.coParent(this.handle));
87158715- }
87168716- }
87178717- ensureShapeIsCached() {
87188718- if (!this._shape)
87198719- this._shape = Shape.fromRaw(this.colliderSet.raw, this.handle);
87208720- }
87218721- /**
87228722- * The shape of this collider.
87238723- */
87248724- get shape() {
87258725- this.ensureShapeIsCached();
87268726- return this._shape;
87278727- }
87288728- /**
87298729- * Checks if this collider is still valid (i.e. that it has
87308730- * not been deleted from the collider set yet).
87318731- */
87328732- isValid() {
87338733- return this.colliderSet.raw.contains(this.handle);
87348734- }
87358735- /**
87368736- * The world-space translation of this rigid-body.
87378737- */
87388738- translation() {
87398739- return VectorOps.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
87408740- }
87418741- /**
87428742- * The world-space orientation of this rigid-body.
87438743- */
87448744- rotation() {
87458745- return RotationOps.fromRaw(this.colliderSet.raw.coRotation(this.handle));
87468746- }
87478747- /**
87488748- * Is this collider a sensor?
87498749- */
87508750- isSensor() {
87518751- return this.colliderSet.raw.coIsSensor(this.handle);
87528752- }
87538753- /**
87548754- * Sets whether or not this collider is a sensor.
87558755- * @param isSensor - If `true`, the collider will be a sensor.
87568756- */
87578757- setSensor(isSensor) {
87588758- this.colliderSet.raw.coSetSensor(this.handle, isSensor);
87598759- }
87608760- /**
87618761- * Sets the new shape of the collider.
87628762- * @param shape - The collider’s new shape.
87638763- */
87648764- setShape(shape) {
87658765- let rawShape = shape.intoRaw();
87668766- this.colliderSet.raw.coSetShape(this.handle, rawShape);
87678767- rawShape.free();
87688768- this._shape = shape;
87698769- }
87708770- /**
87718771- * Sets whether this collider is enabled or not.
87728772- *
87738773- * @param enabled - Set to `false` to disable this collider (its parent rigid-body won’t be disabled automatically by this).
87748774- */
87758775- setEnabled(enabled) {
87768776- this.colliderSet.raw.coSetEnabled(this.handle, enabled);
87778777- }
87788778- /**
87798779- * Is this collider enabled?
87808780- */
87818781- isEnabled() {
87828782- return this.colliderSet.raw.coIsEnabled(this.handle);
87838783- }
87848784- /**
87858785- * Sets the restitution coefficient of the collider to be created.
87868786- *
87878787- * @param restitution - The restitution coefficient in `[0, 1]`. A value of 0 (the default) means no bouncing behavior
87888788- * while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the
87898789- * constraints solver).
87908790- */
87918791- setRestitution(restitution) {
87928792- this.colliderSet.raw.coSetRestitution(this.handle, restitution);
87938793- }
87948794- /**
87958795- * Sets the friction coefficient of the collider to be created.
87968796- *
87978797- * @param friction - The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The
87988798- * higher the coefficient, the stronger friction forces will be for contacts with the collider
87998799- * being built.
88008800- */
88018801- setFriction(friction) {
88028802- this.colliderSet.raw.coSetFriction(this.handle, friction);
88038803- }
88048804- /**
88058805- * Gets the rule used to combine the friction coefficients of two colliders
88068806- * colliders involved in a contact.
88078807- */
88088808- frictionCombineRule() {
88098809- return this.colliderSet.raw.coFrictionCombineRule(this.handle);
88108810- }
88118811- /**
88128812- * Sets the rule used to combine the friction coefficients of two colliders
88138813- * colliders involved in a contact.
88148814- *
88158815- * @param rule − The combine rule to apply.
88168816- */
88178817- setFrictionCombineRule(rule) {
88188818- this.colliderSet.raw.coSetFrictionCombineRule(this.handle, rule);
88198819- }
88208820- /**
88218821- * Gets the rule used to combine the restitution coefficients of two colliders
88228822- * colliders involved in a contact.
88238823- */
88248824- restitutionCombineRule() {
88258825- return this.colliderSet.raw.coRestitutionCombineRule(this.handle);
88268826- }
88278827- /**
88288828- * Sets the rule used to combine the restitution coefficients of two colliders
88298829- * colliders involved in a contact.
88308830- *
88318831- * @param rule − The combine rule to apply.
88328832- */
88338833- setRestitutionCombineRule(rule) {
88348834- this.colliderSet.raw.coSetRestitutionCombineRule(this.handle, rule);
88358835- }
88368836- /**
88378837- * Sets the collision groups used by this collider.
88388838- *
88398839- * Two colliders will interact iff. their collision groups are compatible.
88408840- * See the documentation of `InteractionGroups` for details on teh used bit pattern.
88418841- *
88428842- * @param groups - The collision groups used for the collider being built.
88438843- */
88448844- setCollisionGroups(groups) {
88458845- this.colliderSet.raw.coSetCollisionGroups(this.handle, groups);
88468846- }
88478847- /**
88488848- * Sets the solver groups used by this collider.
88498849- *
88508850- * Forces between two colliders in contact will be computed iff their solver
88518851- * groups are compatible.
88528852- * See the documentation of `InteractionGroups` for details on the used bit pattern.
88538853- *
88548854- * @param groups - The solver groups used for the collider being built.
88558855- */
88568856- setSolverGroups(groups) {
88578857- this.colliderSet.raw.coSetSolverGroups(this.handle, groups);
88588858- }
88598859- /**
88608860- * Sets the contact skin for this collider.
88618861- *
88628862- * See the documentation of `ColliderDesc.setContactSkin` for additional details.
88638863- */
88648864- contactSkin() {
88658865- return this.colliderSet.raw.coContactSkin(this.handle);
88668866- }
88678867- /**
88688868- * Sets the contact skin for this collider.
88698869- *
88708870- * See the documentation of `ColliderDesc.setContactSkin` for additional details.
88718871- *
88728872- * @param thickness - The contact skin thickness.
88738873- */
88748874- setContactSkin(thickness) {
88758875- return this.colliderSet.raw.coSetContactSkin(this.handle, thickness);
88768876- }
88778877- /**
88788878- * Get the physics hooks active for this collider.
88798879- */
88808880- activeHooks() {
88818881- return this.colliderSet.raw.coActiveHooks(this.handle);
88828882- }
88838883- /**
88848884- * Set the physics hooks active for this collider.
88858885- *
88868886- * Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider.
88878887- *
88888888- * @param activeHooks - The hooks active for contact/intersection pairs involving this collider.
88898889- */
88908890- setActiveHooks(activeHooks) {
88918891- this.colliderSet.raw.coSetActiveHooks(this.handle, activeHooks);
88928892- }
88938893- /**
88948894- * The events active for this collider.
88958895- */
88968896- activeEvents() {
88978897- return this.colliderSet.raw.coActiveEvents(this.handle);
88988898- }
88998899- /**
89008900- * Set the events active for this collider.
89018901- *
89028902- * Use this to enable contact and/or intersection event reporting for this collider.
89038903- *
89048904- * @param activeEvents - The events active for contact/intersection pairs involving this collider.
89058905- */
89068906- setActiveEvents(activeEvents) {
89078907- this.colliderSet.raw.coSetActiveEvents(this.handle, activeEvents);
89088908- }
89098909- /**
89108910- * Gets the collision types active for this collider.
89118911- */
89128912- activeCollisionTypes() {
89138913- return this.colliderSet.raw.coActiveCollisionTypes(this.handle);
89148914- }
89158915- /**
89168916- * Sets the total force magnitude beyond which a contact force event can be emitted.
89178917- *
89188918- * @param threshold - The new force threshold.
89198919- */
89208920- setContactForceEventThreshold(threshold) {
89218921- return this.colliderSet.raw.coSetContactForceEventThreshold(this.handle, threshold);
89228922- }
89238923- /**
89248924- * The total force magnitude beyond which a contact force event can be emitted.
89258925- */
89268926- contactForceEventThreshold() {
89278927- return this.colliderSet.raw.coContactForceEventThreshold(this.handle);
89288928- }
89298929- /**
89308930- * Set the collision types active for this collider.
89318931- *
89328932- * @param activeCollisionTypes - The hooks active for contact/intersection pairs involving this collider.
89338933- */
89348934- setActiveCollisionTypes(activeCollisionTypes) {
89358935- this.colliderSet.raw.coSetActiveCollisionTypes(this.handle, activeCollisionTypes);
89368936- }
89378937- /**
89388938- * Sets the uniform density of this collider.
89398939- *
89408940- * This will override any previous mass-properties set by `this.setDensity`,
89418941- * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`,
89428942- * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider.
89438943- *
89448944- * The mass and angular inertia of this collider will be computed automatically based on its
89458945- * shape.
89468946- */
89478947- setDensity(density) {
89488948- this.colliderSet.raw.coSetDensity(this.handle, density);
89498949- }
89508950- /**
89518951- * Sets the mass of this collider.
89528952- *
89538953- * This will override any previous mass-properties set by `this.setDensity`,
89548954- * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`,
89558955- * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider.
89568956- *
89578957- * The angular inertia of this collider will be computed automatically based on its shape
89588958- * and this mass value.
89598959- */
89608960- setMass(mass) {
89618961- this.colliderSet.raw.coSetMass(this.handle, mass);
89628962- }
89638963- // #if DIM2
89648964- /**
89658965- * Sets the mass of this collider.
89668966- *
89678967- * This will override any previous mass-properties set by `this.setDensity`,
89688968- * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`,
89698969- * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider.
89708970- */
89718971- setMassProperties(mass, centerOfMass, principalAngularInertia) {
89728972- let rawCom = VectorOps.intoRaw(centerOfMass);
89738973- this.colliderSet.raw.coSetMassProperties(this.handle, mass, rawCom, principalAngularInertia);
89748974- rawCom.free();
89758975- }
89768976- // #endif
89778977- /**
89788978- * Sets the translation of this collider.
89798979- *
89808980- * @param tra - The world-space position of the collider.
89818981- */
89828982- setTranslation(tra) {
89838983- this.colliderSet.raw.coSetTranslation(this.handle, tra.x, tra.y);
89848984- }
89858985- /**
89868986- * Sets the translation of this collider relative to its parent rigid-body.
89878987- *
89888988- * Does nothing if this collider isn't attached to a rigid-body.
89898989- *
89908990- * @param tra - The new translation of the collider relative to its parent.
89918991- */
89928992- setTranslationWrtParent(tra) {
89938993- this.colliderSet.raw.coSetTranslationWrtParent(this.handle, tra.x, tra.y);
89948994- }
89958995- // #if DIM2
89968996- /**
89978997- * Sets the rotation angle of this collider.
89988998- *
89998999- * @param angle - The rotation angle, in radians.
90009000- */
90019001- setRotation(angle) {
90029002- this.colliderSet.raw.coSetRotation(this.handle, angle);
90039003- }
90049004- /**
90059005- * Sets the rotation angle of this collider relative to its parent rigid-body.
90069006- *
90079007- * Does nothing if this collider isn't attached to a rigid-body.
90089008- *
90099009- * @param angle - The rotation angle, in radians.
90109010- */
90119011- setRotationWrtParent(angle) {
90129012- this.colliderSet.raw.coSetRotationWrtParent(this.handle, angle);
90139013- }
90149014- // #endif
90159015- /**
90169016- * The type of the shape of this collider.
90179017- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90189018- */
90199019- shapeType() {
90209020- return this.colliderSet.raw.coShapeType(this.handle);
90219021- }
90229022- /**
90239023- * The half-extents of this collider if it is a cuboid shape.
90249024- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90259025- */
90269026- halfExtents() {
90279027- return VectorOps.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
90289028- }
90299029- /**
90309030- * Sets the half-extents of this collider if it is a cuboid shape.
90319031- *
90329032- * @param newHalfExtents - desired half extents.
90339033- */
90349034- setHalfExtents(newHalfExtents) {
90359035- const rawPoint = VectorOps.intoRaw(newHalfExtents);
90369036- this.colliderSet.raw.coSetHalfExtents(this.handle, rawPoint);
90379037- }
90389038- /**
90399039- * The radius of this collider if it is a ball, cylinder, capsule, or cone shape.
90409040- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90419041- */
90429042- radius() {
90439043- return this.colliderSet.raw.coRadius(this.handle);
90449044- }
90459045- /**
90469046- * Sets the radius of this collider if it is a ball, cylinder, capsule, or cone shape.
90479047- *
90489048- * @param newRadius - desired radius.
90499049- */
90509050- setRadius(newRadius) {
90519051- this.colliderSet.raw.coSetRadius(this.handle, newRadius);
90529052- }
90539053- /**
90549054- * The radius of the round edges of this collider if it is a round cylinder.
90559055- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90569056- */
90579057- roundRadius() {
90589058- return this.colliderSet.raw.coRoundRadius(this.handle);
90599059- }
90609060- /**
90619061- * Sets the radius of the round edges of this collider if it has round edges.
90629062- *
90639063- * @param newBorderRadius - desired round edge radius.
90649064- */
90659065- setRoundRadius(newBorderRadius) {
90669066- this.colliderSet.raw.coSetRoundRadius(this.handle, newBorderRadius);
90679067- }
90689068- /**
90699069- * The half height of this collider if it is a cylinder, capsule, or cone shape.
90709070- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90719071- */
90729072- halfHeight() {
90739073- return this.colliderSet.raw.coHalfHeight(this.handle);
90749074- }
90759075- /**
90769076- * Sets the half height of this collider if it is a cylinder, capsule, or cone shape.
90779077- *
90789078- * @param newHalfheight - desired half height.
90799079- */
90809080- setHalfHeight(newHalfheight) {
90819081- this.colliderSet.raw.coSetHalfHeight(this.handle, newHalfheight);
90829082- }
90839083- /**
90849084- * If this collider has a triangle mesh, polyline, convex polygon, or convex polyhedron shape,
90859085- * this returns the vertex buffer of said shape.
90869086- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90879087- */
90889088- vertices() {
90899089- return this.colliderSet.raw.coVertices(this.handle);
90909090- }
90919091- /**
90929092- * If this collider has a triangle mesh, polyline, or convex polyhedron shape,
90939093- * this returns the index buffer of said shape.
90949094- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
90959095- */
90969096- indices() {
90979097- return this.colliderSet.raw.coIndices(this.handle);
90989098- }
90999099- /**
91009100- * If this collider has a heightfield shape, this returns the heights buffer of
91019101- * the heightfield.
91029102- * In 3D, the returned height matrix is provided in column-major order.
91039103- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
91049104- */
91059105- heightfieldHeights() {
91069106- return this.colliderSet.raw.coHeightfieldHeights(this.handle);
91079107- }
91089108- /**
91099109- * If this collider has a heightfield shape, this returns the scale
91109110- * applied to it.
91119111- * @deprecated this field will be removed in the future, please access this field on `shape` member instead.
91129112- */
91139113- heightfieldScale() {
91149114- let scale = this.colliderSet.raw.coHeightfieldScale(this.handle);
91159115- return VectorOps.fromRaw(scale);
91169116- }
91179117- /**
91189118- * The rigid-body this collider is attached to.
91199119- */
91209120- parent() {
91219121- return this._parent;
91229122- }
91239123- /**
91249124- * The friction coefficient of this collider.
91259125- */
91269126- friction() {
91279127- return this.colliderSet.raw.coFriction(this.handle);
91289128- }
91299129- /**
91309130- * The restitution coefficient of this collider.
91319131- */
91329132- restitution() {
91339133- return this.colliderSet.raw.coRestitution(this.handle);
91349134- }
91359135- /**
91369136- * The density of this collider.
91379137- */
91389138- density() {
91399139- return this.colliderSet.raw.coDensity(this.handle);
91409140- }
91419141- /**
91429142- * The mass of this collider.
91439143- */
91449144- mass() {
91459145- return this.colliderSet.raw.coMass(this.handle);
91469146- }
91479147- /**
91489148- * The volume of this collider.
91499149- */
91509150- volume() {
91519151- return this.colliderSet.raw.coVolume(this.handle);
91529152- }
91539153- /**
91549154- * The collision groups of this collider.
91559155- */
91569156- collisionGroups() {
91579157- return this.colliderSet.raw.coCollisionGroups(this.handle);
91589158- }
91599159- /**
91609160- * The solver groups of this collider.
91619161- */
91629162- solverGroups() {
91639163- return this.colliderSet.raw.coSolverGroups(this.handle);
91649164- }
91659165- /**
91669166- * Tests if this collider contains a point.
91679167- *
91689168- * @param point - The point to test.
91699169- */
91709170- containsPoint(point) {
91719171- let rawPoint = VectorOps.intoRaw(point);
91729172- let result = this.colliderSet.raw.coContainsPoint(this.handle, rawPoint);
91739173- rawPoint.free();
91749174- return result;
91759175- }
91769176- /**
91779177- * Find the projection of a point on this collider.
91789178- *
91799179- * @param point - The point to project.
91809180- * @param solid - If this is set to `true` then the collider shapes are considered to
91819181- * be plain (if the point is located inside of a plain shape, its projection is the point
91829182- * itself). If it is set to `false` the collider shapes are considered to be hollow
91839183- * (if the point is located inside of an hollow shape, it is projected on the shape's
91849184- * boundary).
91859185- */
91869186- projectPoint(point, solid) {
91879187- let rawPoint = VectorOps.intoRaw(point);
91889188- let result = PointProjection.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, rawPoint, solid));
91899189- rawPoint.free();
91909190- return result;
91919191- }
91929192- /**
91939193- * Tests if this collider intersects the given ray.
91949194- *
91959195- * @param ray - The ray to cast.
91969196- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
91979197- * limits the length of the ray to `ray.dir.norm() * maxToi`.
91989198- */
91999199- intersectsRay(ray, maxToi) {
92009200- let rawOrig = VectorOps.intoRaw(ray.origin);
92019201- let rawDir = VectorOps.intoRaw(ray.dir);
92029202- let result = this.colliderSet.raw.coIntersectsRay(this.handle, rawOrig, rawDir, maxToi);
92039203- rawOrig.free();
92049204- rawDir.free();
92059205- return result;
92069206- }
92079207- /*
92089208- * Computes the smallest time between this and the given shape under translational movement are separated by a distance smaller or equal to distance.
92099209- *
92109210- * @param collider1Vel - The constant velocity of the current shape to cast (i.e. the cast direction).
92119211- * @param shape2 - The shape to cast against.
92129212- * @param shape2Pos - The position of the second shape.
92139213- * @param shape2Rot - The rotation of the second shape.
92149214- * @param shape2Vel - The constant velocity of the second shape.
92159215- * @param targetDistance − If the shape moves closer to this distance from a collider, a hit
92169216- * will be returned.
92179217- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
92189218- * limits the distance traveled by the shape to `collider1Vel.norm() * maxToi`.
92199219- * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if
92209220- * the shape is penetrating another shape at its starting point **and** its trajectory is such
92219221- * that it’s on a path to exist that penetration state.
92229222- */
92239223- castShape(collider1Vel, shape2, shape2Pos, shape2Rot, shape2Vel, targetDistance, maxToi, stopAtPenetration) {
92249224- let rawCollider1Vel = VectorOps.intoRaw(collider1Vel);
92259225- let rawShape2Pos = VectorOps.intoRaw(shape2Pos);
92269226- let rawShape2Rot = RotationOps.intoRaw(shape2Rot);
92279227- let rawShape2Vel = VectorOps.intoRaw(shape2Vel);
92289228- let rawShape2 = shape2.intoRaw();
92299229- let result = ShapeCastHit.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, rawCollider1Vel, rawShape2, rawShape2Pos, rawShape2Rot, rawShape2Vel, targetDistance, maxToi, stopAtPenetration));
92309230- rawCollider1Vel.free();
92319231- rawShape2Pos.free();
92329232- rawShape2Rot.free();
92339233- rawShape2Vel.free();
92349234- rawShape2.free();
92359235- return result;
92369236- }
92379237- /*
92389238- * Computes the smallest time between this and the given collider under translational movement are separated by a distance smaller or equal to distance.
92399239- *
92409240- * @param collider1Vel - The constant velocity of the current collider to cast (i.e. the cast direction).
92419241- * @param collider2 - The collider to cast against.
92429242- * @param collider2Vel - The constant velocity of the second collider.
92439243- * @param targetDistance − If the shape moves closer to this distance from a collider, a hit
92449244- * will be returned.
92459245- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
92469246- * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.
92479247- * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if
92489248- * the shape is penetrating another shape at its starting point **and** its trajectory is such
92499249- * that it’s on a path to exist that penetration state.
92509250- */
92519251- castCollider(collider1Vel, collider2, collider2Vel, targetDistance, maxToi, stopAtPenetration) {
92529252- let rawCollider1Vel = VectorOps.intoRaw(collider1Vel);
92539253- let rawCollider2Vel = VectorOps.intoRaw(collider2Vel);
92549254- let result = ColliderShapeCastHit.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, rawCollider1Vel, collider2.handle, rawCollider2Vel, targetDistance, maxToi, stopAtPenetration));
92559255- rawCollider1Vel.free();
92569256- rawCollider2Vel.free();
92579257- return result;
92589258- }
92599259- intersectsShape(shape2, shapePos2, shapeRot2) {
92609260- let rawPos2 = VectorOps.intoRaw(shapePos2);
92619261- let rawRot2 = RotationOps.intoRaw(shapeRot2);
92629262- let rawShape2 = shape2.intoRaw();
92639263- let result = this.colliderSet.raw.coIntersectsShape(this.handle, rawShape2, rawPos2, rawRot2);
92649264- rawPos2.free();
92659265- rawRot2.free();
92669266- rawShape2.free();
92679267- return result;
92689268- }
92699269- /**
92709270- * Computes one pair of contact points between the shape owned by this collider and the given shape.
92719271- *
92729272- * @param shape2 - The second shape.
92739273- * @param shape2Pos - The initial position of the second shape.
92749274- * @param shape2Rot - The rotation of the second shape.
92759275- * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail.
92769276- * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space.
92779277- */
92789278- contactShape(shape2, shape2Pos, shape2Rot, prediction) {
92799279- let rawPos2 = VectorOps.intoRaw(shape2Pos);
92809280- let rawRot2 = RotationOps.intoRaw(shape2Rot);
92819281- let rawShape2 = shape2.intoRaw();
92829282- let result = ShapeContact.fromRaw(this.colliderSet.raw.coContactShape(this.handle, rawShape2, rawPos2, rawRot2, prediction));
92839283- rawPos2.free();
92849284- rawRot2.free();
92859285- rawShape2.free();
92869286- return result;
92879287- }
92889288- /**
92899289- * Computes one pair of contact points between the collider and the given collider.
92909290- *
92919291- * @param collider2 - The second collider.
92929292- * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail.
92939293- * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space.
92949294- */
92959295- contactCollider(collider2, prediction) {
92969296- let result = ShapeContact.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, collider2.handle, prediction));
92979297- return result;
92989298- }
92999299- /**
93009300- * Find the closest intersection between a ray and this collider.
93019301- *
93029302- * This also computes the normal at the hit point.
93039303- * @param ray - The ray to cast.
93049304- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
93059305- * limits the length of the ray to `ray.dir.norm() * maxToi`.
93069306- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
93079307- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
93089308- * whereas `false` implies that all shapes are hollow for this ray-cast.
93099309- * @returns The time-of-impact between this collider and the ray, or `-1` if there is no intersection.
93109310- */
93119311- castRay(ray, maxToi, solid) {
93129312- let rawOrig = VectorOps.intoRaw(ray.origin);
93139313- let rawDir = VectorOps.intoRaw(ray.dir);
93149314- let result = this.colliderSet.raw.coCastRay(this.handle, rawOrig, rawDir, maxToi, solid);
93159315- rawOrig.free();
93169316- rawDir.free();
93179317- return result;
93189318- }
93199319- /**
93209320- * Find the closest intersection between a ray and this collider.
93219321- *
93229322- * This also computes the normal at the hit point.
93239323- * @param ray - The ray to cast.
93249324- * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively
93259325- * limits the length of the ray to `ray.dir.norm() * maxToi`.
93269326- * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its
93279327- * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,
93289328- * whereas `false` implies that all shapes are hollow for this ray-cast.
93299329- */
93309330- castRayAndGetNormal(ray, maxToi, solid) {
93319331- let rawOrig = VectorOps.intoRaw(ray.origin);
93329332- let rawDir = VectorOps.intoRaw(ray.dir);
93339333- let result = RayIntersection.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, rawOrig, rawDir, maxToi, solid));
93349334- rawOrig.free();
93359335- rawDir.free();
93369336- return result;
93379337- }
93389338-};
93399339-var MassPropsMode;
93409340-(function(MassPropsMode2) {
93419341- MassPropsMode2[MassPropsMode2["Density"] = 0] = "Density";
93429342- MassPropsMode2[MassPropsMode2["Mass"] = 1] = "Mass";
93439343- MassPropsMode2[MassPropsMode2["MassProps"] = 2] = "MassProps";
93449344-})(MassPropsMode || (MassPropsMode = {}));
93459345-var ColliderDesc = class _ColliderDesc {
93469346- /**
93479347- * Initializes a collider descriptor from the collision shape.
93489348- *
93499349- * @param shape - The shape of the collider being built.
93509350- */
93519351- constructor(shape) {
93529352- this.enabled = true;
93539353- this.shape = shape;
93549354- this.massPropsMode = MassPropsMode.Density;
93559355- this.density = 1;
93569356- this.friction = 0.5;
93579357- this.restitution = 0;
93589358- this.rotation = RotationOps.identity();
93599359- this.translation = VectorOps.zeros();
93609360- this.isSensor = false;
93619361- this.collisionGroups = 4294967295;
93629362- this.solverGroups = 4294967295;
93639363- this.frictionCombineRule = CoefficientCombineRule.Average;
93649364- this.restitutionCombineRule = CoefficientCombineRule.Average;
93659365- this.activeCollisionTypes = ActiveCollisionTypes.DEFAULT;
93669366- this.activeEvents = ActiveEvents.NONE;
93679367- this.activeHooks = ActiveHooks.NONE;
93689368- this.mass = 0;
93699369- this.centerOfMass = VectorOps.zeros();
93709370- this.contactForceEventThreshold = 0;
93719371- this.contactSkin = 0;
93729372- this.principalAngularInertia = 0;
93739373- this.rotationsEnabled = true;
93749374- }
93759375- /**
93769376- * Create a new collider descriptor with a ball shape.
93779377- *
93789378- * @param radius - The radius of the ball.
93799379- */
93809380- static ball(radius) {
93819381- const shape = new Ball(radius);
93829382- return new _ColliderDesc(shape);
93839383- }
93849384- /**
93859385- * Create a new collider descriptor with a capsule shape.
93869386- *
93879387- * @param halfHeight - The half-height of the capsule, along the `y` axis.
93889388- * @param radius - The radius of the capsule basis.
93899389- */
93909390- static capsule(halfHeight, radius) {
93919391- const shape = new Capsule(halfHeight, radius);
93929392- return new _ColliderDesc(shape);
93939393- }
93949394- /**
93959395- * Creates a new segment shape.
93969396- *
93979397- * @param a - The first point of the segment.
93989398- * @param b - The second point of the segment.
93999399- */
94009400- static segment(a, b) {
94019401- const shape = new Segment(a, b);
94029402- return new _ColliderDesc(shape);
94039403- }
94049404- /**
94059405- * Creates a new triangle shape.
94069406- *
94079407- * @param a - The first point of the triangle.
94089408- * @param b - The second point of the triangle.
94099409- * @param c - The third point of the triangle.
94109410- */
94119411- static triangle(a, b, c) {
94129412- const shape = new Triangle(a, b, c);
94139413- return new _ColliderDesc(shape);
94149414- }
94159415- /**
94169416- * Creates a new triangle shape with round corners.
94179417- *
94189418- * @param a - The first point of the triangle.
94199419- * @param b - The second point of the triangle.
94209420- * @param c - The third point of the triangle.
94219421- * @param borderRadius - The radius of the borders of this triangle. In 3D,
94229422- * this is also equal to half the thickness of the triangle.
94239423- */
94249424- static roundTriangle(a, b, c, borderRadius) {
94259425- const shape = new RoundTriangle(a, b, c, borderRadius);
94269426- return new _ColliderDesc(shape);
94279427- }
94289428- /**
94299429- * Creates a new collider descriptor with a polyline shape.
94309430- *
94319431- * @param vertices - The coordinates of the polyline's vertices.
94329432- * @param indices - The indices of the polyline's segments. If this is `undefined` or `null`,
94339433- * the vertices are assumed to describe a line strip.
94349434- */
94359435- static polyline(vertices, indices) {
94369436- const shape = new Polyline(vertices, indices);
94379437- return new _ColliderDesc(shape);
94389438- }
94399439- /**
94409440- * Creates a new collider descriptor with a triangle mesh shape.
94419441- *
94429442- * @param vertices - The coordinates of the triangle mesh's vertices.
94439443- * @param indices - The indices of the triangle mesh's triangles.
94449444- */
94459445- static trimesh(vertices, indices, flags) {
94469446- const shape = new TriMesh(vertices, indices, flags);
94479447- return new _ColliderDesc(shape);
94489448- }
94499449- // #if DIM2
94509450- /**
94519451- * Creates a new collider descriptor with a rectangular shape.
94529452- *
94539453- * @param hx - The half-width of the rectangle along its local `x` axis.
94549454- * @param hy - The half-width of the rectangle along its local `y` axis.
94559455- */
94569456- static cuboid(hx, hy) {
94579457- const shape = new Cuboid(hx, hy);
94589458- return new _ColliderDesc(shape);
94599459- }
94609460- /**
94619461- * Creates a new collider descriptor with a rectangular shape with round borders.
94629462- *
94639463- * @param hx - The half-width of the rectangle along its local `x` axis.
94649464- * @param hy - The half-width of the rectangle along its local `y` axis.
94659465- * @param borderRadius - The radius of the cuboid's borders.
94669466- */
94679467- static roundCuboid(hx, hy, borderRadius) {
94689468- const shape = new RoundCuboid(hx, hy, borderRadius);
94699469- return new _ColliderDesc(shape);
94709470- }
94719471- /**
94729472- * Creates a new collider description with a halfspace (infinite plane) shape.
94739473- *
94749474- * @param normal - The outward normal of the plane.
94759475- */
94769476- static halfspace(normal) {
94779477- const shape = new HalfSpace(normal);
94789478- return new _ColliderDesc(shape);
94799479- }
94809480- /**
94819481- * Creates a new collider descriptor with a heightfield shape.
94829482- *
94839483- * @param heights - The heights of the heightfield, along its local `y` axis.
94849484- * @param scale - The scale factor applied to the heightfield.
94859485- */
94869486- static heightfield(heights, scale) {
94879487- const shape = new Heightfield(heights, scale);
94889488- return new _ColliderDesc(shape);
94899489- }
94909490- /**
94919491- * Computes the convex-hull of the given points and use the resulting
94929492- * convex polygon as the shape for this new collider descriptor.
94939493- *
94949494- * @param points - The point that will be used to compute the convex-hull.
94959495- */
94969496- static convexHull(points) {
94979497- const shape = new ConvexPolygon(points, false);
94989498- return new _ColliderDesc(shape);
94999499- }
95009500- /**
95019501- * Creates a new collider descriptor that uses the given set of points assumed
95029502- * to form a convex polyline (no convex-hull computation will be done).
95039503- *
95049504- * @param vertices - The vertices of the convex polyline.
95059505- */
95069506- static convexPolyline(vertices) {
95079507- const shape = new ConvexPolygon(vertices, true);
95089508- return new _ColliderDesc(shape);
95099509- }
95109510- /**
95119511- * Computes the convex-hull of the given points and use the resulting
95129512- * convex polygon as the shape for this new collider descriptor. A
95139513- * border is added to that convex polygon to give it round corners.
95149514- *
95159515- * @param points - The point that will be used to compute the convex-hull.
95169516- * @param borderRadius - The radius of the round border added to the convex polygon.
95179517- */
95189518- static roundConvexHull(points, borderRadius) {
95199519- const shape = new RoundConvexPolygon(points, borderRadius, false);
95209520- return new _ColliderDesc(shape);
95219521- }
95229522- /**
95239523- * Creates a new collider descriptor that uses the given set of points assumed
95249524- * to form a round convex polyline (no convex-hull computation will be done).
95259525- *
95269526- * @param vertices - The vertices of the convex polyline.
95279527- * @param borderRadius - The radius of the round border added to the convex polyline.
95289528- */
95299529- static roundConvexPolyline(vertices, borderRadius) {
95309530- const shape = new RoundConvexPolygon(vertices, borderRadius, true);
95319531- return new _ColliderDesc(shape);
95329532- }
95339533- // #endif
95349534- // #if DIM2
95359535- /**
95369536- * Sets the position of the collider to be created relative to the rigid-body it is attached to.
95379537- */
95389538- setTranslation(x, y) {
95399539- if (typeof x != "number" || typeof y != "number")
95409540- throw TypeError("The translation components must be numbers.");
95419541- this.translation = { x, y };
95429542- return this;
95439543- }
95449544- // #endif
95459545- /**
95469546- * Sets the rotation of the collider to be created relative to the rigid-body it is attached to.
95479547- *
95489548- * @param rot - The rotation of the collider to be created relative to the rigid-body it is attached to.
95499549- */
95509550- setRotation(rot) {
95519551- this.rotation = rot;
95529552- return this;
95539553- }
95549554- /**
95559555- * Sets whether or not the collider being created is a sensor.
95569556- *
95579557- * A sensor collider does not take part of the physics simulation, but generates
95589558- * proximity events.
95599559- *
95609560- * @param sensor - Set to `true` of the collider built is to be a sensor.
95619561- */
95629562- setSensor(sensor) {
95639563- this.isSensor = sensor;
95649564- return this;
95659565- }
95669566- /**
95679567- * Sets whether the created collider will be enabled or disabled.
95689568- * @param enabled − If set to `false` the collider will be disabled at creation.
95699569- */
95709570- setEnabled(enabled) {
95719571- this.enabled = enabled;
95729572- return this;
95739573- }
95749574- /**
95759575- * Sets the contact skin of the collider.
95769576- *
95779577- * The contact skin acts as if the collider was enlarged with a skin of width `skin_thickness`
95789578- * around it, keeping objects further apart when colliding.
95799579- *
95809580- * A non-zero contact skin can increase performance, and in some cases, stability. However
95819581- * it creates a small gap between colliding object (equal to the sum of their skin). If the
95829582- * skin is sufficiently small, this might not be visually significant or can be hidden by the
95839583- * rendering assets.
95849584- */
95859585- setContactSkin(thickness) {
95869586- this.contactSkin = thickness;
95879587- return this;
95889588- }
95899589- /**
95909590- * Sets the density of the collider being built.
95919591- *
95929592- * The mass and angular inertia tensor will be computed automatically based on this density and the collider’s shape.
95939593- *
95949594- * @param density - The density to set, must be greater or equal to 0. A density of 0 means that this collider
95959595- * will not affect the mass or angular inertia of the rigid-body it is attached to.
95969596- */
95979597- setDensity(density) {
95989598- this.massPropsMode = MassPropsMode.Density;
95999599- this.density = density;
96009600- return this;
96019601- }
96029602- /**
96039603- * Sets the mass of the collider being built.
96049604- *
96059605- * The angular inertia tensor will be computed automatically based on this mass and the collider’s shape.
96069606- *
96079607- * @param mass - The mass to set, must be greater or equal to 0.
96089608- */
96099609- setMass(mass) {
96109610- this.massPropsMode = MassPropsMode.Mass;
96119611- this.mass = mass;
96129612- return this;
96139613- }
96149614- // #if DIM2
96159615- /**
96169616- * Sets the mass properties of the collider being built.
96179617- *
96189618- * This replaces the mass-properties automatically computed from the collider's density and shape.
96199619- * These mass-properties will be added to the mass-properties of the rigid-body this collider will be attached to.
96209620- *
96219621- * @param mass − The mass of the collider to create.
96229622- * @param centerOfMass − The center-of-mass of the collider to create.
96239623- * @param principalAngularInertia − The principal angular inertia of the collider to create.
96249624- */
96259625- setMassProperties(mass, centerOfMass, principalAngularInertia) {
96269626- this.massPropsMode = MassPropsMode.MassProps;
96279627- this.mass = mass;
96289628- VectorOps.copy(this.centerOfMass, centerOfMass);
96299629- this.principalAngularInertia = principalAngularInertia;
96309630- return this;
96319631- }
96329632- // #endif
96339633- /**
96349634- * Sets the restitution coefficient of the collider to be created.
96359635- *
96369636- * @param restitution - The restitution coefficient in `[0, 1]`. A value of 0 (the default) means no bouncing behavior
96379637- * while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the
96389638- * constraints solver).
96399639- */
96409640- setRestitution(restitution) {
96419641- this.restitution = restitution;
96429642- return this;
96439643- }
96449644- /**
96459645- * Sets the friction coefficient of the collider to be created.
96469646- *
96479647- * @param friction - The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The
96489648- * higher the coefficient, the stronger friction forces will be for contacts with the collider
96499649- * being built.
96509650- */
96519651- setFriction(friction) {
96529652- this.friction = friction;
96539653- return this;
96549654- }
96559655- /**
96569656- * Sets the rule used to combine the friction coefficients of two colliders
96579657- * colliders involved in a contact.
96589658- *
96599659- * @param rule − The combine rule to apply.
96609660- */
96619661- setFrictionCombineRule(rule) {
96629662- this.frictionCombineRule = rule;
96639663- return this;
96649664- }
96659665- /**
96669666- * Sets the rule used to combine the restitution coefficients of two colliders
96679667- * colliders involved in a contact.
96689668- *
96699669- * @param rule − The combine rule to apply.
96709670- */
96719671- setRestitutionCombineRule(rule) {
96729672- this.restitutionCombineRule = rule;
96739673- return this;
96749674- }
96759675- /**
96769676- * Sets the collision groups used by this collider.
96779677- *
96789678- * Two colliders will interact iff. their collision groups are compatible.
96799679- * See the documentation of `InteractionGroups` for details on teh used bit pattern.
96809680- *
96819681- * @param groups - The collision groups used for the collider being built.
96829682- */
96839683- setCollisionGroups(groups) {
96849684- this.collisionGroups = groups;
96859685- return this;
96869686- }
96879687- /**
96889688- * Sets the solver groups used by this collider.
96899689- *
96909690- * Forces between two colliders in contact will be computed iff their solver
96919691- * groups are compatible.
96929692- * See the documentation of `InteractionGroups` for details on the used bit pattern.
96939693- *
96949694- * @param groups - The solver groups used for the collider being built.
96959695- */
96969696- setSolverGroups(groups) {
96979697- this.solverGroups = groups;
96989698- return this;
96999699- }
97009700- /**
97019701- * Set the physics hooks active for this collider.
97029702- *
97039703- * Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider.
97049704- *
97059705- * @param activeHooks - The hooks active for contact/intersection pairs involving this collider.
97069706- */
97079707- setActiveHooks(activeHooks) {
97089708- this.activeHooks = activeHooks;
97099709- return this;
97109710- }
97119711- /**
97129712- * Set the events active for this collider.
97139713- *
97149714- * Use this to enable contact and/or intersection event reporting for this collider.
97159715- *
97169716- * @param activeEvents - The events active for contact/intersection pairs involving this collider.
97179717- */
97189718- setActiveEvents(activeEvents) {
97199719- this.activeEvents = activeEvents;
97209720- return this;
97219721- }
97229722- /**
97239723- * Set the collision types active for this collider.
97249724- *
97259725- * @param activeCollisionTypes - The hooks active for contact/intersection pairs involving this collider.
97269726- */
97279727- setActiveCollisionTypes(activeCollisionTypes) {
97289728- this.activeCollisionTypes = activeCollisionTypes;
97299729- return this;
97309730- }
97319731- /**
97329732- * Sets the total force magnitude beyond which a contact force event can be emitted.
97339733- *
97349734- * @param threshold - The force threshold to set.
97359735- */
97369736- setContactForceEventThreshold(threshold) {
97379737- this.contactForceEventThreshold = threshold;
97389738- return this;
97399739- }
97409740-};
97419741-97429742-// ../node_modules/@dimforge/rapier2d/geometry/collider_set.js
97439743-var ColliderSet = class {
97449744- constructor(raw) {
97459745- this.raw = raw || new RawColliderSet();
97469746- this.map = new Coarena();
97479747- if (raw) {
97489748- raw.forEachColliderHandle((handle) => {
97499749- this.map.set(handle, new Collider(this, handle, null));
97509750- });
97519751- }
97529752- }
97539753- /**
97549754- * Release the WASM memory occupied by this collider set.
97559755- */
97569756- free() {
97579757- if (!!this.raw) {
97589758- this.raw.free();
97599759- }
97609760- this.raw = void 0;
97619761- if (!!this.map) {
97629762- this.map.clear();
97639763- }
97649764- this.map = void 0;
97659765- }
97669766- /** @internal */
97679767- castClosure(f) {
97689768- return (handle) => {
97699769- if (!!f) {
97709770- return f(this.get(handle));
97719771- } else {
97729772- return void 0;
97739773- }
97749774- };
97759775- }
97769776- /** @internal */
97779777- finalizeDeserialization(bodies) {
97789778- this.map.forEach((collider) => collider.finalizeDeserialization(bodies));
97799779- }
97809780- /**
97819781- * Creates a new collider and return its integer handle.
97829782- *
97839783- * @param bodies - The set of bodies where the collider's parent can be found.
97849784- * @param desc - The collider's description.
97859785- * @param parentHandle - The integer handle of the rigid-body this collider is attached to.
97869786- */
97879787- createCollider(bodies, desc, parentHandle) {
97889788- let hasParent = parentHandle != void 0 && parentHandle != null;
97899789- if (hasParent && isNaN(parentHandle))
97909790- throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
97919791- let rawShape = desc.shape.intoRaw();
97929792- let rawTra = VectorOps.intoRaw(desc.translation);
97939793- let rawRot = RotationOps.intoRaw(desc.rotation);
97949794- let rawCom = VectorOps.intoRaw(desc.centerOfMass);
97959795- let handle = this.raw.createCollider(
97969796- desc.enabled,
97979797- rawShape,
97989798- rawTra,
97999799- rawRot,
98009800- desc.massPropsMode,
98019801- desc.mass,
98029802- rawCom,
98039803- // #if DIM2
98049804- desc.principalAngularInertia,
98059805- // #endif
98069806- desc.density,
98079807- desc.friction,
98089808- desc.restitution,
98099809- desc.frictionCombineRule,
98109810- desc.restitutionCombineRule,
98119811- desc.isSensor,
98129812- desc.collisionGroups,
98139813- desc.solverGroups,
98149814- desc.activeCollisionTypes,
98159815- desc.activeHooks,
98169816- desc.activeEvents,
98179817- desc.contactForceEventThreshold,
98189818- desc.contactSkin,
98199819- hasParent,
98209820- hasParent ? parentHandle : 0,
98219821- bodies.raw
98229822- );
98239823- rawShape.free();
98249824- rawTra.free();
98259825- rawRot.free();
98269826- rawCom.free();
98279827- let parent = hasParent ? bodies.get(parentHandle) : null;
98289828- let collider = new Collider(this, handle, parent, desc.shape);
98299829- this.map.set(handle, collider);
98309830- return collider;
98319831- }
98329832- /**
98339833- * Remove a collider from this set.
98349834- *
98359835- * @param handle - The integer handle of the collider to remove.
98369836- * @param bodies - The set of rigid-body containing the rigid-body the collider is attached to.
98379837- * @param wakeUp - If `true`, the rigid-body the removed collider is attached to will be woken-up automatically.
98389838- */
98399839- remove(handle, islands, bodies, wakeUp) {
98409840- this.raw.remove(handle, islands.raw, bodies.raw, wakeUp);
98419841- this.unmap(handle);
98429842- }
98439843- /**
98449844- * Internal function, do not call directly.
98459845- * @param handle
98469846- */
98479847- unmap(handle) {
98489848- this.map.delete(handle);
98499849- }
98509850- /**
98519851- * Gets the rigid-body with the given handle.
98529852- *
98539853- * @param handle - The handle of the rigid-body to retrieve.
98549854- */
98559855- get(handle) {
98569856- return this.map.get(handle);
98579857- }
98589858- /**
98599859- * The number of colliders on this set.
98609860- */
98619861- len() {
98629862- return this.map.len();
98639863- }
98649864- /**
98659865- * Does this set contain a collider with the given handle?
98669866- *
98679867- * @param handle - The collider handle to check.
98689868- */
98699869- contains(handle) {
98709870- return this.get(handle) != null;
98719871- }
98729872- /**
98739873- * Applies the given closure to each collider contained by this set.
98749874- *
98759875- * @param f - The closure to apply.
98769876- */
98779877- forEach(f) {
98789878- this.map.forEach(f);
98799879- }
98809880- /**
98819881- * Gets all colliders in the list.
98829882- *
98839883- * @returns collider list.
98849884- */
98859885- getAll() {
98869886- return this.map.getAll();
98879887- }
98889888-};
98899889-98909890-// ../node_modules/@dimforge/rapier2d/exports.js
98919891-function version2() {
98929892- return version();
98939893-}
98949894-98959895-// ../node_modules/@dimforge/rapier2d/rapier.js
98969896-var rapier_default = exports_exports;
98979897-export {
98989898- ActiveCollisionTypes,
98999899- ActiveEvents,
99009900- ActiveHooks,
99019901- Ball,
99029902- BroadPhase,
99039903- CCDSolver,
99049904- Capsule,
99059905- CharacterCollision,
99069906- CoefficientCombineRule,
99079907- Collider,
99089908- ColliderDesc,
99099909- ColliderSet,
99109910- ColliderShapeCastHit,
99119911- ConvexPolygon,
99129912- Cuboid,
99139913- DebugRenderBuffers,
99149914- DebugRenderPipeline,
99159915- EventQueue,
99169916- FeatureType,
99179917- FixedImpulseJoint,
99189918- FixedMultibodyJoint,
99199919- HalfSpace,
99209920- Heightfield,
99219921- ImpulseJoint,
99229922- ImpulseJointSet,
99239923- IntegrationParameters,
99249924- IslandManager,
99259925- JointAxesMask,
99269926- JointData,
99279927- JointType,
99289928- KinematicCharacterController,
99299929- MassPropsMode,
99309930- MotorModel,
99319931- MultibodyJoint,
99329932- MultibodyJointSet,
99339933- NarrowPhase,
99349934- PhysicsPipeline,
99359935- PointColliderProjection,
99369936- PointProjection,
99379937- Polyline,
99389938- PrismaticImpulseJoint,
99399939- PrismaticMultibodyJoint,
99409940- QueryFilterFlags,
99419941- QueryPipeline,
99429942- Ray,
99439943- RayColliderHit,
99449944- RayColliderIntersection,
99459945- RayIntersection,
99469946- RevoluteImpulseJoint,
99479947- RevoluteMultibodyJoint,
99489948- RigidBody,
99499949- RigidBodyDesc,
99509950- RigidBodySet,
99519951- RigidBodyType,
99529952- RopeImpulseJoint,
99539953- RotationOps,
99549954- RoundConvexPolygon,
99559955- RoundCuboid,
99569956- RoundTriangle,
99579957- Segment,
99589958- SerializationPipeline,
99599959- Shape,
99609960- ShapeCastHit,
99619961- ShapeContact,
99629962- ShapeType,
99639963- SolverFlags,
99649964- SpringImpulseJoint,
99659965- TempContactForceEvent,
99669966- TempContactManifold,
99679967- TriMesh,
99689968- TriMeshFlags,
99699969- Triangle,
99709970- UnitImpulseJoint,
99719971- UnitMultibodyJoint,
99729972- Vector2,
99739973- VectorOps,
99749974- World,
99759975- rapier_default as default,
99769976- version2 as version
99779977-};
99789978-//# sourceMappingURL=@dimforge_rapier2d.js.map
-7
.vite/deps/@dimforge_rapier2d.js.map
···11-{
22- "version": 3,
33- "sources": ["../../../node_modules/@dimforge/rapier2d/src/exports.ts", "../../../node_modules/@dimforge/rapier2d/rapier_wasm2d.js", "../../../node_modules/@dimforge/rapier2d/rapier_wasm2d_bg.js", "../../../node_modules/@dimforge/rapier2d/src/math.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/rigid_body.ts", "../../../node_modules/@dimforge/rapier2d/src/coarena.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/rigid_body_set.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/integration_parameters.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/impulse_joint.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/impulse_joint_set.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/multibody_joint.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/multibody_joint_set.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/coefficient_combine_rule.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/ccd_solver.ts", "../../../node_modules/@dimforge/rapier2d/src/dynamics/island_manager.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/broad_phase.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/narrow_phase.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/contact.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/feature.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/point.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/ray.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/toi.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/shape.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/physics_pipeline.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/query_pipeline.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/serialization_pipeline.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/debug_render_pipeline.ts", "../../../node_modules/@dimforge/rapier2d/src/control/character_controller.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/world.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/event_queue.ts", "../../../node_modules/@dimforge/rapier2d/src/pipeline/physics_hooks.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/collider.ts", "../../../node_modules/@dimforge/rapier2d/src/geometry/collider_set.ts", "../../../node_modules/@dimforge/rapier2d/src/rapier.ts"],
44- "sourcesContent": ["import {version as vers} from \"./raw\";\n\nexport function version(): string {\n return vers();\n}\n\nexport * from \"./math\";\nexport * from \"./dynamics\";\nexport * from \"./geometry\";\nexport * from \"./pipeline\";\nexport * from \"./init\";\nexport * from \"./control\";\n", "import * as wasm from \"./rapier_wasm2d_bg.wasm\";\nimport { __wbg_set_wasm } from \"./rapier_wasm2d_bg.js\";\n__wbg_set_wasm(wasm);\nexport * from \"./rapier_wasm2d_bg.js\";\n", "let wasm;\nexport function __wbg_set_wasm(val) {\n wasm = val;\n}\n\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedFloat64Memory0 = null;\n\nfunction getFloat64Memory0() {\n if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {\n cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);\n }\n return cachedFloat64Memory0;\n}\n\nlet cachedInt32Memory0 = null;\n\nfunction getInt32Memory0() {\n if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {\n cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachedInt32Memory0;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachedUint8Memory0 = null;\n\nfunction getUint8Memory0() {\n if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {\n cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n/**\n* @returns {string}\n*/\nexport function version() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.version(retptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);\n }\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n\nlet cachedFloat32Memory0 = null;\n\nfunction getFloat32Memory0() {\n if (cachedFloat32Memory0 === null || cachedFloat32Memory0.byteLength === 0) {\n cachedFloat32Memory0 = new Float32Array(wasm.memory.buffer);\n }\n return cachedFloat32Memory0;\n}\n\nlet stack_pointer = 128;\n\nfunction addBorrowedObject(obj) {\n if (stack_pointer == 1) throw new Error('out of js stack');\n heap[--stack_pointer] = obj;\n return stack_pointer;\n}\n\nfunction getArrayF32FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len);\n}\n\nlet cachedUint32Memory0 = null;\n\nfunction getUint32Memory0() {\n if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {\n cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);\n }\n return cachedUint32Memory0;\n}\n\nfunction getArrayU32FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len);\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nfunction passArrayF32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getFloat32Memory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passArray32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getUint32Memory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n/**\n*/\nexport const RawShapeType = Object.freeze({ Ball:0,\"0\":\"Ball\",Cuboid:1,\"1\":\"Cuboid\",Capsule:2,\"2\":\"Capsule\",Segment:3,\"3\":\"Segment\",Polyline:4,\"4\":\"Polyline\",Triangle:5,\"5\":\"Triangle\",TriMesh:6,\"6\":\"TriMesh\",HeightField:7,\"7\":\"HeightField\",Compound:8,\"8\":\"Compound\",ConvexPolygon:9,\"9\":\"ConvexPolygon\",RoundCuboid:10,\"10\":\"RoundCuboid\",RoundTriangle:11,\"11\":\"RoundTriangle\",RoundConvexPolygon:12,\"12\":\"RoundConvexPolygon\",HalfSpace:13,\"13\":\"HalfSpace\", });\n/**\n*/\nexport const RawFeatureType = Object.freeze({ Vertex:0,\"0\":\"Vertex\",Face:1,\"1\":\"Face\",Unknown:2,\"2\":\"Unknown\", });\n/**\n*/\nexport const RawRigidBodyType = Object.freeze({ Dynamic:0,\"0\":\"Dynamic\",Fixed:1,\"1\":\"Fixed\",KinematicPositionBased:2,\"2\":\"KinematicPositionBased\",KinematicVelocityBased:3,\"3\":\"KinematicVelocityBased\", });\n/**\n*/\nexport const RawJointType = Object.freeze({ Revolute:0,\"0\":\"Revolute\",Fixed:1,\"1\":\"Fixed\",Prismatic:2,\"2\":\"Prismatic\",Rope:3,\"3\":\"Rope\",Spring:4,\"4\":\"Spring\",Generic:5,\"5\":\"Generic\", });\n/**\n*/\nexport const RawJointAxis = Object.freeze({ X:0,\"0\":\"X\",Y:1,\"1\":\"Y\",AngX:2,\"2\":\"AngX\", });\n/**\n*/\nexport const RawMotorModel = Object.freeze({ AccelerationBased:0,\"0\":\"AccelerationBased\",ForceBased:1,\"1\":\"ForceBased\", });\n/**\n*/\nexport class RawBroadPhase {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawBroadPhase.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawbroadphase_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawbroadphase_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n}\n/**\n*/\nexport class RawCCDSolver {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawccdsolver_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawccdsolver_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n}\n/**\n*/\nexport class RawCharacterCollision {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawcharactercollision_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawcharactercollision_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @returns {number}\n */\n handle() {\n const ret = wasm.rawcharactercollision_handle(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n translationDeltaApplied() {\n const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n translationDeltaRemaining() {\n const ret = wasm.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {number}\n */\n toi() {\n const ret = wasm.rawcharactercollision_toi(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n worldWitness1() {\n const ret = wasm.rawcharactercollision_worldWitness1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n worldWitness2() {\n const ret = wasm.rawcharactercollision_worldWitness2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n worldNormal1() {\n const ret = wasm.rawcharactercollision_worldNormal1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n worldNormal2() {\n const ret = wasm.rawcharactercollision_worldNormal2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawColliderSet {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawColliderSet.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawcolliderset_free(ptr);\n }\n /**\n * The world-space translation of this collider.\n * @param {number} handle\n * @returns {RawVector}\n */\n coTranslation(handle) {\n const ret = wasm.rawcolliderset_coTranslation(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The world-space orientation of this collider.\n * @param {number} handle\n * @returns {RawRotation}\n */\n coRotation(handle) {\n const ret = wasm.rawcolliderset_coRotation(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * Sets the translation of this collider.\n *\n * # Parameters\n * - `x`: the world-space position of the collider along the `x` axis.\n * - `y`: the world-space position of the collider along the `y` axis.\n * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it\n * wasn't moving before modifying its position.\n * @param {number} handle\n * @param {number} x\n * @param {number} y\n */\n coSetTranslation(handle, x, y) {\n wasm.rawcolliderset_coSetTranslation(this.__wbg_ptr, handle, x, y);\n }\n /**\n * @param {number} handle\n * @param {number} x\n * @param {number} y\n */\n coSetTranslationWrtParent(handle, x, y) {\n wasm.rawcolliderset_coSetTranslationWrtParent(this.__wbg_ptr, handle, x, y);\n }\n /**\n * Sets the rotation angle of this collider.\n *\n * # Parameters\n * - `angle`: the rotation angle, in radians.\n * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it\n * wasn't moving before modifying its position.\n * @param {number} handle\n * @param {number} angle\n */\n coSetRotation(handle, angle) {\n wasm.rawcolliderset_coSetRotation(this.__wbg_ptr, handle, angle);\n }\n /**\n * @param {number} handle\n * @param {number} angle\n */\n coSetRotationWrtParent(handle, angle) {\n wasm.rawcolliderset_coSetRotationWrtParent(this.__wbg_ptr, handle, angle);\n }\n /**\n * Is this collider a sensor?\n * @param {number} handle\n * @returns {boolean}\n */\n coIsSensor(handle) {\n const ret = wasm.rawcolliderset_coIsSensor(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * The type of the shape of this collider.\n * @param {number} handle\n * @returns {RawShapeType}\n */\n coShapeType(handle) {\n const ret = wasm.rawcolliderset_coShapeType(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * @param {number} handle\n * @returns {RawVector | undefined}\n */\n coHalfspaceNormal(handle) {\n const ret = wasm.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, handle);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * The half-extents of this collider if it is has a cuboid shape.\n * @param {number} handle\n * @returns {RawVector | undefined}\n */\n coHalfExtents(handle) {\n const ret = wasm.rawcolliderset_coHalfExtents(this.__wbg_ptr, handle);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * Set the half-extents of this collider if it has a cuboid shape.\n * @param {number} handle\n * @param {RawVector} newHalfExtents\n */\n coSetHalfExtents(handle, newHalfExtents) {\n _assertClass(newHalfExtents, RawVector);\n wasm.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, handle, newHalfExtents.__wbg_ptr);\n }\n /**\n * The radius of this collider if it is a ball, capsule, cylinder, or cone shape.\n * @param {number} handle\n * @returns {number | undefined}\n */\n coRadius(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coRadius(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getFloat32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Set the radius of this collider if it is a ball, capsule, cylinder, or cone shape.\n * @param {number} handle\n * @param {number} newRadius\n */\n coSetRadius(handle, newRadius) {\n wasm.rawcolliderset_coSetRadius(this.__wbg_ptr, handle, newRadius);\n }\n /**\n * The half height of this collider if it is a capsule, cylinder, or cone shape.\n * @param {number} handle\n * @returns {number | undefined}\n */\n coHalfHeight(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coHalfHeight(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getFloat32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Set the half height of this collider if it is a capsule, cylinder, or cone shape.\n * @param {number} handle\n * @param {number} newHalfheight\n */\n coSetHalfHeight(handle, newHalfheight) {\n wasm.rawcolliderset_coSetHalfHeight(this.__wbg_ptr, handle, newHalfheight);\n }\n /**\n * The radius of the round edges of this collider.\n * @param {number} handle\n * @returns {number | undefined}\n */\n coRoundRadius(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coRoundRadius(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getFloat32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Set the radius of the round edges of this collider.\n * @param {number} handle\n * @param {number} newBorderRadius\n */\n coSetRoundRadius(handle, newBorderRadius) {\n wasm.rawcolliderset_coSetRoundRadius(this.__wbg_ptr, handle, newBorderRadius);\n }\n /**\n * The vertices of this triangle mesh, polyline, convex polyhedron, segment, triangle or convex polyhedron, if it is one.\n * @param {number} handle\n * @returns {Float32Array | undefined}\n */\n coVertices(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coVertices(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n let v1;\n if (r0 !== 0) {\n v1 = getArrayF32FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 4, 4);\n }\n return v1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * The indices of this triangle mesh, polyline, or convex polyhedron, if it is one.\n * @param {number} handle\n * @returns {Uint32Array | undefined}\n */\n coIndices(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coIndices(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n let v1;\n if (r0 !== 0) {\n v1 = getArrayU32FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 4, 4);\n }\n return v1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @param {number} handle\n * @returns {number | undefined}\n */\n coTriMeshFlags(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coTriMeshFlags(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1 >>> 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * The height of this heightfield if it is one.\n * @param {number} handle\n * @returns {Float32Array | undefined}\n */\n coHeightfieldHeights(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coHeightfieldHeights(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n let v1;\n if (r0 !== 0) {\n v1 = getArrayF32FromWasm0(r0, r1).slice();\n wasm.__wbindgen_free(r0, r1 * 4, 4);\n }\n return v1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * The scaling factor applied of this heightfield if it is one.\n * @param {number} handle\n * @returns {RawVector | undefined}\n */\n coHeightfieldScale(handle) {\n const ret = wasm.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, handle);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * The unique integer identifier of the collider this collider is attached to.\n * @param {number} handle\n * @returns {number | undefined}\n */\n coParent(handle) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawcolliderset_coParent(retptr, this.__wbg_ptr, handle);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r2 = getFloat64Memory0()[retptr / 8 + 1];\n return r0 === 0 ? undefined : r2;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @param {number} handle\n * @param {boolean} enabled\n */\n coSetEnabled(handle, enabled) {\n wasm.rawcolliderset_coSetEnabled(this.__wbg_ptr, handle, enabled);\n }\n /**\n * @param {number} handle\n * @returns {boolean}\n */\n coIsEnabled(handle) {\n const ret = wasm.rawcolliderset_coIsEnabled(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * @param {number} handle\n * @param {number} contact_skin\n */\n coSetContactSkin(handle, contact_skin) {\n wasm.rawcolliderset_coSetContactSkin(this.__wbg_ptr, handle, contact_skin);\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n coContactSkin(handle) {\n const ret = wasm.rawcolliderset_coContactSkin(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The friction coefficient of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coFriction(handle) {\n const ret = wasm.rawcolliderset_coFriction(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The restitution coefficient of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coRestitution(handle) {\n const ret = wasm.rawcolliderset_coRestitution(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The density of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coDensity(handle) {\n const ret = wasm.rawcolliderset_coDensity(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The mass of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coMass(handle) {\n const ret = wasm.rawcolliderset_coMass(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The volume of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coVolume(handle) {\n const ret = wasm.rawcolliderset_coVolume(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The collision groups of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coCollisionGroups(handle) {\n const ret = wasm.rawcolliderset_coCollisionGroups(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * The solver groups of this collider.\n * @param {number} handle\n * @returns {number}\n */\n coSolverGroups(handle) {\n const ret = wasm.rawcolliderset_coSolverGroups(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * The physics hooks enabled for this collider.\n * @param {number} handle\n * @returns {number}\n */\n coActiveHooks(handle) {\n const ret = wasm.rawcolliderset_coActiveHooks(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * The collision types enabled for this collider.\n * @param {number} handle\n * @returns {number}\n */\n coActiveCollisionTypes(handle) {\n const ret = wasm.rawcolliderset_coActiveCollisionTypes(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The events enabled for this collider.\n * @param {number} handle\n * @returns {number}\n */\n coActiveEvents(handle) {\n const ret = wasm.rawcolliderset_coActiveEvents(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * The total force magnitude beyond which a contact force event can be emitted.\n * @param {number} handle\n * @returns {number}\n */\n coContactForceEventThreshold(handle) {\n const ret = wasm.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {RawVector} point\n * @returns {boolean}\n */\n coContainsPoint(handle, point) {\n _assertClass(point, RawVector);\n const ret = wasm.rawcolliderset_coContainsPoint(this.__wbg_ptr, handle, point.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {number} handle\n * @param {RawVector} colliderVel\n * @param {RawShape} shape2\n * @param {RawVector} shape2Pos\n * @param {RawRotation} shape2Rot\n * @param {RawVector} shape2Vel\n * @param {number} target_distance\n * @param {number} maxToi\n * @param {boolean} stop_at_penetration\n * @returns {RawShapeCastHit | undefined}\n */\n coCastShape(handle, colliderVel, shape2, shape2Pos, shape2Rot, shape2Vel, target_distance, maxToi, stop_at_penetration) {\n _assertClass(colliderVel, RawVector);\n _assertClass(shape2, RawShape);\n _assertClass(shape2Pos, RawVector);\n _assertClass(shape2Rot, RawRotation);\n _assertClass(shape2Vel, RawVector);\n const ret = wasm.rawcolliderset_coCastShape(this.__wbg_ptr, handle, colliderVel.__wbg_ptr, shape2.__wbg_ptr, shape2Pos.__wbg_ptr, shape2Rot.__wbg_ptr, shape2Vel.__wbg_ptr, target_distance, maxToi, stop_at_penetration);\n return ret === 0 ? undefined : RawShapeCastHit.__wrap(ret);\n }\n /**\n * @param {number} handle\n * @param {RawVector} collider1Vel\n * @param {number} collider2handle\n * @param {RawVector} collider2Vel\n * @param {number} target_distance\n * @param {number} max_toi\n * @param {boolean} stop_at_penetration\n * @returns {RawColliderShapeCastHit | undefined}\n */\n coCastCollider(handle, collider1Vel, collider2handle, collider2Vel, target_distance, max_toi, stop_at_penetration) {\n _assertClass(collider1Vel, RawVector);\n _assertClass(collider2Vel, RawVector);\n const ret = wasm.rawcolliderset_coCastCollider(this.__wbg_ptr, handle, collider1Vel.__wbg_ptr, collider2handle, collider2Vel.__wbg_ptr, target_distance, max_toi, stop_at_penetration);\n return ret === 0 ? undefined : RawColliderShapeCastHit.__wrap(ret);\n }\n /**\n * @param {number} handle\n * @param {RawShape} shape2\n * @param {RawVector} shapePos2\n * @param {RawRotation} shapeRot2\n * @returns {boolean}\n */\n coIntersectsShape(handle, shape2, shapePos2, shapeRot2) {\n _assertClass(shape2, RawShape);\n _assertClass(shapePos2, RawVector);\n _assertClass(shapeRot2, RawRotation);\n const ret = wasm.rawcolliderset_coIntersectsShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {number} handle\n * @param {RawShape} shape2\n * @param {RawVector} shapePos2\n * @param {RawRotation} shapeRot2\n * @param {number} prediction\n * @returns {RawShapeContact | undefined}\n */\n coContactShape(handle, shape2, shapePos2, shapeRot2, prediction) {\n _assertClass(shape2, RawShape);\n _assertClass(shapePos2, RawVector);\n _assertClass(shapeRot2, RawRotation);\n const ret = wasm.rawcolliderset_coContactShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction);\n return ret === 0 ? undefined : RawShapeContact.__wrap(ret);\n }\n /**\n * @param {number} handle\n * @param {number} collider2handle\n * @param {number} prediction\n * @returns {RawShapeContact | undefined}\n */\n coContactCollider(handle, collider2handle, prediction) {\n const ret = wasm.rawcolliderset_coContactCollider(this.__wbg_ptr, handle, collider2handle, prediction);\n return ret === 0 ? undefined : RawShapeContact.__wrap(ret);\n }\n /**\n * @param {number} handle\n * @param {RawVector} point\n * @param {boolean} solid\n * @returns {RawPointProjection}\n */\n coProjectPoint(handle, point, solid) {\n _assertClass(point, RawVector);\n const ret = wasm.rawcolliderset_coProjectPoint(this.__wbg_ptr, handle, point.__wbg_ptr, solid);\n return RawPointProjection.__wrap(ret);\n }\n /**\n * @param {number} handle\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @returns {boolean}\n */\n coIntersectsRay(handle, rayOrig, rayDir, maxToi) {\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawcolliderset_coIntersectsRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi);\n return ret !== 0;\n }\n /**\n * @param {number} handle\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @returns {number}\n */\n coCastRay(handle, rayOrig, rayDir, maxToi, solid) {\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawcolliderset_coCastRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @returns {RawRayIntersection | undefined}\n */\n coCastRayAndGetNormal(handle, rayOrig, rayDir, maxToi, solid) {\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);\n return ret === 0 ? undefined : RawRayIntersection.__wrap(ret);\n }\n /**\n * @param {number} handle\n * @param {boolean} is_sensor\n */\n coSetSensor(handle, is_sensor) {\n wasm.rawcolliderset_coSetSensor(this.__wbg_ptr, handle, is_sensor);\n }\n /**\n * @param {number} handle\n * @param {number} restitution\n */\n coSetRestitution(handle, restitution) {\n wasm.rawcolliderset_coSetRestitution(this.__wbg_ptr, handle, restitution);\n }\n /**\n * @param {number} handle\n * @param {number} friction\n */\n coSetFriction(handle, friction) {\n wasm.rawcolliderset_coSetFriction(this.__wbg_ptr, handle, friction);\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n coFrictionCombineRule(handle) {\n const ret = wasm.rawcolliderset_coFrictionCombineRule(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * @param {number} handle\n * @param {number} rule\n */\n coSetFrictionCombineRule(handle, rule) {\n wasm.rawcolliderset_coSetFrictionCombineRule(this.__wbg_ptr, handle, rule);\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n coRestitutionCombineRule(handle) {\n const ret = wasm.rawcolliderset_coRestitutionCombineRule(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * @param {number} handle\n * @param {number} rule\n */\n coSetRestitutionCombineRule(handle, rule) {\n wasm.rawcolliderset_coSetRestitutionCombineRule(this.__wbg_ptr, handle, rule);\n }\n /**\n * @param {number} handle\n * @param {number} groups\n */\n coSetCollisionGroups(handle, groups) {\n wasm.rawcolliderset_coSetCollisionGroups(this.__wbg_ptr, handle, groups);\n }\n /**\n * @param {number} handle\n * @param {number} groups\n */\n coSetSolverGroups(handle, groups) {\n wasm.rawcolliderset_coSetSolverGroups(this.__wbg_ptr, handle, groups);\n }\n /**\n * @param {number} handle\n * @param {number} hooks\n */\n coSetActiveHooks(handle, hooks) {\n wasm.rawcolliderset_coSetActiveHooks(this.__wbg_ptr, handle, hooks);\n }\n /**\n * @param {number} handle\n * @param {number} events\n */\n coSetActiveEvents(handle, events) {\n wasm.rawcolliderset_coSetActiveEvents(this.__wbg_ptr, handle, events);\n }\n /**\n * @param {number} handle\n * @param {number} types\n */\n coSetActiveCollisionTypes(handle, types) {\n wasm.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, handle, types);\n }\n /**\n * @param {number} handle\n * @param {RawShape} shape\n */\n coSetShape(handle, shape) {\n _assertClass(shape, RawShape);\n wasm.rawcolliderset_coSetShape(this.__wbg_ptr, handle, shape.__wbg_ptr);\n }\n /**\n * @param {number} handle\n * @param {number} threshold\n */\n coSetContactForceEventThreshold(handle, threshold) {\n wasm.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, handle, threshold);\n }\n /**\n * @param {number} handle\n * @param {number} density\n */\n coSetDensity(handle, density) {\n wasm.rawcolliderset_coSetDensity(this.__wbg_ptr, handle, density);\n }\n /**\n * @param {number} handle\n * @param {number} mass\n */\n coSetMass(handle, mass) {\n wasm.rawcolliderset_coSetMass(this.__wbg_ptr, handle, mass);\n }\n /**\n * @param {number} handle\n * @param {number} mass\n * @param {RawVector} centerOfMass\n * @param {number} principalAngularInertia\n */\n coSetMassProperties(handle, mass, centerOfMass, principalAngularInertia) {\n _assertClass(centerOfMass, RawVector);\n wasm.rawcolliderset_coSetMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawcolliderset_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @returns {number}\n */\n len() {\n const ret = wasm.rawcolliderset_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} handle\n * @returns {boolean}\n */\n contains(handle) {\n const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * @param {boolean} enabled\n * @param {RawShape} shape\n * @param {RawVector} translation\n * @param {RawRotation} rotation\n * @param {number} massPropsMode\n * @param {number} mass\n * @param {RawVector} centerOfMass\n * @param {number} principalAngularInertia\n * @param {number} density\n * @param {number} friction\n * @param {number} restitution\n * @param {number} frictionCombineRule\n * @param {number} restitutionCombineRule\n * @param {boolean} isSensor\n * @param {number} collisionGroups\n * @param {number} solverGroups\n * @param {number} activeCollisionTypes\n * @param {number} activeHooks\n * @param {number} activeEvents\n * @param {number} contactForceEventThreshold\n * @param {number} contactSkin\n * @param {boolean} hasParent\n * @param {number} parent\n * @param {RawRigidBodySet} bodies\n * @returns {number | undefined}\n */\n createCollider(enabled, shape, translation, rotation, massPropsMode, mass, centerOfMass, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(shape, RawShape);\n _assertClass(translation, RawVector);\n _assertClass(rotation, RawRotation);\n _assertClass(centerOfMass, RawVector);\n _assertClass(bodies, RawRigidBodySet);\n wasm.rawcolliderset_createCollider(retptr, this.__wbg_ptr, enabled, shape.__wbg_ptr, translation.__wbg_ptr, rotation.__wbg_ptr, massPropsMode, mass, centerOfMass.__wbg_ptr, principalAngularInertia, density, friction, restitution, frictionCombineRule, restitutionCombineRule, isSensor, collisionGroups, solverGroups, activeCollisionTypes, activeHooks, activeEvents, contactForceEventThreshold, contactSkin, hasParent, parent, bodies.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r2 = getFloat64Memory0()[retptr / 8 + 1];\n return r0 === 0 ? undefined : r2;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Removes a collider from this set and wake-up the rigid-body it is attached to.\n * @param {number} handle\n * @param {RawIslandManager} islands\n * @param {RawRigidBodySet} bodies\n * @param {boolean} wakeUp\n */\n remove(handle, islands, bodies, wakeUp) {\n _assertClass(islands, RawIslandManager);\n _assertClass(bodies, RawRigidBodySet);\n wasm.rawcolliderset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, bodies.__wbg_ptr, wakeUp);\n }\n /**\n * Checks if a collider with the given integer handle exists.\n * @param {number} handle\n * @returns {boolean}\n */\n isHandleValid(handle) {\n const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Applies the given JavaScript function to the integer handle of each collider managed by this collider set.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each collider managed by this collider set. Called as `f(handle)`.\n * @param {Function} f\n */\n forEachColliderHandle(f) {\n try {\n wasm.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n}\n/**\n*/\nexport class RawColliderShapeCastHit {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawColliderShapeCastHit.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawcollidershapecasthit_free(ptr);\n }\n /**\n * @returns {number}\n */\n colliderHandle() {\n const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n time_of_impact() {\n const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n witness1() {\n const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n witness2() {\n const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n normal1() {\n const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n normal2() {\n const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawContactForceEvent {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawContactForceEvent.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawcontactforceevent_free(ptr);\n }\n /**\n * The first collider involved in the contact.\n * @returns {number}\n */\n collider1() {\n const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr);\n return ret;\n }\n /**\n * The second collider involved in the contact.\n * @returns {number}\n */\n collider2() {\n const ret = wasm.rawcontactforceevent_collider2(this.__wbg_ptr);\n return ret;\n }\n /**\n * The sum of all the forces between the two colliders.\n * @returns {RawVector}\n */\n total_force() {\n const ret = wasm.rawcontactforceevent_total_force(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * The sum of the magnitudes of each force between the two colliders.\n *\n * Note that this is **not** the same as the magnitude of `self.total_force`.\n * Here we are summing the magnitude of all the forces, instead of taking\n * the magnitude of their sum.\n * @returns {number}\n */\n total_force_magnitude() {\n const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);\n return ret;\n }\n /**\n * The world-space (unit) direction of the force with strongest magnitude.\n * @returns {RawVector}\n */\n max_force_direction() {\n const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * The magnitude of the largest force at a contact point of this contact pair.\n * @returns {number}\n */\n max_force_magnitude() {\n const ret = wasm.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);\n return ret;\n }\n}\n/**\n*/\nexport class RawContactManifold {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawContactManifold.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawcontactmanifold_free(ptr);\n }\n /**\n * @returns {RawVector}\n */\n normal() {\n const ret = wasm.rawcontactmanifold_normal(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n local_n1() {\n const ret = wasm.rawcontactmanifold_local_n1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n local_n2() {\n const ret = wasm.rawcontactmanifold_local_n2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {number}\n */\n subshape1() {\n const ret = wasm.rawcontactmanifold_subshape1(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n subshape2() {\n const ret = wasm.rawcontactmanifold_subshape2(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n num_contacts() {\n const ret = wasm.rawcontactmanifold_num_contacts(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} i\n * @returns {RawVector | undefined}\n */\n contact_local_p1(i) {\n const ret = wasm.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, i);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * @param {number} i\n * @returns {RawVector | undefined}\n */\n contact_local_p2(i) {\n const ret = wasm.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, i);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n contact_dist(i) {\n const ret = wasm.rawcontactmanifold_contact_dist(this.__wbg_ptr, i);\n return ret;\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n contact_fid1(i) {\n const ret = wasm.rawcontactmanifold_contact_fid1(this.__wbg_ptr, i);\n return ret >>> 0;\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n contact_fid2(i) {\n const ret = wasm.rawcontactmanifold_contact_fid2(this.__wbg_ptr, i);\n return ret >>> 0;\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n contact_impulse(i) {\n const ret = wasm.rawcontactmanifold_contact_impulse(this.__wbg_ptr, i);\n return ret;\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n contact_tangent_impulse(i) {\n const ret = wasm.rawcontactmanifold_contact_tangent_impulse(this.__wbg_ptr, i);\n return ret;\n }\n /**\n * @returns {number}\n */\n num_solver_contacts() {\n const ret = wasm.rawcontactmanifold_num_solver_contacts(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} i\n * @returns {RawVector | undefined}\n */\n solver_contact_point(i) {\n const ret = wasm.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, i);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n solver_contact_dist(i) {\n const ret = wasm.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, i);\n return ret;\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n solver_contact_friction(i) {\n const ret = wasm.rawcontactmanifold_solver_contact_friction(this.__wbg_ptr, i);\n return ret;\n }\n /**\n * @param {number} i\n * @returns {number}\n */\n solver_contact_restitution(i) {\n const ret = wasm.rawcontactmanifold_solver_contact_restitution(this.__wbg_ptr, i);\n return ret;\n }\n /**\n * @param {number} i\n * @returns {RawVector}\n */\n solver_contact_tangent_velocity(i) {\n const ret = wasm.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, i);\n return RawVector.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawContactPair {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawContactPair.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawcontactpair_free(ptr);\n }\n /**\n * @returns {number}\n */\n collider1() {\n const ret = wasm.rawcontactpair_collider1(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n collider2() {\n const ret = wasm.rawcontactpair_collider2(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n numContactManifolds() {\n const ret = wasm.rawcontactpair_numContactManifolds(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} i\n * @returns {RawContactManifold | undefined}\n */\n contactManifold(i) {\n const ret = wasm.rawcontactpair_contactManifold(this.__wbg_ptr, i);\n return ret === 0 ? undefined : RawContactManifold.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawDebugRenderPipeline {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawdebugrenderpipeline_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawdebugrenderpipeline_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @returns {Float32Array}\n */\n vertices() {\n const ret = wasm.rawdebugrenderpipeline_vertices(this.__wbg_ptr);\n return takeObject(ret);\n }\n /**\n * @returns {Float32Array}\n */\n colors() {\n const ret = wasm.rawdebugrenderpipeline_colors(this.__wbg_ptr);\n return takeObject(ret);\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawImpulseJointSet} impulse_joints\n * @param {RawMultibodyJointSet} multibody_joints\n * @param {RawNarrowPhase} narrow_phase\n */\n render(bodies, colliders, impulse_joints, multibody_joints, narrow_phase) {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(impulse_joints, RawImpulseJointSet);\n _assertClass(multibody_joints, RawMultibodyJointSet);\n _assertClass(narrow_phase, RawNarrowPhase);\n wasm.rawdebugrenderpipeline_render(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, impulse_joints.__wbg_ptr, multibody_joints.__wbg_ptr, narrow_phase.__wbg_ptr);\n }\n}\n/**\n*/\nexport class RawDeserializedWorld {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawDeserializedWorld.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawdeserializedworld_free(ptr);\n }\n /**\n * @returns {RawVector | undefined}\n */\n takeGravity() {\n const ret = wasm.rawdeserializedworld_takeGravity(this.__wbg_ptr);\n return ret === 0 ? undefined : RawVector.__wrap(ret);\n }\n /**\n * @returns {RawIntegrationParameters | undefined}\n */\n takeIntegrationParameters() {\n const ret = wasm.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);\n return ret === 0 ? undefined : RawIntegrationParameters.__wrap(ret);\n }\n /**\n * @returns {RawIslandManager | undefined}\n */\n takeIslandManager() {\n const ret = wasm.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);\n return ret === 0 ? undefined : RawIslandManager.__wrap(ret);\n }\n /**\n * @returns {RawBroadPhase | undefined}\n */\n takeBroadPhase() {\n const ret = wasm.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);\n return ret === 0 ? undefined : RawBroadPhase.__wrap(ret);\n }\n /**\n * @returns {RawNarrowPhase | undefined}\n */\n takeNarrowPhase() {\n const ret = wasm.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr);\n return ret === 0 ? undefined : RawNarrowPhase.__wrap(ret);\n }\n /**\n * @returns {RawRigidBodySet | undefined}\n */\n takeBodies() {\n const ret = wasm.rawdeserializedworld_takeBodies(this.__wbg_ptr);\n return ret === 0 ? undefined : RawRigidBodySet.__wrap(ret);\n }\n /**\n * @returns {RawColliderSet | undefined}\n */\n takeColliders() {\n const ret = wasm.rawdeserializedworld_takeColliders(this.__wbg_ptr);\n return ret === 0 ? undefined : RawColliderSet.__wrap(ret);\n }\n /**\n * @returns {RawImpulseJointSet | undefined}\n */\n takeImpulseJoints() {\n const ret = wasm.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr);\n return ret === 0 ? undefined : RawImpulseJointSet.__wrap(ret);\n }\n /**\n * @returns {RawMultibodyJointSet | undefined}\n */\n takeMultibodyJoints() {\n const ret = wasm.rawdeserializedworld_takeMultibodyJoints(this.__wbg_ptr);\n return ret === 0 ? undefined : RawMultibodyJointSet.__wrap(ret);\n }\n}\n/**\n* A structure responsible for collecting events generated\n* by the physics engine.\n*/\nexport class RawEventQueue {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_raweventqueue_free(ptr);\n }\n /**\n * Creates a new event collector.\n *\n * # Parameters\n * - `autoDrain`: setting this to `true` is strongly recommended. If true, the collector will\n * be automatically drained before each `world.step(collector)`. If false, the collector will\n * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of\n * RAM if no drain is performed.\n * @param {boolean} autoDrain\n */\n constructor(autoDrain) {\n const ret = wasm.raweventqueue_new(autoDrain);\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * Applies the given javascript closure on each collision event of this collector, then clear\n * the internal collision event buffer.\n *\n * # Parameters\n * - `f(handle1, handle2, started)`: JavaScript closure applied to each collision event. The\n * closure should take three arguments: two integers representing the handles of the colliders\n * involved in the collision, and a boolean indicating if the collision started (true) or stopped\n * (false).\n * @param {Function} f\n */\n drainCollisionEvents(f) {\n try {\n wasm.raweventqueue_drainCollisionEvents(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {Function} f\n */\n drainContactForceEvents(f) {\n try {\n wasm.raweventqueue_drainContactForceEvents(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * Removes all events contained by this collector.\n */\n clear() {\n wasm.raweventqueue_clear(this.__wbg_ptr);\n }\n}\n/**\n*/\nexport class RawGenericJoint {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawGenericJoint.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawgenericjoint_free(ptr);\n }\n /**\n * @param {number} rest_length\n * @param {number} stiffness\n * @param {number} damping\n * @param {RawVector} anchor1\n * @param {RawVector} anchor2\n * @returns {RawGenericJoint}\n */\n static spring(rest_length, stiffness, damping, anchor1, anchor2) {\n _assertClass(anchor1, RawVector);\n _assertClass(anchor2, RawVector);\n const ret = wasm.rawgenericjoint_spring(rest_length, stiffness, damping, anchor1.__wbg_ptr, anchor2.__wbg_ptr);\n return RawGenericJoint.__wrap(ret);\n }\n /**\n * @param {number} length\n * @param {RawVector} anchor1\n * @param {RawVector} anchor2\n * @returns {RawGenericJoint}\n */\n static rope(length, anchor1, anchor2) {\n _assertClass(anchor1, RawVector);\n _assertClass(anchor2, RawVector);\n const ret = wasm.rawgenericjoint_rope(length, anchor1.__wbg_ptr, anchor2.__wbg_ptr);\n return RawGenericJoint.__wrap(ret);\n }\n /**\n * Creates a new joint descriptor that builds a Prismatic joint.\n *\n * A prismatic joint removes all the degrees of freedom between the\n * affected bodies, except for the translation along one axis.\n *\n * Returns `None` if any of the provided axes cannot be normalized.\n * @param {RawVector} anchor1\n * @param {RawVector} anchor2\n * @param {RawVector} axis\n * @param {boolean} limitsEnabled\n * @param {number} limitsMin\n * @param {number} limitsMax\n * @returns {RawGenericJoint | undefined}\n */\n static prismatic(anchor1, anchor2, axis, limitsEnabled, limitsMin, limitsMax) {\n _assertClass(anchor1, RawVector);\n _assertClass(anchor2, RawVector);\n _assertClass(axis, RawVector);\n const ret = wasm.rawgenericjoint_prismatic(anchor1.__wbg_ptr, anchor2.__wbg_ptr, axis.__wbg_ptr, limitsEnabled, limitsMin, limitsMax);\n return ret === 0 ? undefined : RawGenericJoint.__wrap(ret);\n }\n /**\n * Creates a new joint descriptor that builds a Fixed joint.\n *\n * A fixed joint removes all the degrees of freedom between the affected bodies.\n * @param {RawVector} anchor1\n * @param {RawRotation} axes1\n * @param {RawVector} anchor2\n * @param {RawRotation} axes2\n * @returns {RawGenericJoint}\n */\n static fixed(anchor1, axes1, anchor2, axes2) {\n _assertClass(anchor1, RawVector);\n _assertClass(axes1, RawRotation);\n _assertClass(anchor2, RawVector);\n _assertClass(axes2, RawRotation);\n const ret = wasm.rawgenericjoint_fixed(anchor1.__wbg_ptr, axes1.__wbg_ptr, anchor2.__wbg_ptr, axes2.__wbg_ptr);\n return RawGenericJoint.__wrap(ret);\n }\n /**\n * Create a new joint descriptor that builds Revolute joints.\n *\n * A revolute joint removes all degrees of freedom between the affected\n * bodies except for the rotation.\n * @param {RawVector} anchor1\n * @param {RawVector} anchor2\n * @returns {RawGenericJoint | undefined}\n */\n static revolute(anchor1, anchor2) {\n _assertClass(anchor1, RawVector);\n _assertClass(anchor2, RawVector);\n const ret = wasm.rawgenericjoint_revolute(anchor1.__wbg_ptr, anchor2.__wbg_ptr);\n return ret === 0 ? undefined : RawGenericJoint.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawImpulseJointSet {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawImpulseJointSet.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawimpulsejointset_free(ptr);\n }\n /**\n * The type of this joint.\n * @param {number} handle\n * @returns {RawJointType}\n */\n jointType(handle) {\n const ret = wasm.rawimpulsejointset_jointType(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The unique integer identifier of the first rigid-body this joint it attached to.\n * @param {number} handle\n * @returns {number}\n */\n jointBodyHandle1(handle) {\n const ret = wasm.rawimpulsejointset_jointBodyHandle1(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The unique integer identifier of the second rigid-body this joint is attached to.\n * @param {number} handle\n * @returns {number}\n */\n jointBodyHandle2(handle) {\n const ret = wasm.rawimpulsejointset_jointBodyHandle2(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The angular part of the joint’s local frame relative to the first rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawRotation}\n */\n jointFrameX1(handle) {\n const ret = wasm.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * The angular part of the joint’s local frame relative to the second rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawRotation}\n */\n jointFrameX2(handle) {\n const ret = wasm.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * The position of the first anchor of this joint.\n *\n * The first anchor gives the position of the points application point on the\n * local frame of the first rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawVector}\n */\n jointAnchor1(handle) {\n const ret = wasm.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The position of the second anchor of this joint.\n *\n * The second anchor gives the position of the points application point on the\n * local frame of the second rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawVector}\n */\n jointAnchor2(handle) {\n const ret = wasm.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * Sets the position of the first local anchor\n * @param {number} handle\n * @param {RawVector} newPos\n */\n jointSetAnchor1(handle, newPos) {\n _assertClass(newPos, RawVector);\n wasm.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, handle, newPos.__wbg_ptr);\n }\n /**\n * Sets the position of the second local anchor\n * @param {number} handle\n * @param {RawVector} newPos\n */\n jointSetAnchor2(handle, newPos) {\n _assertClass(newPos, RawVector);\n wasm.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, handle, newPos.__wbg_ptr);\n }\n /**\n * Are contacts between the rigid-bodies attached by this joint enabled?\n * @param {number} handle\n * @returns {boolean}\n */\n jointContactsEnabled(handle) {\n const ret = wasm.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Sets whether contacts are enabled between the rigid-bodies attached by this joint.\n * @param {number} handle\n * @param {boolean} enabled\n */\n jointSetContactsEnabled(handle, enabled) {\n wasm.rawimpulsejointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled);\n }\n /**\n * Are the limits for this joint enabled?\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @returns {boolean}\n */\n jointLimitsEnabled(handle, axis) {\n const ret = wasm.rawimpulsejointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis);\n return ret !== 0;\n }\n /**\n * Return the lower limit along the given joint axis.\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @returns {number}\n */\n jointLimitsMin(handle, axis) {\n const ret = wasm.rawimpulsejointset_jointLimitsMin(this.__wbg_ptr, handle, axis);\n return ret;\n }\n /**\n * If this is a prismatic joint, returns its upper limit.\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @returns {number}\n */\n jointLimitsMax(handle, axis) {\n const ret = wasm.rawimpulsejointset_jointLimitsMax(this.__wbg_ptr, handle, axis);\n return ret;\n }\n /**\n * Enables and sets the joint limits\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @param {number} min\n * @param {number} max\n */\n jointSetLimits(handle, axis, min, max) {\n wasm.rawimpulsejointset_jointSetLimits(this.__wbg_ptr, handle, axis, min, max);\n }\n /**\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @param {RawMotorModel} model\n */\n jointConfigureMotorModel(handle, axis, model) {\n wasm.rawimpulsejointset_jointConfigureMotorModel(this.__wbg_ptr, handle, axis, model);\n }\n /**\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @param {number} targetVel\n * @param {number} factor\n */\n jointConfigureMotorVelocity(handle, axis, targetVel, factor) {\n wasm.rawimpulsejointset_jointConfigureMotorVelocity(this.__wbg_ptr, handle, axis, targetVel, factor);\n }\n /**\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @param {number} targetPos\n * @param {number} stiffness\n * @param {number} damping\n */\n jointConfigureMotorPosition(handle, axis, targetPos, stiffness, damping) {\n wasm.rawimpulsejointset_jointConfigureMotorPosition(this.__wbg_ptr, handle, axis, targetPos, stiffness, damping);\n }\n /**\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @param {number} targetPos\n * @param {number} targetVel\n * @param {number} stiffness\n * @param {number} damping\n */\n jointConfigureMotor(handle, axis, targetPos, targetVel, stiffness, damping) {\n wasm.rawimpulsejointset_jointConfigureMotor(this.__wbg_ptr, handle, axis, targetPos, targetVel, stiffness, damping);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawimpulsejointset_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {RawGenericJoint} params\n * @param {number} parent1\n * @param {number} parent2\n * @param {boolean} wake_up\n * @returns {number}\n */\n createJoint(params, parent1, parent2, wake_up) {\n _assertClass(params, RawGenericJoint);\n const ret = wasm.rawimpulsejointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wake_up);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {boolean} wakeUp\n */\n remove(handle, wakeUp) {\n wasm.rawimpulsejointset_remove(this.__wbg_ptr, handle, wakeUp);\n }\n /**\n * @returns {number}\n */\n len() {\n const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} handle\n * @returns {boolean}\n */\n contains(handle) {\n const ret = wasm.rawimpulsejointset_contains(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Applies the given JavaScript function to the integer handle of each joint managed by this physics world.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`.\n * @param {Function} f\n */\n forEachJointHandle(f) {\n try {\n wasm.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`.\n * @param {number} body\n * @param {Function} f\n */\n forEachJointAttachedToRigidBody(body, f) {\n try {\n wasm.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n}\n/**\n*/\nexport class RawIntegrationParameters {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawIntegrationParameters.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawintegrationparameters_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawintegrationparameters_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @returns {number}\n */\n get dt() {\n const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n get erp() {\n const ret = wasm.rawintegrationparameters_erp(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n get normalizedAllowedLinearError() {\n const ret = wasm.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n get normalizedPredictionDistance() {\n const ret = wasm.rawintegrationparameters_normalizedPredictionDistance(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n get numSolverIterations() {\n const ret = wasm.rawintegrationparameters_numSolverIterations(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n get numAdditionalFrictionIterations() {\n const ret = wasm.rawintegrationparameters_numAdditionalFrictionIterations(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n get numInternalPgsIterations() {\n const ret = wasm.rawintegrationparameters_numInternalPgsIterations(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n get minIslandSize() {\n const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n get maxCcdSubsteps() {\n const ret = wasm.rawintegrationparameters_maxCcdSubsteps(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @returns {number}\n */\n get lengthUnit() {\n const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);\n return ret;\n }\n /**\n * @param {number} value\n */\n set dt(value) {\n wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set erp(value) {\n wasm.rawintegrationparameters_set_erp(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set normalizedAllowedLinearError(value) {\n wasm.rawintegrationparameters_set_normalizedAllowedLinearError(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set normalizedPredictionDistance(value) {\n wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set numSolverIterations(value) {\n wasm.rawintegrationparameters_set_numSolverIterations(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set numAdditionalFrictionIterations(value) {\n wasm.rawintegrationparameters_set_numAdditionalFrictionIterations(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set numInternalPgsIterations(value) {\n wasm.rawintegrationparameters_set_numInternalPgsIterations(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set minIslandSize(value) {\n wasm.rawintegrationparameters_set_minIslandSize(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set maxCcdSubsteps(value) {\n wasm.rawintegrationparameters_set_maxCcdSubsteps(this.__wbg_ptr, value);\n }\n /**\n * @param {number} value\n */\n set lengthUnit(value) {\n wasm.rawintegrationparameters_set_lengthUnit(this.__wbg_ptr, value);\n }\n /**\n */\n switchToStandardPgsSolver() {\n wasm.rawintegrationparameters_switchToStandardPgsSolver(this.__wbg_ptr);\n }\n /**\n */\n switchToSmallStepsPgsSolver() {\n wasm.rawintegrationparameters_switchToSmallStepsPgsSolver(this.__wbg_ptr);\n }\n /**\n */\n switchToSmallStepsPgsSolverWithoutWarmstart() {\n wasm.rawintegrationparameters_switchToSmallStepsPgsSolverWithoutWarmstart(this.__wbg_ptr);\n }\n}\n/**\n*/\nexport class RawIslandManager {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawIslandManager.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawislandmanager_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawislandmanager_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * Applies the given JavaScript function to the integer handle of each active rigid-body\n * managed by this island manager.\n *\n * After a short time of inactivity, a rigid-body is automatically deactivated (\"asleep\") by\n * the physics engine in order to save computational power. A sleeping rigid-body never moves\n * unless it is moved manually by the user.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each active rigid-body managed by this\n * set. Called as `f(collider)`.\n * @param {Function} f\n */\n forEachActiveRigidBodyHandle(f) {\n try {\n wasm.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n}\n/**\n*/\nexport class RawKinematicCharacterController {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawkinematiccharactercontroller_free(ptr);\n }\n /**\n * @param {number} offset\n */\n constructor(offset) {\n const ret = wasm.rawkinematiccharactercontroller_new(offset);\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @returns {RawVector}\n */\n up() {\n const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @param {RawVector} vector\n */\n setUp(vector) {\n _assertClass(vector, RawVector);\n wasm.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, vector.__wbg_ptr);\n }\n /**\n * @returns {number}\n */\n normalNudgeFactor() {\n const ret = wasm.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);\n return ret;\n }\n /**\n * @param {number} value\n */\n setNormalNudgeFactor(value) {\n wasm.rawkinematiccharactercontroller_setNormalNudgeFactor(this.__wbg_ptr, value);\n }\n /**\n * @returns {number}\n */\n offset() {\n const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);\n return ret;\n }\n /**\n * @param {number} value\n */\n setOffset(value) {\n wasm.rawkinematiccharactercontroller_setOffset(this.__wbg_ptr, value);\n }\n /**\n * @returns {boolean}\n */\n slideEnabled() {\n const ret = wasm.rawkinematiccharactercontroller_slideEnabled(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {boolean} enabled\n */\n setSlideEnabled(enabled) {\n wasm.rawkinematiccharactercontroller_setSlideEnabled(this.__wbg_ptr, enabled);\n }\n /**\n * @returns {number | undefined}\n */\n autostepMaxHeight() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawkinematiccharactercontroller_autostepMaxHeight(retptr, this.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getFloat32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @returns {number | undefined}\n */\n autostepMinWidth() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawkinematiccharactercontroller_autostepMinWidth(retptr, this.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getFloat32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @returns {boolean | undefined}\n */\n autostepIncludesDynamicBodies() {\n const ret = wasm.rawkinematiccharactercontroller_autostepIncludesDynamicBodies(this.__wbg_ptr);\n return ret === 0xFFFFFF ? undefined : ret !== 0;\n }\n /**\n * @returns {boolean}\n */\n autostepEnabled() {\n const ret = wasm.rawkinematiccharactercontroller_autostepEnabled(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {number} maxHeight\n * @param {number} minWidth\n * @param {boolean} includeDynamicBodies\n */\n enableAutostep(maxHeight, minWidth, includeDynamicBodies) {\n wasm.rawkinematiccharactercontroller_enableAutostep(this.__wbg_ptr, maxHeight, minWidth, includeDynamicBodies);\n }\n /**\n */\n disableAutostep() {\n wasm.rawkinematiccharactercontroller_disableAutostep(this.__wbg_ptr);\n }\n /**\n * @returns {number}\n */\n maxSlopeClimbAngle() {\n const ret = wasm.rawintegrationparameters_normalizedPredictionDistance(this.__wbg_ptr);\n return ret;\n }\n /**\n * @param {number} angle\n */\n setMaxSlopeClimbAngle(angle) {\n wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, angle);\n }\n /**\n * @returns {number}\n */\n minSlopeSlideAngle() {\n const ret = wasm.rawkinematiccharactercontroller_minSlopeSlideAngle(this.__wbg_ptr);\n return ret;\n }\n /**\n * @param {number} angle\n */\n setMinSlopeSlideAngle(angle) {\n wasm.rawkinematiccharactercontroller_setMinSlopeSlideAngle(this.__wbg_ptr, angle);\n }\n /**\n * @returns {number | undefined}\n */\n snapToGroundDistance() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawkinematiccharactercontroller_snapToGroundDistance(retptr, this.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getFloat32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @param {number} distance\n */\n enableSnapToGround(distance) {\n wasm.rawkinematiccharactercontroller_enableSnapToGround(this.__wbg_ptr, distance);\n }\n /**\n */\n disableSnapToGround() {\n wasm.rawkinematiccharactercontroller_disableSnapToGround(this.__wbg_ptr);\n }\n /**\n * @returns {boolean}\n */\n snapToGroundEnabled() {\n const ret = wasm.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {number} dt\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawQueryPipeline} queries\n * @param {number} collider_handle\n * @param {RawVector} desired_translation_delta\n * @param {boolean} apply_impulses_to_dynamic_bodies\n * @param {number | undefined} character_mass\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {Function} filter_predicate\n */\n computeColliderMovement(dt, bodies, colliders, queries, collider_handle, desired_translation_delta, apply_impulses_to_dynamic_bodies, character_mass, filter_flags, filter_groups, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(queries, RawQueryPipeline);\n _assertClass(desired_translation_delta, RawVector);\n wasm.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, dt, bodies.__wbg_ptr, colliders.__wbg_ptr, queries.__wbg_ptr, collider_handle, desired_translation_delta.__wbg_ptr, apply_impulses_to_dynamic_bodies, !isLikeNone(character_mass), isLikeNone(character_mass) ? 0 : character_mass, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, addBorrowedObject(filter_predicate));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @returns {RawVector}\n */\n computedMovement() {\n const ret = wasm.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {boolean}\n */\n computedGrounded() {\n const ret = wasm.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @returns {number}\n */\n numComputedCollisions() {\n const ret = wasm.rawkinematiccharactercontroller_numComputedCollisions(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} i\n * @param {RawCharacterCollision} collision\n * @returns {boolean}\n */\n computedCollision(i, collision) {\n _assertClass(collision, RawCharacterCollision);\n const ret = wasm.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, i, collision.__wbg_ptr);\n return ret !== 0;\n }\n}\n/**\n*/\nexport class RawMultibodyJointSet {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawMultibodyJointSet.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawmultibodyjointset_free(ptr);\n }\n /**\n * The type of this joint.\n * @param {number} handle\n * @returns {RawJointType}\n */\n jointType(handle) {\n const ret = wasm.rawmultibodyjointset_jointType(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The angular part of the joint’s local frame relative to the first rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawRotation}\n */\n jointFrameX1(handle) {\n const ret = wasm.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * The angular part of the joint’s local frame relative to the second rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawRotation}\n */\n jointFrameX2(handle) {\n const ret = wasm.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * The position of the first anchor of this joint.\n *\n * The first anchor gives the position of the points application point on the\n * local frame of the first rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawVector}\n */\n jointAnchor1(handle) {\n const ret = wasm.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The position of the second anchor of this joint.\n *\n * The second anchor gives the position of the points application point on the\n * local frame of the second rigid-body it is attached to.\n * @param {number} handle\n * @returns {RawVector}\n */\n jointAnchor2(handle) {\n const ret = wasm.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * Are contacts between the rigid-bodies attached by this joint enabled?\n * @param {number} handle\n * @returns {boolean}\n */\n jointContactsEnabled(handle) {\n const ret = wasm.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Sets whether contacts are enabled between the rigid-bodies attached by this joint.\n * @param {number} handle\n * @param {boolean} enabled\n */\n jointSetContactsEnabled(handle, enabled) {\n wasm.rawmultibodyjointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled);\n }\n /**\n * Are the limits for this joint enabled?\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @returns {boolean}\n */\n jointLimitsEnabled(handle, axis) {\n const ret = wasm.rawmultibodyjointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis);\n return ret !== 0;\n }\n /**\n * Return the lower limit along the given joint axis.\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @returns {number}\n */\n jointLimitsMin(handle, axis) {\n const ret = wasm.rawmultibodyjointset_jointLimitsMin(this.__wbg_ptr, handle, axis);\n return ret;\n }\n /**\n * If this is a prismatic joint, returns its upper limit.\n * @param {number} handle\n * @param {RawJointAxis} axis\n * @returns {number}\n */\n jointLimitsMax(handle, axis) {\n const ret = wasm.rawmultibodyjointset_jointLimitsMax(this.__wbg_ptr, handle, axis);\n return ret;\n }\n /**\n */\n constructor() {\n const ret = wasm.rawmultibodyjointset_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {RawGenericJoint} params\n * @param {number} parent1\n * @param {number} parent2\n * @param {boolean} wakeUp\n * @returns {number}\n */\n createJoint(params, parent1, parent2, wakeUp) {\n _assertClass(params, RawGenericJoint);\n const ret = wasm.rawmultibodyjointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wakeUp);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {boolean} wakeUp\n */\n remove(handle, wakeUp) {\n wasm.rawmultibodyjointset_remove(this.__wbg_ptr, handle, wakeUp);\n }\n /**\n * @param {number} handle\n * @returns {boolean}\n */\n contains(handle) {\n const ret = wasm.rawmultibodyjointset_contains(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Applies the given JavaScript function to the integer handle of each joint managed by this physics world.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`.\n * @param {Function} f\n */\n forEachJointHandle(f) {\n try {\n wasm.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`.\n * @param {number} body\n * @param {Function} f\n */\n forEachJointAttachedToRigidBody(body, f) {\n try {\n wasm.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n}\n/**\n*/\nexport class RawNarrowPhase {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawNarrowPhase.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawnarrowphase_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawnarrowphase_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {number} handle1\n * @param {Function} f\n */\n contact_pairs_with(handle1, f) {\n wasm.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f));\n }\n /**\n * @param {number} handle1\n * @param {number} handle2\n * @returns {RawContactPair | undefined}\n */\n contact_pair(handle1, handle2) {\n const ret = wasm.rawnarrowphase_contact_pair(this.__wbg_ptr, handle1, handle2);\n return ret === 0 ? undefined : RawContactPair.__wrap(ret);\n }\n /**\n * @param {number} handle1\n * @param {Function} f\n */\n intersection_pairs_with(handle1, f) {\n wasm.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f));\n }\n /**\n * @param {number} handle1\n * @param {number} handle2\n * @returns {boolean}\n */\n intersection_pair(handle1, handle2) {\n const ret = wasm.rawnarrowphase_intersection_pair(this.__wbg_ptr, handle1, handle2);\n return ret !== 0;\n }\n}\n/**\n*/\nexport class RawPhysicsPipeline {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawphysicspipeline_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawphysicspipeline_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {RawVector} gravity\n * @param {RawIntegrationParameters} integrationParameters\n * @param {RawIslandManager} islands\n * @param {RawBroadPhase} broadPhase\n * @param {RawNarrowPhase} narrowPhase\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawImpulseJointSet} joints\n * @param {RawMultibodyJointSet} articulations\n * @param {RawCCDSolver} ccd_solver\n */\n step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver) {\n _assertClass(gravity, RawVector);\n _assertClass(integrationParameters, RawIntegrationParameters);\n _assertClass(islands, RawIslandManager);\n _assertClass(broadPhase, RawBroadPhase);\n _assertClass(narrowPhase, RawNarrowPhase);\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(joints, RawImpulseJointSet);\n _assertClass(articulations, RawMultibodyJointSet);\n _assertClass(ccd_solver, RawCCDSolver);\n wasm.rawphysicspipeline_step(this.__wbg_ptr, gravity.__wbg_ptr, integrationParameters.__wbg_ptr, islands.__wbg_ptr, broadPhase.__wbg_ptr, narrowPhase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr, ccd_solver.__wbg_ptr);\n }\n /**\n * @param {RawVector} gravity\n * @param {RawIntegrationParameters} integrationParameters\n * @param {RawIslandManager} islands\n * @param {RawBroadPhase} broadPhase\n * @param {RawNarrowPhase} narrowPhase\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawImpulseJointSet} joints\n * @param {RawMultibodyJointSet} articulations\n * @param {RawCCDSolver} ccd_solver\n * @param {RawEventQueue} eventQueue\n * @param {object} hookObject\n * @param {Function} hookFilterContactPair\n * @param {Function} hookFilterIntersectionPair\n */\n stepWithEvents(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver, eventQueue, hookObject, hookFilterContactPair, hookFilterIntersectionPair) {\n _assertClass(gravity, RawVector);\n _assertClass(integrationParameters, RawIntegrationParameters);\n _assertClass(islands, RawIslandManager);\n _assertClass(broadPhase, RawBroadPhase);\n _assertClass(narrowPhase, RawNarrowPhase);\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(joints, RawImpulseJointSet);\n _assertClass(articulations, RawMultibodyJointSet);\n _assertClass(ccd_solver, RawCCDSolver);\n _assertClass(eventQueue, RawEventQueue);\n wasm.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, gravity.__wbg_ptr, integrationParameters.__wbg_ptr, islands.__wbg_ptr, broadPhase.__wbg_ptr, narrowPhase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr, ccd_solver.__wbg_ptr, eventQueue.__wbg_ptr, addHeapObject(hookObject), addHeapObject(hookFilterContactPair), addHeapObject(hookFilterIntersectionPair));\n }\n}\n/**\n*/\nexport class RawPointColliderProjection {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawPointColliderProjection.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawpointcolliderprojection_free(ptr);\n }\n /**\n * @returns {number}\n */\n colliderHandle() {\n const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n point() {\n const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {boolean}\n */\n isInside() {\n const ret = wasm.rawpointcolliderprojection_isInside(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @returns {RawFeatureType}\n */\n featureType() {\n const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number | undefined}\n */\n featureId() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1 >>> 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n}\n/**\n*/\nexport class RawPointProjection {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawPointProjection.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawpointprojection_free(ptr);\n }\n /**\n * @returns {RawVector}\n */\n point() {\n const ret = wasm.rawpointprojection_point(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {boolean}\n */\n isInside() {\n const ret = wasm.rawpointprojection_isInside(this.__wbg_ptr);\n return ret !== 0;\n }\n}\n/**\n*/\nexport class RawQueryPipeline {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawquerypipeline_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawquerypipeline_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n */\n update(bodies, colliders) {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n wasm.rawquerypipeline_update(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr);\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n * @returns {RawRayColliderHit | undefined}\n */\n castRay(bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawquerypipeline_castRay(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n return ret === 0 ? undefined : RawRayColliderHit.__wrap(ret);\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n * @returns {RawRayColliderIntersection | undefined}\n */\n castRayAndGetNormal(bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawquerypipeline_castRayAndGetNormal(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n return ret === 0 ? undefined : RawRayColliderIntersection.__wrap(ret);\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @param {Function} callback\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n */\n intersectionsWithRay(bodies, colliders, rayOrig, rayDir, maxToi, solid, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n wasm.rawquerypipeline_intersectionsWithRay(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, addBorrowedObject(callback), filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n } finally {\n heap[stack_pointer++] = undefined;\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawShape} shape\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n * @returns {number | undefined}\n */\n intersectionWithShape(bodies, colliders, shapePos, shapeRot, shape, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(shape, RawShape);\n wasm.rawquerypipeline_intersectionWithShape(retptr, this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shape.__wbg_ptr, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r2 = getFloat64Memory0()[retptr / 8 + 1];\n return r0 === 0 ? undefined : r2;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} point\n * @param {boolean} solid\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n * @returns {RawPointColliderProjection | undefined}\n */\n projectPoint(bodies, colliders, point, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(point, RawVector);\n const ret = wasm.rawquerypipeline_projectPoint(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, solid, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n return ret === 0 ? undefined : RawPointColliderProjection.__wrap(ret);\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} point\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n * @returns {RawPointColliderProjection | undefined}\n */\n projectPointAndGetFeature(bodies, colliders, point, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(point, RawVector);\n const ret = wasm.rawquerypipeline_projectPointAndGetFeature(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n return ret === 0 ? undefined : RawPointColliderProjection.__wrap(ret);\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} point\n * @param {Function} callback\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n */\n intersectionsWithPoint(bodies, colliders, point, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(point, RawVector);\n wasm.rawquerypipeline_intersectionsWithPoint(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, addBorrowedObject(callback), filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n } finally {\n heap[stack_pointer++] = undefined;\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawVector} shapeVel\n * @param {RawShape} shape\n * @param {number} target_distance\n * @param {number} maxToi\n * @param {boolean} stop_at_penetration\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n * @returns {RawColliderShapeCastHit | undefined}\n */\n castShape(bodies, colliders, shapePos, shapeRot, shapeVel, shape, target_distance, maxToi, stop_at_penetration, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(shapeVel, RawVector);\n _assertClass(shape, RawShape);\n const ret = wasm.rawquerypipeline_castShape(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shapeVel.__wbg_ptr, shape.__wbg_ptr, target_distance, maxToi, stop_at_penetration, filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n return ret === 0 ? undefined : RawColliderShapeCastHit.__wrap(ret);\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawShape} shape\n * @param {Function} callback\n * @param {number} filter_flags\n * @param {number | undefined} filter_groups\n * @param {number | undefined} filter_exclude_collider\n * @param {number | undefined} filter_exclude_rigid_body\n * @param {Function} filter_predicate\n */\n intersectionsWithShape(bodies, colliders, shapePos, shapeRot, shape, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) {\n try {\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(shape, RawShape);\n wasm.rawquerypipeline_intersectionsWithShape(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shape.__wbg_ptr, addBorrowedObject(callback), filter_flags, !isLikeNone(filter_groups), isLikeNone(filter_groups) ? 0 : filter_groups, !isLikeNone(filter_exclude_collider), isLikeNone(filter_exclude_collider) ? 0 : filter_exclude_collider, !isLikeNone(filter_exclude_rigid_body), isLikeNone(filter_exclude_rigid_body) ? 0 : filter_exclude_rigid_body, addBorrowedObject(filter_predicate));\n } finally {\n heap[stack_pointer++] = undefined;\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawVector} aabbCenter\n * @param {RawVector} aabbHalfExtents\n * @param {Function} callback\n */\n collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) {\n try {\n _assertClass(aabbCenter, RawVector);\n _assertClass(aabbHalfExtents, RawVector);\n wasm.rawquerypipeline_collidersWithAabbIntersectingAabb(this.__wbg_ptr, aabbCenter.__wbg_ptr, aabbHalfExtents.__wbg_ptr, addBorrowedObject(callback));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n}\n/**\n*/\nexport class RawRayColliderHit {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawRayColliderHit.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawraycolliderhit_free(ptr);\n }\n /**\n * @returns {number}\n */\n colliderHandle() {\n const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n timeOfImpact() {\n const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);\n return ret;\n }\n}\n/**\n*/\nexport class RawRayColliderIntersection {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawRayColliderIntersection.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawraycolliderintersection_free(ptr);\n }\n /**\n * @returns {number}\n */\n colliderHandle() {\n const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n normal() {\n const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {number}\n */\n time_of_impact() {\n const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawFeatureType}\n */\n featureType() {\n const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number | undefined}\n */\n featureId() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1 >>> 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n}\n/**\n*/\nexport class RawRayIntersection {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawRayIntersection.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawrayintersection_free(ptr);\n }\n /**\n * @returns {RawVector}\n */\n normal() {\n const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {number}\n */\n time_of_impact() {\n const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawFeatureType}\n */\n featureType() {\n const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {number | undefined}\n */\n featureId() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n return r0 === 0 ? undefined : r1 >>> 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n}\n/**\n*/\nexport class RawRigidBodySet {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawRigidBodySet.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawrigidbodyset_free(ptr);\n }\n /**\n * The world-space translation of this rigid-body.\n * @param {number} handle\n * @returns {RawVector}\n */\n rbTranslation(handle) {\n const ret = wasm.rawrigidbodyset_rbTranslation(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The world-space orientation of this rigid-body.\n * @param {number} handle\n * @returns {RawRotation}\n */\n rbRotation(handle) {\n const ret = wasm.rawrigidbodyset_rbRotation(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * Put the given rigid-body to sleep.\n * @param {number} handle\n */\n rbSleep(handle) {\n wasm.rawrigidbodyset_rbSleep(this.__wbg_ptr, handle);\n }\n /**\n * Is this rigid-body sleeping?\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsSleeping(handle) {\n const ret = wasm.rawrigidbodyset_rbIsSleeping(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Is the velocity of this rigid-body not zero?\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsMoving(handle) {\n const ret = wasm.rawrigidbodyset_rbIsMoving(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * The world-space predicted translation of this rigid-body.\n *\n * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation`\n * method and is used for estimating the kinematic body velocity at the next timestep.\n * For non-kinematic bodies, this value is currently unspecified.\n * @param {number} handle\n * @returns {RawVector}\n */\n rbNextTranslation(handle) {\n const ret = wasm.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The world-space predicted orientation of this rigid-body.\n *\n * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation`\n * method and is used for estimating the kinematic body velocity at the next timestep.\n * For non-kinematic bodies, this value is currently unspecified.\n * @param {number} handle\n * @returns {RawRotation}\n */\n rbNextRotation(handle) {\n const ret = wasm.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, handle);\n return RawRotation.__wrap(ret);\n }\n /**\n * Sets the translation of this rigid-body.\n *\n * # Parameters\n * - `x`: the world-space position of the rigid-body along the `x` axis.\n * - `y`: the world-space position of the rigid-body along the `y` axis.\n * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it\n * wasn't moving before modifying its position.\n * @param {number} handle\n * @param {number} x\n * @param {number} y\n * @param {boolean} wakeUp\n */\n rbSetTranslation(handle, x, y, wakeUp) {\n wasm.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, handle, x, y, wakeUp);\n }\n /**\n * Sets the rotation angle of this rigid-body.\n *\n * # Parameters\n * - `angle`: the rotation angle, in radians.\n * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it\n * wasn't moving before modifying its position.\n * @param {number} handle\n * @param {number} angle\n * @param {boolean} wakeUp\n */\n rbSetRotation(handle, angle, wakeUp) {\n wasm.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, handle, angle, wakeUp);\n }\n /**\n * Sets the linear velocity of this rigid-body.\n * @param {number} handle\n * @param {RawVector} linvel\n * @param {boolean} wakeUp\n */\n rbSetLinvel(handle, linvel, wakeUp) {\n _assertClass(linvel, RawVector);\n wasm.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, handle, linvel.__wbg_ptr, wakeUp);\n }\n /**\n * Sets the angular velocity of this rigid-body.\n * @param {number} handle\n * @param {number} angvel\n * @param {boolean} wakeUp\n */\n rbSetAngvel(handle, angvel, wakeUp) {\n wasm.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, handle, angvel, wakeUp);\n }\n /**\n * If this rigid body is kinematic, sets its future translation after the next timestep integration.\n *\n * This should be used instead of `rigidBody.setTranslation` to make the dynamic object\n * interacting with this kinematic body behave as expected. Internally, Rapier will compute\n * an artificial velocity for this rigid-body from its current position and its next kinematic\n * position. This velocity will be used to compute forces on dynamic bodies interacting with\n * this body.\n *\n * # Parameters\n * - `x`: the world-space position of the rigid-body along the `x` axis.\n * - `y`: the world-space position of the rigid-body along the `y` axis.\n * @param {number} handle\n * @param {number} x\n * @param {number} y\n */\n rbSetNextKinematicTranslation(handle, x, y) {\n wasm.rawrigidbodyset_rbSetNextKinematicTranslation(this.__wbg_ptr, handle, x, y);\n }\n /**\n * If this rigid body is kinematic, sets its future rotation after the next timestep integration.\n *\n * This should be used instead of `rigidBody.setRotation` to make the dynamic object\n * interacting with this kinematic body behave as expected. Internally, Rapier will compute\n * an artificial velocity for this rigid-body from its current position and its next kinematic\n * position. This velocity will be used to compute forces on dynamic bodies interacting with\n * this body.\n *\n * # Parameters\n * - `angle`: the rotation angle, in radians.\n * @param {number} handle\n * @param {number} angle\n */\n rbSetNextKinematicRotation(handle, angle) {\n wasm.rawrigidbodyset_rbSetNextKinematicRotation(this.__wbg_ptr, handle, angle);\n }\n /**\n * @param {number} handle\n * @param {RawColliderSet} colliders\n */\n rbRecomputeMassPropertiesFromColliders(handle, colliders) {\n _assertClass(colliders, RawColliderSet);\n wasm.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, handle, colliders.__wbg_ptr);\n }\n /**\n * @param {number} handle\n * @param {number} mass\n * @param {boolean} wake_up\n */\n rbSetAdditionalMass(handle, mass, wake_up) {\n wasm.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, handle, mass, wake_up);\n }\n /**\n * @param {number} handle\n * @param {number} mass\n * @param {RawVector} centerOfMass\n * @param {number} principalAngularInertia\n * @param {boolean} wake_up\n */\n rbSetAdditionalMassProperties(handle, mass, centerOfMass, principalAngularInertia, wake_up) {\n _assertClass(centerOfMass, RawVector);\n wasm.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia, wake_up);\n }\n /**\n * The linear velocity of this rigid-body.\n * @param {number} handle\n * @returns {RawVector}\n */\n rbLinvel(handle) {\n const ret = wasm.rawrigidbodyset_rbLinvel(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The angular velocity of this rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbAngvel(handle) {\n const ret = wasm.rawrigidbodyset_rbAngvel(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {boolean} locked\n * @param {boolean} wake_up\n */\n rbLockTranslations(handle, locked, wake_up) {\n wasm.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, handle, locked, wake_up);\n }\n /**\n * @param {number} handle\n * @param {boolean} allow_x\n * @param {boolean} allow_y\n * @param {boolean} wake_up\n */\n rbSetEnabledTranslations(handle, allow_x, allow_y, wake_up) {\n wasm.rawrigidbodyset_rbSetEnabledTranslations(this.__wbg_ptr, handle, allow_x, allow_y, wake_up);\n }\n /**\n * @param {number} handle\n * @param {boolean} locked\n * @param {boolean} wake_up\n */\n rbLockRotations(handle, locked, wake_up) {\n wasm.rawrigidbodyset_rbLockRotations(this.__wbg_ptr, handle, locked, wake_up);\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n rbDominanceGroup(handle) {\n const ret = wasm.rawrigidbodyset_rbDominanceGroup(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {number} group\n */\n rbSetDominanceGroup(handle, group) {\n wasm.rawrigidbodyset_rbSetDominanceGroup(this.__wbg_ptr, handle, group);\n }\n /**\n * @param {number} handle\n * @param {boolean} enabled\n */\n rbEnableCcd(handle, enabled) {\n wasm.rawrigidbodyset_rbEnableCcd(this.__wbg_ptr, handle, enabled);\n }\n /**\n * @param {number} handle\n * @param {number} prediction\n */\n rbSetSoftCcdPrediction(handle, prediction) {\n wasm.rawrigidbodyset_rbSetSoftCcdPrediction(this.__wbg_ptr, handle, prediction);\n }\n /**\n * The mass of this rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbMass(handle) {\n const ret = wasm.rawrigidbodyset_rbMass(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The inverse of the mass of a rigid-body.\n *\n * If this is zero, the rigid-body is assumed to have infinite mass.\n * @param {number} handle\n * @returns {number}\n */\n rbInvMass(handle) {\n const ret = wasm.rawrigidbodyset_rbInvMass(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The inverse mass taking into account translation locking.\n * @param {number} handle\n * @returns {RawVector}\n */\n rbEffectiveInvMass(handle) {\n const ret = wasm.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The center of mass of a rigid-body expressed in its local-space.\n * @param {number} handle\n * @returns {RawVector}\n */\n rbLocalCom(handle) {\n const ret = wasm.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The world-space center of mass of the rigid-body.\n * @param {number} handle\n * @returns {RawVector}\n */\n rbWorldCom(handle) {\n const ret = wasm.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, handle);\n return RawVector.__wrap(ret);\n }\n /**\n * The inverse of the principal angular inertia of the rigid-body.\n *\n * Components set to zero are assumed to be infinite along the corresponding principal axis.\n * @param {number} handle\n * @returns {number}\n */\n rbInvPrincipalInertiaSqrt(handle) {\n const ret = wasm.rawrigidbodyset_rbInvPrincipalInertiaSqrt(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The angular inertia along the principal inertia axes of the rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbPrincipalInertia(handle) {\n const ret = wasm.rawrigidbodyset_rbPrincipalInertia(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The square-root of the world-space inverse angular inertia tensor of the rigid-body,\n * taking into account rotation locking.\n * @param {number} handle\n * @returns {number}\n */\n rbEffectiveWorldInvInertiaSqrt(handle) {\n const ret = wasm.rawrigidbodyset_rbEffectiveWorldInvInertiaSqrt(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The effective world-space angular inertia (that takes the potential rotation locking into account) of\n * this rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbEffectiveAngularInertia(handle) {\n const ret = wasm.rawrigidbodyset_rbEffectiveAngularInertia(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * Wakes this rigid-body up.\n *\n * A dynamic rigid-body that does not move during several consecutive frames will\n * be put to sleep by the physics engine, i.e., it will stop being simulated in order\n * to avoid useless computations.\n * This method forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying\n * the position of a dynamic body so that it is properly simulated afterwards.\n * @param {number} handle\n */\n rbWakeUp(handle) {\n wasm.rawrigidbodyset_rbWakeUp(this.__wbg_ptr, handle);\n }\n /**\n * Is Continuous Collision Detection enabled for this rigid-body?\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsCcdEnabled(handle) {\n const ret = wasm.rawrigidbodyset_rbIsCcdEnabled(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n rbSoftCcdPrediction(handle) {\n const ret = wasm.rawrigidbodyset_rbSoftCcdPrediction(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The number of colliders attached to this rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbNumColliders(handle) {\n const ret = wasm.rawrigidbodyset_rbNumColliders(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * Retrieves the `i-th` collider attached to this rigid-body.\n *\n * # Parameters\n * - `at`: The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`.\n * This index is **not** the same as the unique identifier of the collider.\n * @param {number} handle\n * @param {number} at\n * @returns {number}\n */\n rbCollider(handle, at) {\n const ret = wasm.rawrigidbodyset_rbCollider(this.__wbg_ptr, handle, at);\n return ret;\n }\n /**\n * The status of this rigid-body: fixed, dynamic, or kinematic.\n * @param {number} handle\n * @returns {RawRigidBodyType}\n */\n rbBodyType(handle) {\n const ret = wasm.rawrigidbodyset_rbBodyType(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * Set a new status for this rigid-body: fixed, dynamic, or kinematic.\n * @param {number} handle\n * @param {RawRigidBodyType} status\n * @param {boolean} wake_up\n */\n rbSetBodyType(handle, status, wake_up) {\n wasm.rawrigidbodyset_rbSetBodyType(this.__wbg_ptr, handle, status, wake_up);\n }\n /**\n * Is this rigid-body fixed?\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsFixed(handle) {\n const ret = wasm.rawrigidbodyset_rbIsFixed(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Is this rigid-body kinematic?\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsKinematic(handle) {\n const ret = wasm.rawrigidbodyset_rbIsKinematic(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Is this rigid-body dynamic?\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsDynamic(handle) {\n const ret = wasm.rawrigidbodyset_rbIsDynamic(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * The linear damping coefficient of this rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbLinearDamping(handle) {\n const ret = wasm.rawrigidbodyset_rbLinearDamping(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * The angular damping coefficient of this rigid-body.\n * @param {number} handle\n * @returns {number}\n */\n rbAngularDamping(handle) {\n const ret = wasm.rawrigidbodyset_rbAngularDamping(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {number} factor\n */\n rbSetLinearDamping(handle, factor) {\n wasm.rawrigidbodyset_rbSetLinearDamping(this.__wbg_ptr, handle, factor);\n }\n /**\n * @param {number} handle\n * @param {number} factor\n */\n rbSetAngularDamping(handle, factor) {\n wasm.rawrigidbodyset_rbSetAngularDamping(this.__wbg_ptr, handle, factor);\n }\n /**\n * @param {number} handle\n * @param {boolean} enabled\n */\n rbSetEnabled(handle, enabled) {\n wasm.rawrigidbodyset_rbSetEnabled(this.__wbg_ptr, handle, enabled);\n }\n /**\n * @param {number} handle\n * @returns {boolean}\n */\n rbIsEnabled(handle) {\n const ret = wasm.rawrigidbodyset_rbIsEnabled(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n rbGravityScale(handle) {\n const ret = wasm.rawrigidbodyset_rbGravityScale(this.__wbg_ptr, handle);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {number} factor\n * @param {boolean} wakeUp\n */\n rbSetGravityScale(handle, factor, wakeUp) {\n wasm.rawrigidbodyset_rbSetGravityScale(this.__wbg_ptr, handle, factor, wakeUp);\n }\n /**\n * Resets to zero all user-added forces added to this rigid-body.\n * @param {number} handle\n * @param {boolean} wakeUp\n */\n rbResetForces(handle, wakeUp) {\n wasm.rawrigidbodyset_rbResetForces(this.__wbg_ptr, handle, wakeUp);\n }\n /**\n * Resets to zero all user-added torques added to this rigid-body.\n * @param {number} handle\n * @param {boolean} wakeUp\n */\n rbResetTorques(handle, wakeUp) {\n wasm.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, handle, wakeUp);\n }\n /**\n * Adds a force at the center-of-mass of this rigid-body.\n *\n * # Parameters\n * - `force`: the world-space force to apply on the rigid-body.\n * - `wakeUp`: should the rigid-body be automatically woken-up?\n * @param {number} handle\n * @param {RawVector} force\n * @param {boolean} wakeUp\n */\n rbAddForce(handle, force, wakeUp) {\n _assertClass(force, RawVector);\n wasm.rawrigidbodyset_rbAddForce(this.__wbg_ptr, handle, force.__wbg_ptr, wakeUp);\n }\n /**\n * Applies an impulse at the center-of-mass of this rigid-body.\n *\n * # Parameters\n * - `impulse`: the world-space impulse to apply on the rigid-body.\n * - `wakeUp`: should the rigid-body be automatically woken-up?\n * @param {number} handle\n * @param {RawVector} impulse\n * @param {boolean} wakeUp\n */\n rbApplyImpulse(handle, impulse, wakeUp) {\n _assertClass(impulse, RawVector);\n wasm.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, handle, impulse.__wbg_ptr, wakeUp);\n }\n /**\n * Adds a torque at the center-of-mass of this rigid-body.\n *\n * # Parameters\n * - `torque`: the torque to apply on the rigid-body.\n * - `wakeUp`: should the rigid-body be automatically woken-up?\n * @param {number} handle\n * @param {number} torque\n * @param {boolean} wakeUp\n */\n rbAddTorque(handle, torque, wakeUp) {\n wasm.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, handle, torque, wakeUp);\n }\n /**\n * Applies an impulsive torque at the center-of-mass of this rigid-body.\n *\n * # Parameters\n * - `torque impulse`: the torque impulse to apply on the rigid-body.\n * - `wakeUp`: should the rigid-body be automatically woken-up?\n * @param {number} handle\n * @param {number} torque_impulse\n * @param {boolean} wakeUp\n */\n rbApplyTorqueImpulse(handle, torque_impulse, wakeUp) {\n wasm.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, handle, torque_impulse, wakeUp);\n }\n /**\n * Adds a force at the given world-space point of this rigid-body.\n *\n * # Parameters\n * - `force`: the world-space force to apply on the rigid-body.\n * - `point`: the world-space point where the impulse is to be applied on the rigid-body.\n * - `wakeUp`: should the rigid-body be automatically woken-up?\n * @param {number} handle\n * @param {RawVector} force\n * @param {RawVector} point\n * @param {boolean} wakeUp\n */\n rbAddForceAtPoint(handle, force, point, wakeUp) {\n _assertClass(force, RawVector);\n _assertClass(point, RawVector);\n wasm.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, handle, force.__wbg_ptr, point.__wbg_ptr, wakeUp);\n }\n /**\n * Applies an impulse at the given world-space point of this rigid-body.\n *\n * # Parameters\n * - `impulse`: the world-space impulse to apply on the rigid-body.\n * - `point`: the world-space point where the impulse is to be applied on the rigid-body.\n * - `wakeUp`: should the rigid-body be automatically woken-up?\n * @param {number} handle\n * @param {RawVector} impulse\n * @param {RawVector} point\n * @param {boolean} wakeUp\n */\n rbApplyImpulseAtPoint(handle, impulse, point, wakeUp) {\n _assertClass(impulse, RawVector);\n _assertClass(point, RawVector);\n wasm.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, handle, impulse.__wbg_ptr, point.__wbg_ptr, wakeUp);\n }\n /**\n * @param {number} handle\n * @returns {number}\n */\n rbAdditionalSolverIterations(handle) {\n const ret = wasm.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * @param {number} handle\n * @param {number} iters\n */\n rbSetAdditionalSolverIterations(handle, iters) {\n wasm.rawrigidbodyset_rbSetAdditionalSolverIterations(this.__wbg_ptr, handle, iters);\n }\n /**\n * An arbitrary user-defined 32-bit integer\n * @param {number} handle\n * @returns {number}\n */\n rbUserData(handle) {\n const ret = wasm.rawrigidbodyset_rbUserData(this.__wbg_ptr, handle);\n return ret >>> 0;\n }\n /**\n * Sets the user-defined 32-bit integer of this rigid-body.\n *\n * # Parameters\n * - `data`: an arbitrary user-defined 32-bit integer.\n * @param {number} handle\n * @param {number} data\n */\n rbSetUserData(handle, data) {\n wasm.rawrigidbodyset_rbSetUserData(this.__wbg_ptr, handle, data);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawrigidbodyset_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {boolean} enabled\n * @param {RawVector} translation\n * @param {RawRotation} rotation\n * @param {number} gravityScale\n * @param {number} mass\n * @param {boolean} massOnly\n * @param {RawVector} centerOfMass\n * @param {RawVector} linvel\n * @param {number} angvel\n * @param {number} principalAngularInertia\n * @param {boolean} translationEnabledX\n * @param {boolean} translationEnabledY\n * @param {boolean} rotationsEnabled\n * @param {number} linearDamping\n * @param {number} angularDamping\n * @param {RawRigidBodyType} rb_type\n * @param {boolean} canSleep\n * @param {boolean} sleeping\n * @param {number} softCcdPrediciton\n * @param {boolean} ccdEnabled\n * @param {number} dominanceGroup\n * @param {number} additional_solver_iterations\n * @returns {number}\n */\n createRigidBody(enabled, translation, rotation, gravityScale, mass, massOnly, centerOfMass, linvel, angvel, principalAngularInertia, translationEnabledX, translationEnabledY, rotationsEnabled, linearDamping, angularDamping, rb_type, canSleep, sleeping, softCcdPrediciton, ccdEnabled, dominanceGroup, additional_solver_iterations) {\n _assertClass(translation, RawVector);\n _assertClass(rotation, RawRotation);\n _assertClass(centerOfMass, RawVector);\n _assertClass(linvel, RawVector);\n const ret = wasm.rawrigidbodyset_createRigidBody(this.__wbg_ptr, enabled, translation.__wbg_ptr, rotation.__wbg_ptr, gravityScale, mass, massOnly, centerOfMass.__wbg_ptr, linvel.__wbg_ptr, angvel, principalAngularInertia, translationEnabledX, translationEnabledY, rotationsEnabled, linearDamping, angularDamping, rb_type, canSleep, sleeping, softCcdPrediciton, ccdEnabled, dominanceGroup, additional_solver_iterations);\n return ret;\n }\n /**\n * @param {number} handle\n * @param {RawIslandManager} islands\n * @param {RawColliderSet} colliders\n * @param {RawImpulseJointSet} joints\n * @param {RawMultibodyJointSet} articulations\n */\n remove(handle, islands, colliders, joints, articulations) {\n _assertClass(islands, RawIslandManager);\n _assertClass(colliders, RawColliderSet);\n _assertClass(joints, RawImpulseJointSet);\n _assertClass(articulations, RawMultibodyJointSet);\n wasm.rawrigidbodyset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr);\n }\n /**\n * The number of rigid-bodies on this set.\n * @returns {number}\n */\n len() {\n const ret = wasm.rawcolliderset_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Checks if a rigid-body with the given integer handle exists.\n * @param {number} handle\n * @returns {boolean}\n */\n contains(handle) {\n const ret = wasm.rawrigidbodyset_contains(this.__wbg_ptr, handle);\n return ret !== 0;\n }\n /**\n * Applies the given JavaScript function to the integer handle of each rigid-body managed by this set.\n *\n * # Parameters\n * - `f(handle)`: the function to apply to the integer handle of each rigid-body managed by this set. Called as `f(collider)`.\n * @param {Function} f\n */\n forEachRigidBodyHandle(f) {\n try {\n wasm.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n }\n /**\n * @param {RawColliderSet} colliders\n */\n propagateModifiedBodyPositionsToColliders(colliders) {\n _assertClass(colliders, RawColliderSet);\n wasm.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, colliders.__wbg_ptr);\n }\n}\n/**\n* A rotation quaternion.\n*/\nexport class RawRotation {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawRotation.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawrotation_free(ptr);\n }\n /**\n * The identity rotation.\n * @returns {RawRotation}\n */\n static identity() {\n const ret = wasm.rawrotation_identity();\n return RawRotation.__wrap(ret);\n }\n /**\n * The rotation with thegiven angle.\n * @param {number} angle\n * @returns {RawRotation}\n */\n static fromAngle(angle) {\n const ret = wasm.rawrotation_fromAngle(angle);\n return RawRotation.__wrap(ret);\n }\n /**\n * The imaginary part of this complex number.\n * @returns {number}\n */\n get im() {\n const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);\n return ret;\n }\n /**\n * The real part of this complex number.\n * @returns {number}\n */\n get re() {\n const ret = wasm.rawrotation_re(this.__wbg_ptr);\n return ret;\n }\n /**\n * The rotation angle in radians.\n * @returns {number}\n */\n get angle() {\n const ret = wasm.rawrotation_angle(this.__wbg_ptr);\n return ret;\n }\n}\n/**\n*/\nexport class RawSerializationPipeline {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawserializationpipeline_free(ptr);\n }\n /**\n */\n constructor() {\n const ret = wasm.rawserializationpipeline_new();\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * @param {RawVector} gravity\n * @param {RawIntegrationParameters} integrationParameters\n * @param {RawIslandManager} islands\n * @param {RawBroadPhase} broadPhase\n * @param {RawNarrowPhase} narrowPhase\n * @param {RawRigidBodySet} bodies\n * @param {RawColliderSet} colliders\n * @param {RawImpulseJointSet} impulse_joints\n * @param {RawMultibodyJointSet} multibody_joints\n * @returns {Uint8Array | undefined}\n */\n serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulse_joints, multibody_joints) {\n _assertClass(gravity, RawVector);\n _assertClass(integrationParameters, RawIntegrationParameters);\n _assertClass(islands, RawIslandManager);\n _assertClass(broadPhase, RawBroadPhase);\n _assertClass(narrowPhase, RawNarrowPhase);\n _assertClass(bodies, RawRigidBodySet);\n _assertClass(colliders, RawColliderSet);\n _assertClass(impulse_joints, RawImpulseJointSet);\n _assertClass(multibody_joints, RawMultibodyJointSet);\n const ret = wasm.rawserializationpipeline_serializeAll(this.__wbg_ptr, gravity.__wbg_ptr, integrationParameters.__wbg_ptr, islands.__wbg_ptr, broadPhase.__wbg_ptr, narrowPhase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, impulse_joints.__wbg_ptr, multibody_joints.__wbg_ptr);\n return takeObject(ret);\n }\n /**\n * @param {Uint8Array} data\n * @returns {RawDeserializedWorld | undefined}\n */\n deserializeAll(data) {\n const ret = wasm.rawserializationpipeline_deserializeAll(this.__wbg_ptr, addHeapObject(data));\n return ret === 0 ? undefined : RawDeserializedWorld.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawShape {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawShape.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawshape_free(ptr);\n }\n /**\n * @param {number} hx\n * @param {number} hy\n * @returns {RawShape}\n */\n static cuboid(hx, hy) {\n const ret = wasm.rawshape_cuboid(hx, hy);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {number} hx\n * @param {number} hy\n * @param {number} borderRadius\n * @returns {RawShape}\n */\n static roundCuboid(hx, hy, borderRadius) {\n const ret = wasm.rawshape_roundCuboid(hx, hy, borderRadius);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {number} radius\n * @returns {RawShape}\n */\n static ball(radius) {\n const ret = wasm.rawshape_ball(radius);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {RawVector} normal\n * @returns {RawShape}\n */\n static halfspace(normal) {\n _assertClass(normal, RawVector);\n const ret = wasm.rawshape_halfspace(normal.__wbg_ptr);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {number} halfHeight\n * @param {number} radius\n * @returns {RawShape}\n */\n static capsule(halfHeight, radius) {\n const ret = wasm.rawshape_capsule(halfHeight, radius);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} vertices\n * @param {Uint32Array} indices\n * @returns {RawShape}\n */\n static polyline(vertices, indices) {\n const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.rawshape_polyline(ptr0, len0, ptr1, len1);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} vertices\n * @param {Uint32Array} indices\n * @param {number} flags\n * @returns {RawShape}\n */\n static trimesh(vertices, indices, flags) {\n const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.rawshape_trimesh(ptr0, len0, ptr1, len1, flags);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} heights\n * @param {RawVector} scale\n * @returns {RawShape}\n */\n static heightfield(heights, scale) {\n const ptr0 = passArrayF32ToWasm0(heights, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n _assertClass(scale, RawVector);\n const ret = wasm.rawshape_heightfield(ptr0, len0, scale.__wbg_ptr);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {RawVector} p1\n * @param {RawVector} p2\n * @returns {RawShape}\n */\n static segment(p1, p2) {\n _assertClass(p1, RawVector);\n _assertClass(p2, RawVector);\n const ret = wasm.rawshape_segment(p1.__wbg_ptr, p2.__wbg_ptr);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {RawVector} p1\n * @param {RawVector} p2\n * @param {RawVector} p3\n * @returns {RawShape}\n */\n static triangle(p1, p2, p3) {\n _assertClass(p1, RawVector);\n _assertClass(p2, RawVector);\n _assertClass(p3, RawVector);\n const ret = wasm.rawshape_triangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {RawVector} p1\n * @param {RawVector} p2\n * @param {RawVector} p3\n * @param {number} borderRadius\n * @returns {RawShape}\n */\n static roundTriangle(p1, p2, p3, borderRadius) {\n _assertClass(p1, RawVector);\n _assertClass(p2, RawVector);\n _assertClass(p3, RawVector);\n const ret = wasm.rawshape_roundTriangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr, borderRadius);\n return RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} points\n * @returns {RawShape | undefined}\n */\n static convexHull(points) {\n const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.rawshape_convexHull(ptr0, len0);\n return ret === 0 ? undefined : RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} points\n * @param {number} borderRadius\n * @returns {RawShape | undefined}\n */\n static roundConvexHull(points, borderRadius) {\n const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.rawshape_roundConvexHull(ptr0, len0, borderRadius);\n return ret === 0 ? undefined : RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} vertices\n * @returns {RawShape | undefined}\n */\n static convexPolyline(vertices) {\n const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.rawshape_convexPolyline(ptr0, len0);\n return ret === 0 ? undefined : RawShape.__wrap(ret);\n }\n /**\n * @param {Float32Array} vertices\n * @param {number} borderRadius\n * @returns {RawShape | undefined}\n */\n static roundConvexPolyline(vertices, borderRadius) {\n const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.rawshape_roundConvexPolyline(ptr0, len0, borderRadius);\n return ret === 0 ? undefined : RawShape.__wrap(ret);\n }\n /**\n * @param {RawVector} shapePos1\n * @param {RawRotation} shapeRot1\n * @param {RawVector} shapeVel1\n * @param {RawShape} shape2\n * @param {RawVector} shapePos2\n * @param {RawRotation} shapeRot2\n * @param {RawVector} shapeVel2\n * @param {number} target_distance\n * @param {number} maxToi\n * @param {boolean} stop_at_penetration\n * @returns {RawShapeCastHit | undefined}\n */\n castShape(shapePos1, shapeRot1, shapeVel1, shape2, shapePos2, shapeRot2, shapeVel2, target_distance, maxToi, stop_at_penetration) {\n _assertClass(shapePos1, RawVector);\n _assertClass(shapeRot1, RawRotation);\n _assertClass(shapeVel1, RawVector);\n _assertClass(shape2, RawShape);\n _assertClass(shapePos2, RawVector);\n _assertClass(shapeRot2, RawRotation);\n _assertClass(shapeVel2, RawVector);\n const ret = wasm.rawshape_castShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shapeVel1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, shapeVel2.__wbg_ptr, target_distance, maxToi, stop_at_penetration);\n return ret === 0 ? undefined : RawShapeCastHit.__wrap(ret);\n }\n /**\n * @param {RawVector} shapePos1\n * @param {RawRotation} shapeRot1\n * @param {RawShape} shape2\n * @param {RawVector} shapePos2\n * @param {RawRotation} shapeRot2\n * @returns {boolean}\n */\n intersectsShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2) {\n _assertClass(shapePos1, RawVector);\n _assertClass(shapeRot1, RawRotation);\n _assertClass(shape2, RawShape);\n _assertClass(shapePos2, RawVector);\n _assertClass(shapeRot2, RawRotation);\n const ret = wasm.rawshape_intersectsShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {RawVector} shapePos1\n * @param {RawRotation} shapeRot1\n * @param {RawShape} shape2\n * @param {RawVector} shapePos2\n * @param {RawRotation} shapeRot2\n * @param {number} prediction\n * @returns {RawShapeContact | undefined}\n */\n contactShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2, prediction) {\n _assertClass(shapePos1, RawVector);\n _assertClass(shapeRot1, RawRotation);\n _assertClass(shape2, RawShape);\n _assertClass(shapePos2, RawVector);\n _assertClass(shapeRot2, RawRotation);\n const ret = wasm.rawshape_contactShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction);\n return ret === 0 ? undefined : RawShapeContact.__wrap(ret);\n }\n /**\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawVector} point\n * @returns {boolean}\n */\n containsPoint(shapePos, shapeRot, point) {\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(point, RawVector);\n const ret = wasm.rawshape_containsPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawVector} point\n * @param {boolean} solid\n * @returns {RawPointProjection}\n */\n projectPoint(shapePos, shapeRot, point, solid) {\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(point, RawVector);\n const ret = wasm.rawshape_projectPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr, solid);\n return RawPointProjection.__wrap(ret);\n }\n /**\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @returns {boolean}\n */\n intersectsRay(shapePos, shapeRot, rayOrig, rayDir, maxToi) {\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawshape_intersectsRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi);\n return ret !== 0;\n }\n /**\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @returns {number}\n */\n castRay(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) {\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawshape_castRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);\n return ret;\n }\n /**\n * @param {RawVector} shapePos\n * @param {RawRotation} shapeRot\n * @param {RawVector} rayOrig\n * @param {RawVector} rayDir\n * @param {number} maxToi\n * @param {boolean} solid\n * @returns {RawRayIntersection | undefined}\n */\n castRayAndGetNormal(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) {\n _assertClass(shapePos, RawVector);\n _assertClass(shapeRot, RawRotation);\n _assertClass(rayOrig, RawVector);\n _assertClass(rayDir, RawVector);\n const ret = wasm.rawshape_castRayAndGetNormal(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid);\n return ret === 0 ? undefined : RawRayIntersection.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawShapeCastHit {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawShapeCastHit.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawshapecasthit_free(ptr);\n }\n /**\n * @returns {number}\n */\n time_of_impact() {\n const ret = wasm.rawrotation_re(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n witness1() {\n const ret = wasm.rawshapecasthit_witness1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n witness2() {\n const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n normal1() {\n const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n normal2() {\n const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n}\n/**\n*/\nexport class RawShapeContact {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawShapeContact.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawshapecontact_free(ptr);\n }\n /**\n * @returns {number}\n */\n distance() {\n const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {RawVector}\n */\n point1() {\n const ret = wasm.rawpointprojection_point(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n point2() {\n const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n normal1() {\n const ret = wasm.rawcontactforceevent_total_force(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * @returns {RawVector}\n */\n normal2() {\n const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n}\n/**\n* A vector.\n*/\nexport class RawVector {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(RawVector.prototype);\n obj.__wbg_ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rawvector_free(ptr);\n }\n /**\n * Creates a new vector filled with zeros.\n * @returns {RawVector}\n */\n static zero() {\n const ret = wasm.rawvector_zero();\n return RawVector.__wrap(ret);\n }\n /**\n * Creates a new 2D vector from its two components.\n *\n * # Parameters\n * - `x`: the `x` component of this 2D vector.\n * - `y`: the `y` component of this 2D vector.\n * @param {number} x\n * @param {number} y\n */\n constructor(x, y) {\n const ret = wasm.rawvector_new(x, y);\n this.__wbg_ptr = ret >>> 0;\n return this;\n }\n /**\n * The `x` component of this vector.\n * @returns {number}\n */\n get x() {\n const ret = wasm.rawrotation_re(this.__wbg_ptr);\n return ret;\n }\n /**\n * Sets the `x` component of this vector.\n * @param {number} x\n */\n set x(x) {\n wasm.rawvector_set_x(this.__wbg_ptr, x);\n }\n /**\n * The `y` component of this vector.\n * @returns {number}\n */\n get y() {\n const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr);\n return ret;\n }\n /**\n * Sets the `y` component of this vector.\n * @param {number} y\n */\n set y(y) {\n wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, y);\n }\n /**\n * Create a new 2D vector from this vector with its components rearranged as `{x, y}`.\n * @returns {RawVector}\n */\n xy() {\n const ret = wasm.rawvector_xy(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n /**\n * Create a new 2D vector from this vector with its components rearranged as `{y, x}`.\n * @returns {RawVector}\n */\n yx() {\n const ret = wasm.rawvector_yx(this.__wbg_ptr);\n return RawVector.__wrap(ret);\n }\n}\n\nexport function __wbindgen_number_new(arg0) {\n const ret = arg0;\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_boolean_get(arg0) {\n const v = getObject(arg0);\n const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;\n return ret;\n};\n\nexport function __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nexport function __wbindgen_number_get(arg0, arg1) {\n const obj = getObject(arg1);\n const ret = typeof(obj) === 'number' ? obj : undefined;\n getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;\n getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);\n};\n\nexport function __wbindgen_is_function(arg0) {\n const ret = typeof(getObject(arg0)) === 'function';\n return ret;\n};\n\nexport function __wbg_rawraycolliderintersection_new(arg0) {\n const ret = RawRayColliderIntersection.__wrap(arg0);\n return addHeapObject(ret);\n};\n\nexport function __wbg_rawcontactforceevent_new(arg0) {\n const ret = RawContactForceEvent.__wrap(arg0);\n return addHeapObject(ret);\n};\n\nexport function __wbg_call_01734de55d61e11d() { return handleError(function (arg0, arg1, arg2) {\n const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_call_4c92f6aec1e1d6e6() { return handleError(function (arg0, arg1, arg2, arg3) {\n const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_call_776890ca77946e2f() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {\n const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_bind_60a9a80cada2f33c(arg0, arg1, arg2, arg3) {\n const ret = getObject(arg0).bind(getObject(arg1), getObject(arg2), getObject(arg3));\n return addHeapObject(ret);\n};\n\nexport function __wbg_buffer_085ec1f694018c4f(arg0) {\n const ret = getObject(arg0).buffer;\n return addHeapObject(ret);\n};\n\nexport function __wbg_newwithbyteoffsetandlength_6da8e527659b86aa(arg0, arg1, arg2) {\n const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbg_new_8125e318e6245eed(arg0) {\n const ret = new Uint8Array(getObject(arg0));\n return addHeapObject(ret);\n};\n\nexport function __wbg_set_5cf90238115182c3(arg0, arg1, arg2) {\n getObject(arg0).set(getObject(arg1), arg2 >>> 0);\n};\n\nexport function __wbg_length_72e2208bbc0efc61(arg0) {\n const ret = getObject(arg0).length;\n return ret;\n};\n\nexport function __wbg_newwithbyteoffsetandlength_69193e31c844b792(arg0, arg1, arg2) {\n const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbg_set_6146c51d49a2c0df(arg0, arg1, arg2) {\n getObject(arg0).set(getObject(arg1), arg2 >>> 0);\n};\n\nexport function __wbg_length_d7327c75a759af37(arg0) {\n const ret = getObject(arg0).length;\n return ret;\n};\n\nexport function __wbg_newwithlength_68d29ab115d0099c(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\nexport function __wbindgen_memory() {\n const ret = wasm.memory;\n return addHeapObject(ret);\n};\n\n", "import {RawVector, RawRotation} from \"./raw\";\n\n// #if DIM2\nexport interface Vector {\n x: number;\n y: number;\n}\n\n/**\n * A 2D vector.\n */\nexport class Vector2 implements Vector {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n}\n\nexport class VectorOps {\n public static new(x: number, y: number): Vector {\n return new Vector2(x, y);\n }\n\n public static zeros(): Vector {\n return VectorOps.new(0.0, 0.0);\n }\n\n // FIXME: type ram: RawVector?\n public static fromRaw(raw: RawVector): Vector {\n if (!raw) return null;\n\n let res = VectorOps.new(raw.x, raw.y);\n raw.free();\n return res;\n }\n\n public static intoRaw(v: Vector): RawVector {\n return new RawVector(v.x, v.y);\n }\n\n public static copy(out: Vector, input: Vector) {\n out.x = input.x;\n out.y = input.y;\n }\n}\n\n/**\n * A rotation angle in radians.\n */\nexport type Rotation = number;\n\nexport class RotationOps {\n public static identity(): number {\n return 0.0;\n }\n\n public static fromRaw(raw: RawRotation): Rotation {\n if (!raw) return null;\n\n let res = raw.angle;\n raw.free();\n return res;\n }\n\n public static intoRaw(angle: Rotation): RawRotation {\n return RawRotation.fromAngle(angle);\n }\n}\n\n// #endif\n\n", "import {RawRigidBodySet, RawRigidBodyType} from \"../raw\";\nimport {Rotation, RotationOps, Vector, VectorOps} from \"../math\";\nimport {Collider, ColliderSet} from \"../geometry\";\n\n/**\n * The integer identifier of a collider added to a `ColliderSet`.\n */\nexport type RigidBodyHandle = number;\n\n/**\n * The simulation status of a rigid-body.\n */\n// TODO: rename this to RigidBodyType\nexport enum RigidBodyType {\n /**\n * A `RigidBodyType::Dynamic` body can be affected by all external forces.\n */\n Dynamic = 0,\n /**\n * A `RigidBodyType::Fixed` body cannot be affected by external forces.\n */\n Fixed,\n /**\n * A `RigidBodyType::KinematicPositionBased` body cannot be affected by any external forces but can be controlled\n * by the user at the position level while keeping realistic one-way interaction with dynamic bodies.\n *\n * One-way interaction means that a kinematic body can push a dynamic body, but a kinematic body\n * cannot be pushed by anything. In other words, the trajectory of a kinematic body can only be\n * modified by the user and is independent from any contact or joint it is involved in.\n */\n KinematicPositionBased,\n /**\n * A `RigidBodyType::KinematicVelocityBased` body cannot be affected by any external forces but can be controlled\n * by the user at the velocity level while keeping realistic one-way interaction with dynamic bodies.\n *\n * One-way interaction means that a kinematic body can push a dynamic body, but a kinematic body\n * cannot be pushed by anything. In other words, the trajectory of a kinematic body can only be\n * modified by the user and is independent from any contact or joint it is involved in.\n */\n KinematicVelocityBased,\n}\n\n/**\n * A rigid-body.\n */\nexport class RigidBody {\n private rawSet: RawRigidBodySet; // The RigidBody won't need to free this.\n private colliderSet: ColliderSet;\n readonly handle: RigidBodyHandle;\n\n /**\n * An arbitrary user-defined object associated with this rigid-body.\n */\n public userData?: unknown;\n\n constructor(\n rawSet: RawRigidBodySet,\n colliderSet: ColliderSet,\n handle: RigidBodyHandle,\n ) {\n this.rawSet = rawSet;\n this.colliderSet = colliderSet;\n this.handle = handle;\n }\n\n /** @internal */\n public finalizeDeserialization(colliderSet: ColliderSet) {\n this.colliderSet = colliderSet;\n }\n\n /**\n * Checks if this rigid-body is still valid (i.e. that it has\n * not been deleted from the rigid-body set yet.\n */\n public isValid(): boolean {\n return this.rawSet.contains(this.handle);\n }\n\n /**\n * Locks or unlocks the ability of this rigid-body to translate.\n *\n * @param locked - If `true`, this rigid-body will no longer translate due to forces and impulses.\n * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.\n */\n public lockTranslations(locked: boolean, wakeUp: boolean) {\n return this.rawSet.rbLockTranslations(this.handle, locked, wakeUp);\n }\n\n /**\n * Locks or unlocks the ability of this rigid-body to rotate.\n *\n * @param locked - If `true`, this rigid-body will no longer rotate due to torques and impulses.\n * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.\n */\n public lockRotations(locked: boolean, wakeUp: boolean) {\n return this.rawSet.rbLockRotations(this.handle, locked, wakeUp);\n }\n\n // #if DIM2\n /**\n * Locks or unlocks the ability of this rigid-body to translation along individual coordinate axes.\n *\n * @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis.\n * @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis.\n * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.\n */\n public setEnabledTranslations(\n enableX: boolean,\n enableY: boolean,\n wakeUp: boolean,\n ) {\n return this.rawSet.rbSetEnabledTranslations(\n this.handle,\n enableX,\n enableY,\n wakeUp,\n );\n }\n\n /**\n * Locks or unlocks the ability of this rigid-body to translation along individual coordinate axes.\n *\n * @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis.\n * @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis.\n * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep.\n * @deprecated use `this.setEnabledTranslations` with the same arguments instead.\n */\n public restrictTranslations(\n enableX: boolean,\n enableY: boolean,\n wakeUp: boolean,\n ) {\n this.setEnabledTranslations(enableX, enableX, wakeUp);\n }\n\n // #endif\n\n /**\n * The dominance group, in [-127, +127] this rigid-body is part of.\n */\n public dominanceGroup(): number {\n return this.rawSet.rbDominanceGroup(this.handle);\n }\n\n /**\n * Sets the dominance group of this rigid-body.\n *\n * @param group - The dominance group of this rigid-body. Must be a signed integer in the range [-127, +127].\n */\n public setDominanceGroup(group: number) {\n this.rawSet.rbSetDominanceGroup(this.handle, group);\n }\n\n /**\n * The number of additional solver iterations that will be run for this\n * rigid-body and everything that interacts with it directly or indirectly\n * through contacts or joints.\n */\n public additionalSolverIterations(): number {\n return this.rawSet.rbAdditionalSolverIterations(this.handle);\n }\n\n /**\n * Sets the number of additional solver iterations that will be run for this\n * rigid-body and everything that interacts with it directly or indirectly\n * through contacts or joints.\n *\n * Compared to increasing the global `World.numSolverIteration`, setting this\n * value lets you increase accuracy on only a subset of the scene, resulting in reduced\n * performance loss.\n *\n * @param iters - The new number of additional solver iterations (default: 0).\n */\n public setAdditionalSolverIterations(iters: number) {\n this.rawSet.rbSetAdditionalSolverIterations(this.handle, iters);\n }\n\n /**\n * Enable or disable CCD (Continuous Collision Detection) for this rigid-body.\n *\n * @param enabled - If `true`, CCD will be enabled for this rigid-body.\n */\n public enableCcd(enabled: boolean) {\n this.rawSet.rbEnableCcd(this.handle, enabled);\n }\n\n /**\n * Sets the soft-CCD prediction distance for this rigid-body.\n *\n * See the documentation of `RigidBodyDesc.setSoftCcdPrediction` for\n * additional details.\n */\n public setSoftCcdPrediction(distance: number) {\n this.rawSet.rbSetSoftCcdPrediction(this.handle, distance);\n }\n\n /**\n * Gets the soft-CCD prediction distance for this rigid-body.\n *\n * See the documentation of `RigidBodyDesc.setSoftCcdPrediction` for\n * additional details.\n */\n public softCcdPrediction(): number {\n return this.rawSet.rbSoftCcdPrediction(this.handle);\n }\n\n /**\n * The world-space translation of this rigid-body.\n */\n public translation(): Vector {\n let res = this.rawSet.rbTranslation(this.handle);\n return VectorOps.fromRaw(res);\n }\n\n /**\n * The world-space orientation of this rigid-body.\n */\n public rotation(): Rotation {\n let res = this.rawSet.rbRotation(this.handle);\n return RotationOps.fromRaw(res);\n }\n\n /**\n * The world-space next translation of this rigid-body.\n *\n * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation`\n * method and is used for estimating the kinematic body velocity at the next timestep.\n * For non-kinematic bodies, this value is currently unspecified.\n */\n public nextTranslation(): Vector {\n let res = this.rawSet.rbNextTranslation(this.handle);\n return VectorOps.fromRaw(res);\n }\n\n /**\n * The world-space next orientation of this rigid-body.\n *\n * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation`\n * method and is used for estimating the kinematic body velocity at the next timestep.\n * For non-kinematic bodies, this value is currently unspecified.\n */\n public nextRotation(): Rotation {\n let res = this.rawSet.rbNextRotation(this.handle);\n return RotationOps.fromRaw(res);\n }\n\n /**\n * Sets the translation of this rigid-body.\n *\n * @param tra - The world-space position of the rigid-body.\n * @param wakeUp - Forces the rigid-body to wake-up so it is properly affected by forces if it\n * wasn't moving before modifying its position.\n */\n public setTranslation(tra: Vector, wakeUp: boolean) {\n // #if DIM2\n this.rawSet.rbSetTranslation(this.handle, tra.x, tra.y, wakeUp);\n // #endif\n }\n\n /**\n * Sets the linear velocity of this rigid-body.\n *\n * @param vel - The linear velocity to set.\n * @param wakeUp - Forces the rigid-body to wake-up if it was asleep.\n */\n public setLinvel(vel: Vector, wakeUp: boolean) {\n let rawVel = VectorOps.intoRaw(vel);\n this.rawSet.rbSetLinvel(this.handle, rawVel, wakeUp);\n rawVel.free();\n }\n\n /**\n * The scale factor applied to the gravity affecting\n * this rigid-body.\n */\n public gravityScale(): number {\n return this.rawSet.rbGravityScale(this.handle);\n }\n\n /**\n * Sets the scale factor applied to the gravity affecting\n * this rigid-body.\n *\n * @param factor - The scale factor to set. A value of 0.0 means\n * that this rigid-body will on longer be affected by gravity.\n * @param wakeUp - Forces the rigid-body to wake-up if it was asleep.\n */\n public setGravityScale(factor: number, wakeUp: boolean) {\n this.rawSet.rbSetGravityScale(this.handle, factor, wakeUp);\n }\n\n\n // #if DIM2\n /**\n * Sets the rotation angle of this rigid-body.\n *\n * @param angle - The rotation angle, in radians.\n * @param wakeUp - Forces the rigid-body to wake-up so it is properly affected by forces if it\n * wasn't moving before modifying its position.\n */\n public setRotation(angle: number, wakeUp: boolean) {\n this.rawSet.rbSetRotation(this.handle, angle, wakeUp);\n }\n\n /**\n * Sets the angular velocity fo this rigid-body.\n *\n * @param vel - The angular velocity to set.\n * @param wakeUp - Forces the rigid-body to wake-up if it was asleep.\n */\n public setAngvel(vel: number, wakeUp: boolean) {\n this.rawSet.rbSetAngvel(this.handle, vel, wakeUp);\n }\n\n // #endif\n\n /**\n * If this rigid body is kinematic, sets its future translation after the next timestep integration.\n *\n * This should be used instead of `rigidBody.setTranslation` to make the dynamic object\n * interacting with this kinematic body behave as expected. Internally, Rapier will compute\n * an artificial velocity for this rigid-body from its current position and its next kinematic\n * position. This velocity will be used to compute forces on dynamic bodies interacting with\n * this body.\n *\n * @param t - The kinematic translation to set.\n */\n public setNextKinematicTranslation(t: Vector) {\n // #if DIM2\n this.rawSet.rbSetNextKinematicTranslation(this.handle, t.x, t.y);\n // #endif\n }\n\n\n // #if DIM2\n /**\n * If this rigid body is kinematic, sets its future rotation after the next timestep integration.\n *\n * This should be used instead of `rigidBody.setRotation` to make the dynamic object\n * interacting with this kinematic body behave as expected. Internally, Rapier will compute\n * an artificial velocity for this rigid-body from its current position and its next kinematic\n * position. This velocity will be used to compute forces on dynamic bodies interacting with\n * this body.\n *\n * @param angle - The kinematic rotation angle, in radians.\n */\n public setNextKinematicRotation(angle: number) {\n this.rawSet.rbSetNextKinematicRotation(this.handle, angle);\n }\n\n // #endif\n\n /**\n * The linear velocity of this rigid-body.\n */\n public linvel(): Vector {\n return VectorOps.fromRaw(this.rawSet.rbLinvel(this.handle));\n }\n\n\n // #if DIM2\n /**\n * The angular velocity of this rigid-body.\n */\n public angvel(): number {\n return this.rawSet.rbAngvel(this.handle);\n }\n\n // #endif\n\n /**\n * The mass of this rigid-body.\n */\n public mass(): number {\n return this.rawSet.rbMass(this.handle);\n }\n\n /**\n * The inverse mass taking into account translation locking.\n */\n public effectiveInvMass(): Vector {\n return VectorOps.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));\n }\n\n /**\n * The inverse of the mass of a rigid-body.\n *\n * If this is zero, the rigid-body is assumed to have infinite mass.\n */\n public invMass(): number {\n return this.rawSet.rbInvMass(this.handle);\n }\n\n /**\n * The center of mass of a rigid-body expressed in its local-space.\n */\n public localCom(): Vector {\n return VectorOps.fromRaw(this.rawSet.rbLocalCom(this.handle));\n }\n\n /**\n * The world-space center of mass of the rigid-body.\n */\n public worldCom(): Vector {\n return VectorOps.fromRaw(this.rawSet.rbWorldCom(this.handle));\n }\n\n // #if DIM2\n /**\n * The inverse of the principal angular inertia of the rigid-body.\n *\n * Components set to zero are assumed to be infinite along the corresponding principal axis.\n */\n public invPrincipalInertiaSqrt(): number {\n return this.rawSet.rbInvPrincipalInertiaSqrt(this.handle);\n }\n\n // #endif\n\n\n // #if DIM2\n /**\n * The angular inertia along the principal inertia axes of the rigid-body.\n */\n public principalInertia(): number {\n return this.rawSet.rbPrincipalInertia(this.handle);\n }\n\n // #endif\n\n\n\n // #if DIM2\n /**\n * The square-root of the world-space inverse angular inertia tensor of the rigid-body,\n * taking into account rotation locking.\n */\n public effectiveWorldInvInertiaSqrt(): number {\n return this.rawSet.rbEffectiveWorldInvInertiaSqrt(this.handle);\n }\n\n // #endif\n\n\n // #if DIM2\n /**\n * The effective world-space angular inertia (that takes the potential rotation locking into account) of\n * this rigid-body.\n */\n public effectiveAngularInertia(): number {\n return this.rawSet.rbEffectiveAngularInertia(this.handle);\n }\n\n // #endif\n\n\n /**\n * Put this rigid body to sleep.\n *\n * A sleeping body no longer moves and is no longer simulated by the physics engine unless\n * it is waken up. It can be woken manually with `this.wakeUp()` or automatically due to\n * external forces like contacts.\n */\n public sleep() {\n this.rawSet.rbSleep(this.handle);\n }\n\n /**\n * Wakes this rigid-body up.\n *\n * A dynamic rigid-body that does not move during several consecutive frames will\n * be put to sleep by the physics engine, i.e., it will stop being simulated in order\n * to avoid useless computations.\n * This methods forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying\n * the position of a dynamic body so that it is properly simulated afterwards.\n */\n public wakeUp() {\n this.rawSet.rbWakeUp(this.handle);\n }\n\n /**\n * Is CCD enabled for this rigid-body?\n */\n public isCcdEnabled(): boolean {\n return this.rawSet.rbIsCcdEnabled(this.handle);\n }\n\n /**\n * The number of colliders attached to this rigid-body.\n */\n public numColliders(): number {\n return this.rawSet.rbNumColliders(this.handle);\n }\n\n /**\n * Retrieves the `i-th` collider attached to this rigid-body.\n *\n * @param i - The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`.\n * This index is **not** the same as the unique identifier of the collider.\n */\n public collider(i: number): Collider {\n return this.colliderSet.get(this.rawSet.rbCollider(this.handle, i));\n }\n\n /**\n * Sets whether this rigid-body is enabled or not.\n *\n * @param enabled - Set to `false` to disable this rigid-body and all its attached colliders.\n */\n public setEnabled(enabled: boolean) {\n this.rawSet.rbSetEnabled(this.handle, enabled);\n }\n\n /**\n * Is this rigid-body enabled?\n */\n public isEnabled(): boolean {\n return this.rawSet.rbIsEnabled(this.handle);\n }\n\n /**\n * The status of this rigid-body: static, dynamic, or kinematic.\n */\n public bodyType(): RigidBodyType {\n return this.rawSet.rbBodyType(this.handle) as number as RigidBodyType;\n }\n\n /**\n * Set a new status for this rigid-body: static, dynamic, or kinematic.\n */\n public setBodyType(type: RigidBodyType, wakeUp: boolean) {\n return this.rawSet.rbSetBodyType(\n this.handle,\n type as number as RawRigidBodyType,\n wakeUp,\n );\n }\n\n /**\n * Is this rigid-body sleeping?\n */\n public isSleeping(): boolean {\n return this.rawSet.rbIsSleeping(this.handle);\n }\n\n /**\n * Is the velocity of this rigid-body not zero?\n */\n public isMoving(): boolean {\n return this.rawSet.rbIsMoving(this.handle);\n }\n\n /**\n * Is this rigid-body static?\n */\n public isFixed(): boolean {\n return this.rawSet.rbIsFixed(this.handle);\n }\n\n /**\n * Is this rigid-body kinematic?\n */\n public isKinematic(): boolean {\n return this.rawSet.rbIsKinematic(this.handle);\n }\n\n /**\n * Is this rigid-body dynamic?\n */\n public isDynamic(): boolean {\n return this.rawSet.rbIsDynamic(this.handle);\n }\n\n /**\n * The linear damping coefficient of this rigid-body.\n */\n public linearDamping(): number {\n return this.rawSet.rbLinearDamping(this.handle);\n }\n\n /**\n * The angular damping coefficient of this rigid-body.\n */\n public angularDamping(): number {\n return this.rawSet.rbAngularDamping(this.handle);\n }\n\n /**\n * Sets the linear damping factor applied to this rigid-body.\n *\n * @param factor - The damping factor to set.\n */\n public setLinearDamping(factor: number) {\n this.rawSet.rbSetLinearDamping(this.handle, factor);\n }\n\n /**\n * Recompute the mass-properties of this rigid-bodies based on its currently attached colliders.\n */\n public recomputeMassPropertiesFromColliders() {\n this.rawSet.rbRecomputeMassPropertiesFromColliders(\n this.handle,\n this.colliderSet.raw,\n );\n }\n\n /**\n * Sets the rigid-body's additional mass.\n *\n * The total angular inertia of the rigid-body will be scaled automatically based on this additional mass. If this\n * scaling effect isn’t desired, use Self::additional_mass_properties instead of this method.\n *\n * This is only the \"additional\" mass because the total mass of the rigid-body is equal to the sum of this\n * additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body.\n *\n * That total mass (which includes the attached colliders’ contributions) will be updated at the name physics step,\n * or can be updated manually with `this.recomputeMassPropertiesFromColliders`.\n *\n * This will override any previous additional mass-properties set by `this.setAdditionalMass`,\n * `this.setAdditionalMassProperties`, `RigidBodyDesc::setAdditionalMass`, or\n * `RigidBodyDesc.setAdditionalMassfProperties` for this rigid-body.\n *\n * @param mass - The additional mass to set.\n * @param wakeUp - If `true` then the rigid-body will be woken up if it was put to sleep because it did not move for a while.\n */\n public setAdditionalMass(mass: number, wakeUp: boolean) {\n this.rawSet.rbSetAdditionalMass(this.handle, mass, wakeUp);\n }\n\n\n // #if DIM2\n /**\n * Sets the rigid-body's additional mass-properties.\n *\n * This is only the \"additional\" mass-properties because the total mass-properties of the rigid-body is equal to the\n * sum of this additional mass-properties and the mass computed from the colliders (with non-zero densities) attached\n * to this rigid-body.\n *\n * That total mass-properties (which include the attached colliders’ contributions) will be updated at the name\n * physics step, or can be updated manually with `this.recomputeMassPropertiesFromColliders`.\n *\n * This will override any previous mass-properties set by `this.setAdditionalMass`,\n * `this.setAdditionalMassProperties`, `RigidBodyDesc.setAdditionalMass`, or `RigidBodyDesc.setAdditionalMassProperties`\n * for this rigid-body.\n *\n * If `wake_up` is true then the rigid-body will be woken up if it was put to sleep because it did not move for a while.\n */\n public setAdditionalMassProperties(\n mass: number,\n centerOfMass: Vector,\n principalAngularInertia: number,\n wakeUp: boolean,\n ) {\n let rawCom = VectorOps.intoRaw(centerOfMass);\n this.rawSet.rbSetAdditionalMassProperties(\n this.handle,\n mass,\n rawCom,\n principalAngularInertia,\n wakeUp,\n );\n rawCom.free();\n }\n\n // #endif\n\n /**\n * Sets the linear damping factor applied to this rigid-body.\n *\n * @param factor - The damping factor to set.\n */\n public setAngularDamping(factor: number) {\n this.rawSet.rbSetAngularDamping(this.handle, factor);\n }\n\n /**\n * Resets to zero the user forces (but not torques) applied to this rigid-body.\n *\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public resetForces(wakeUp: boolean) {\n this.rawSet.rbResetForces(this.handle, wakeUp);\n }\n\n /**\n * Resets to zero the user torques applied to this rigid-body.\n *\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public resetTorques(wakeUp: boolean) {\n this.rawSet.rbResetTorques(this.handle, wakeUp);\n }\n\n /**\n * Adds a force at the center-of-mass of this rigid-body.\n *\n * @param force - the world-space force to add to the rigid-body.\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public addForce(force: Vector, wakeUp: boolean) {\n const rawForce = VectorOps.intoRaw(force);\n this.rawSet.rbAddForce(this.handle, rawForce, wakeUp);\n rawForce.free();\n }\n\n /**\n * Applies an impulse at the center-of-mass of this rigid-body.\n *\n * @param impulse - the world-space impulse to apply on the rigid-body.\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public applyImpulse(impulse: Vector, wakeUp: boolean) {\n const rawImpulse = VectorOps.intoRaw(impulse);\n this.rawSet.rbApplyImpulse(this.handle, rawImpulse, wakeUp);\n rawImpulse.free();\n }\n\n // #if DIM2\n /**\n * Adds a torque at the center-of-mass of this rigid-body.\n *\n * @param torque - the torque to add to the rigid-body.\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public addTorque(torque: number, wakeUp: boolean) {\n this.rawSet.rbAddTorque(this.handle, torque, wakeUp);\n }\n\n // #endif\n\n\n // #if DIM2\n /**\n * Applies an impulsive torque at the center-of-mass of this rigid-body.\n *\n * @param torqueImpulse - the torque impulse to apply on the rigid-body.\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public applyTorqueImpulse(torqueImpulse: number, wakeUp: boolean) {\n this.rawSet.rbApplyTorqueImpulse(this.handle, torqueImpulse, wakeUp);\n }\n\n // #endif\n\n\n /**\n * Adds a force at the given world-space point of this rigid-body.\n *\n * @param force - the world-space force to add to the rigid-body.\n * @param point - the world-space point where the impulse is to be applied on the rigid-body.\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public addForceAtPoint(force: Vector, point: Vector, wakeUp: boolean) {\n const rawForce = VectorOps.intoRaw(force);\n const rawPoint = VectorOps.intoRaw(point);\n this.rawSet.rbAddForceAtPoint(this.handle, rawForce, rawPoint, wakeUp);\n rawForce.free();\n rawPoint.free();\n }\n\n /**\n * Applies an impulse at the given world-space point of this rigid-body.\n *\n * @param impulse - the world-space impulse to apply on the rigid-body.\n * @param point - the world-space point where the impulse is to be applied on the rigid-body.\n * @param wakeUp - should the rigid-body be automatically woken-up?\n */\n public applyImpulseAtPoint(\n impulse: Vector,\n point: Vector,\n wakeUp: boolean,\n ) {\n const rawImpulse = VectorOps.intoRaw(impulse);\n const rawPoint = VectorOps.intoRaw(point);\n this.rawSet.rbApplyImpulseAtPoint(\n this.handle,\n rawImpulse,\n rawPoint,\n wakeUp,\n );\n rawImpulse.free();\n rawPoint.free();\n }\n}\n\nexport class RigidBodyDesc {\n enabled: boolean;\n translation: Vector;\n rotation: Rotation;\n gravityScale: number;\n mass: number;\n massOnly: boolean;\n centerOfMass: Vector;\n translationsEnabledX: boolean;\n translationsEnabledY: boolean;\n linvel: Vector;\n // #if DIM2\n angvel: number;\n principalAngularInertia: number;\n rotationsEnabled: boolean;\n // #endif\n linearDamping: number;\n angularDamping: number;\n status: RigidBodyType;\n canSleep: boolean;\n sleeping: boolean;\n ccdEnabled: boolean;\n softCcdPrediction: number;\n dominanceGroup: number;\n additionalSolverIterations: number;\n userData?: unknown;\n\n constructor(status: RigidBodyType) {\n this.enabled = true;\n this.status = status;\n this.translation = VectorOps.zeros();\n this.rotation = RotationOps.identity();\n this.gravityScale = 1.0;\n this.linvel = VectorOps.zeros();\n this.mass = 0.0;\n this.massOnly = false;\n this.centerOfMass = VectorOps.zeros();\n this.translationsEnabledX = true;\n this.translationsEnabledY = true;\n // #if DIM2\n this.angvel = 0.0;\n this.principalAngularInertia = 0.0;\n this.rotationsEnabled = true;\n // #endif\n this.linearDamping = 0.0;\n this.angularDamping = 0.0;\n this.canSleep = true;\n this.sleeping = false;\n this.ccdEnabled = false;\n this.softCcdPrediction = 0.0;\n this.dominanceGroup = 0;\n this.additionalSolverIterations = 0;\n }\n\n /**\n * A rigid-body descriptor used to build a dynamic rigid-body.\n */\n public static dynamic(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.Dynamic);\n }\n\n /**\n * A rigid-body descriptor used to build a position-based kinematic rigid-body.\n */\n public static kinematicPositionBased(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.KinematicPositionBased);\n }\n\n /**\n * A rigid-body descriptor used to build a velocity-based kinematic rigid-body.\n */\n public static kinematicVelocityBased(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.KinematicVelocityBased);\n }\n\n /**\n * A rigid-body descriptor used to build a fixed rigid-body.\n */\n public static fixed(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.Fixed);\n }\n\n /**\n * A rigid-body descriptor used to build a dynamic rigid-body.\n *\n * @deprecated The method has been renamed to `.dynamic()`.\n */\n public static newDynamic(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.Dynamic);\n }\n\n /**\n * A rigid-body descriptor used to build a position-based kinematic rigid-body.\n *\n * @deprecated The method has been renamed to `.kinematicPositionBased()`.\n */\n public static newKinematicPositionBased(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.KinematicPositionBased);\n }\n\n /**\n * A rigid-body descriptor used to build a velocity-based kinematic rigid-body.\n *\n * @deprecated The method has been renamed to `.kinematicVelocityBased()`.\n */\n public static newKinematicVelocityBased(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.KinematicVelocityBased);\n }\n\n /**\n * A rigid-body descriptor used to build a fixed rigid-body.\n *\n * @deprecated The method has been renamed to `.fixed()`.\n */\n public static newStatic(): RigidBodyDesc {\n return new RigidBodyDesc(RigidBodyType.Fixed);\n }\n\n public setDominanceGroup(group: number): RigidBodyDesc {\n this.dominanceGroup = group;\n return this;\n }\n\n /**\n * Sets the number of additional solver iterations that will be run for this\n * rigid-body and everything that interacts with it directly or indirectly\n * through contacts or joints.\n *\n * Compared to increasing the global `World.numSolverIteration`, setting this\n * value lets you increase accuracy on only a subset of the scene, resulting in reduced\n * performance loss.\n *\n * @param iters - The new number of additional solver iterations (default: 0).\n */\n public setAdditionalSolverIterations(iters: number): RigidBodyDesc {\n this.additionalSolverIterations = iters;\n return this;\n }\n\n /**\n * Sets whether the created rigid-body will be enabled or disabled.\n * @param enabled − If set to `false` the rigid-body will be disabled at creation.\n */\n public setEnabled(enabled: boolean): RigidBodyDesc {\n this.enabled = enabled;\n return this;\n }\n\n // #if DIM2\n /**\n * Sets the initial translation of the rigid-body to create.\n */\n public setTranslation(x: number, y: number): RigidBodyDesc {\n if (typeof x != \"number\" || typeof y != \"number\")\n throw TypeError(\"The translation components must be numbers.\");\n\n this.translation = {x: x, y: y};\n return this;\n }\n\n // #endif\n\n\n /**\n * Sets the initial rotation of the rigid-body to create.\n *\n * @param rot - The rotation to set.\n */\n public setRotation(rot: Rotation): RigidBodyDesc {\n // #if DIM2\n this.rotation = rot;\n // #endif\n return this;\n }\n\n /**\n * Sets the scale factor applied to the gravity affecting\n * the rigid-body being built.\n *\n * @param scale - The scale factor. Set this to `0.0` if the rigid-body\n * needs to ignore gravity.\n */\n public setGravityScale(scale: number): RigidBodyDesc {\n this.gravityScale = scale;\n return this;\n }\n\n /**\n * Sets the initial mass of the rigid-body being built, before adding colliders' contributions.\n *\n * @param mass − The initial mass of the rigid-body to create.\n */\n public setAdditionalMass(mass: number): RigidBodyDesc {\n this.mass = mass;\n this.massOnly = true;\n return this;\n }\n\n // #if DIM2\n /**\n * Sets the initial linear velocity of the rigid-body to create.\n *\n * @param x - The linear velocity to set along the `x` axis.\n * @param y - The linear velocity to set along the `y` axis.\n */\n public setLinvel(x: number, y: number): RigidBodyDesc {\n if (typeof x != \"number\" || typeof y != \"number\")\n throw TypeError(\"The linvel components must be numbers.\");\n\n this.linvel = {x: x, y: y};\n return this;\n }\n\n /**\n * Sets the initial angular velocity of the rigid-body to create.\n *\n * @param vel - The angular velocity to set.\n */\n public setAngvel(vel: number): RigidBodyDesc {\n this.angvel = vel;\n return this;\n }\n\n /**\n * Sets the mass properties of the rigid-body being built.\n *\n * Note that the final mass properties of the rigid-bodies depends\n * on the initial mass-properties of the rigid-body (set by this method)\n * to which is added the contributions of all the colliders with non-zero density\n * attached to this rigid-body.\n *\n * Therefore, if you want your provided mass properties to be the final\n * mass properties of your rigid-body, don't attach colliders to it, or\n * only attach colliders with densities equal to zero.\n *\n * @param mass − The initial mass of the rigid-body to create.\n * @param centerOfMass − The initial center-of-mass of the rigid-body to create.\n * @param principalAngularInertia − The initial principal angular inertia of the rigid-body to create.\n */\n public setAdditionalMassProperties(\n mass: number,\n centerOfMass: Vector,\n principalAngularInertia: number,\n ): RigidBodyDesc {\n this.mass = mass;\n VectorOps.copy(this.centerOfMass, centerOfMass);\n this.principalAngularInertia = principalAngularInertia;\n this.massOnly = false;\n return this;\n }\n\n /**\n * Allow translation of this rigid-body only along specific axes.\n * @param translationsEnabledX - Are translations along the X axis enabled?\n * @param translationsEnabledY - Are translations along the y axis enabled?\n */\n public enabledTranslations(\n translationsEnabledX: boolean,\n translationsEnabledY: boolean,\n ): RigidBodyDesc {\n this.translationsEnabledX = translationsEnabledX;\n this.translationsEnabledY = translationsEnabledY;\n return this;\n }\n\n /**\n * Allow translation of this rigid-body only along specific axes.\n * @param translationsEnabledX - Are translations along the X axis enabled?\n * @param translationsEnabledY - Are translations along the y axis enabled?\n * @deprecated use `this.enabledTranslations` with the same arguments instead.\n */\n public restrictTranslations(\n translationsEnabledX: boolean,\n translationsEnabledY: boolean,\n ): RigidBodyDesc {\n return this.enabledTranslations(\n translationsEnabledX,\n translationsEnabledY,\n );\n }\n\n /**\n * Locks all translations that would have resulted from forces on\n * the created rigid-body.\n */\n public lockTranslations(): RigidBodyDesc {\n return this.restrictTranslations(false, false);\n }\n\n /**\n * Locks all rotations that would have resulted from forces on\n * the created rigid-body.\n */\n public lockRotations(): RigidBodyDesc {\n this.rotationsEnabled = false;\n return this;\n }\n\n // #endif\n\n\n /**\n * Sets the linear damping of the rigid-body to create.\n *\n * This will progressively slowdown the translational movement of the rigid-body.\n *\n * @param damping - The angular damping coefficient. Should be >= 0. The higher this\n * value is, the stronger the translational slowdown will be.\n */\n public setLinearDamping(damping: number): RigidBodyDesc {\n this.linearDamping = damping;\n return this;\n }\n\n /**\n * Sets the angular damping of the rigid-body to create.\n *\n * This will progressively slowdown the rotational movement of the rigid-body.\n *\n * @param damping - The angular damping coefficient. Should be >= 0. The higher this\n * value is, the stronger the rotational slowdown will be.\n */\n public setAngularDamping(damping: number): RigidBodyDesc {\n this.angularDamping = damping;\n return this;\n }\n\n /**\n * Sets whether or not the rigid-body to create can sleep.\n *\n * @param can - true if the rigid-body can sleep, false if it can't.\n */\n public setCanSleep(can: boolean): RigidBodyDesc {\n this.canSleep = can;\n return this;\n }\n\n /**\n * Sets whether or not the rigid-body is to be created asleep.\n *\n * @param can - true if the rigid-body should be in sleep, default false.\n */\n setSleeping(sleeping: boolean): RigidBodyDesc {\n this.sleeping = sleeping;\n return this;\n }\n\n /**\n * Sets whether Continuous Collision Detection (CCD) is enabled for this rigid-body.\n *\n * @param enabled - true if the rigid-body has CCD enabled.\n */\n public setCcdEnabled(enabled: boolean): RigidBodyDesc {\n this.ccdEnabled = enabled;\n return this;\n }\n\n /**\n * Sets the maximum prediction distance Soft Continuous Collision-Detection.\n *\n * When set to 0, soft-CCD is disabled. Soft-CCD helps prevent tunneling especially of\n * slow-but-thin to moderately fast objects. The soft CCD prediction distance indicates how\n * far in the object’s path the CCD algorithm is allowed to inspect. Large values can impact\n * performance badly by increasing the work needed from the broad-phase.\n *\n * It is a generally cheaper variant of regular CCD (that can be enabled with\n * `RigidBodyDesc::setCcdEnabled` since it relies on predictive constraints instead of\n * shape-cast and substeps.\n */\n public setSoftCcdPrediction(distance: number): RigidBodyDesc {\n this.softCcdPrediction = distance;\n return this;\n }\n\n /**\n * Sets the user-defined object of this rigid-body.\n *\n * @param userData - The user-defined object to set.\n */\n public setUserData(data?: unknown): RigidBodyDesc {\n this.userData = data;\n return this;\n }\n}\n", "export class Coarena<T> {\n fconv: Float64Array;\n uconv: Uint32Array;\n data: Array<T>;\n size: number;\n\n public constructor() {\n this.fconv = new Float64Array(1);\n this.uconv = new Uint32Array(this.fconv.buffer);\n this.data = new Array<T>();\n this.size = 0;\n }\n\n public set(handle: number, data: T) {\n let i = this.index(handle);\n while (this.data.length <= i) {\n this.data.push(null);\n }\n\n if (this.data[i] == null) this.size += 1;\n this.data[i] = data;\n }\n\n public len(): number {\n return this.size;\n }\n\n public delete(handle: number) {\n let i = this.index(handle);\n if (i < this.data.length) {\n if (this.data[i] != null) this.size -= 1;\n this.data[i] = null;\n }\n }\n\n public clear() {\n this.data = new Array<T>();\n }\n\n public get(handle: number): T | null {\n let i = this.index(handle);\n if (i < this.data.length) {\n return this.data[i];\n } else {\n return null;\n }\n }\n\n public forEach(f: (elt: T) => void) {\n for (const elt of this.data) {\n if (elt != null) f(elt);\n }\n }\n\n public getAll(): Array<T> {\n return this.data.filter((elt) => elt != null);\n }\n\n private index(handle: number): number {\n /// Extracts the index part of a handle (the lower 32 bits).\n /// This is done by first injecting the handle into an Float64Array\n /// which is itself injected into an Uint32Array (at construction time).\n /// The 0-th value of the Uint32Array will become the `number` integer\n /// representation of the lower 32 bits.\n /// Also `this.uconv[1]` then contains the generation number as a `number`,\n /// which we don’t really need.\n this.fconv[0] = handle;\n return this.uconv[0];\n }\n}\n", "import {RawRigidBodySet, RawRigidBodyType} from \"../raw\";\nimport {Coarena} from \"../coarena\";\nimport {VectorOps, RotationOps} from \"../math\";\nimport {\n RigidBody,\n RigidBodyDesc,\n RigidBodyHandle,\n RigidBodyType,\n} from \"./rigid_body\";\nimport {ColliderSet} from \"../geometry\";\nimport {ImpulseJointSet} from \"./impulse_joint_set\";\nimport {MultibodyJointSet} from \"./multibody_joint_set\";\nimport {IslandManager} from \"./island_manager\";\n\n/**\n * A set of rigid bodies that can be handled by a physics pipeline.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `rigidBodySet.free()`\n * once you are done using it (and all the rigid-bodies it created).\n */\nexport class RigidBodySet {\n raw: RawRigidBodySet;\n private map: Coarena<RigidBody>;\n\n /**\n * Release the WASM memory occupied by this rigid-body set.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n\n if (!!this.map) {\n this.map.clear();\n }\n this.map = undefined;\n }\n\n constructor(raw?: RawRigidBodySet) {\n this.raw = raw || new RawRigidBodySet();\n this.map = new Coarena<RigidBody>();\n // deserialize\n if (raw) {\n raw.forEachRigidBodyHandle((handle: RigidBodyHandle) => {\n this.map.set(handle, new RigidBody(raw, null, handle));\n });\n }\n }\n\n /**\n * Internal method, do not call this explicitly.\n */\n public finalizeDeserialization(colliderSet: ColliderSet) {\n this.map.forEach((rb) => rb.finalizeDeserialization(colliderSet));\n }\n\n /**\n * Creates a new rigid-body and return its integer handle.\n *\n * @param desc - The description of the rigid-body to create.\n */\n public createRigidBody(\n colliderSet: ColliderSet,\n desc: RigidBodyDesc,\n ): RigidBody {\n let rawTra = VectorOps.intoRaw(desc.translation);\n let rawRot = RotationOps.intoRaw(desc.rotation);\n let rawLv = VectorOps.intoRaw(desc.linvel);\n let rawCom = VectorOps.intoRaw(desc.centerOfMass);\n\n\n let handle = this.raw.createRigidBody(\n desc.enabled,\n rawTra,\n rawRot,\n desc.gravityScale,\n desc.mass,\n desc.massOnly,\n rawCom,\n rawLv,\n // #if DIM2\n desc.angvel,\n desc.principalAngularInertia,\n desc.translationsEnabledX,\n desc.translationsEnabledY,\n desc.rotationsEnabled,\n // #endif\n desc.linearDamping,\n desc.angularDamping,\n desc.status as number as RawRigidBodyType,\n desc.canSleep,\n desc.sleeping,\n desc.softCcdPrediction,\n desc.ccdEnabled,\n desc.dominanceGroup,\n desc.additionalSolverIterations,\n );\n\n rawTra.free();\n rawRot.free();\n rawLv.free();\n rawCom.free();\n\n\n const body = new RigidBody(this.raw, colliderSet, handle);\n body.userData = desc.userData;\n\n this.map.set(handle, body);\n\n return body;\n }\n\n /**\n * Removes a rigid-body from this set.\n *\n * This will also remove all the colliders and joints attached to the rigid-body.\n *\n * @param handle - The integer handle of the rigid-body to remove.\n * @param colliders - The set of colliders that may contain colliders attached to the removed rigid-body.\n * @param impulseJoints - The set of impulse joints that may contain joints attached to the removed rigid-body.\n * @param multibodyJoints - The set of multibody joints that may contain joints attached to the removed rigid-body.\n */\n public remove(\n handle: RigidBodyHandle,\n islands: IslandManager,\n colliders: ColliderSet,\n impulseJoints: ImpulseJointSet,\n multibodyJoints: MultibodyJointSet,\n ) {\n // Unmap the entities that will be removed automatically because of the rigid-body removals.\n for (let i = 0; i < this.raw.rbNumColliders(handle); i += 1) {\n colliders.unmap(this.raw.rbCollider(handle, i));\n }\n\n impulseJoints.forEachJointHandleAttachedToRigidBody(handle, (handle) =>\n impulseJoints.unmap(handle),\n );\n multibodyJoints.forEachJointHandleAttachedToRigidBody(\n handle,\n (handle) => multibodyJoints.unmap(handle),\n );\n\n // Remove the rigid-body.\n this.raw.remove(\n handle,\n islands.raw,\n colliders.raw,\n impulseJoints.raw,\n multibodyJoints.raw,\n );\n this.map.delete(handle);\n }\n\n /**\n * The number of rigid-bodies on this set.\n */\n public len(): number {\n return this.map.len();\n }\n\n /**\n * Does this set contain a rigid-body with the given handle?\n *\n * @param handle - The rigid-body handle to check.\n */\n public contains(handle: RigidBodyHandle): boolean {\n return this.get(handle) != null;\n }\n\n /**\n * Gets the rigid-body with the given handle.\n *\n * @param handle - The handle of the rigid-body to retrieve.\n */\n public get(handle: RigidBodyHandle): RigidBody | null {\n return this.map.get(handle);\n }\n\n /**\n * Applies the given closure to each rigid-body contained by this set.\n *\n * @param f - The closure to apply.\n */\n public forEach(f: (body: RigidBody) => void) {\n this.map.forEach(f);\n }\n\n /**\n * Applies the given closure to each active rigid-bodies contained by this set.\n *\n * A rigid-body is active if it is not sleeping, i.e., if it moved recently.\n *\n * @param f - The closure to apply.\n */\n public forEachActiveRigidBody(\n islands: IslandManager,\n f: (body: RigidBody) => void,\n ) {\n islands.forEachActiveRigidBodyHandle((handle) => {\n f(this.get(handle));\n });\n }\n\n /**\n * Gets all rigid-bodies in the list.\n *\n * @returns rigid-bodies list.\n */\n public getAll(): RigidBody[] {\n return this.map.getAll();\n }\n}\n", "import {RawIntegrationParameters} from \"../raw\";\n\nexport class IntegrationParameters {\n raw: RawIntegrationParameters;\n\n constructor(raw?: RawIntegrationParameters) {\n this.raw = raw || new RawIntegrationParameters();\n }\n\n /**\n * Free the WASM memory used by these integration parameters.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n /**\n * The timestep length (default: `1.0 / 60.0`)\n */\n get dt(): number {\n return this.raw.dt;\n }\n\n /**\n * The Error Reduction Parameter in `[0, 1]` is the proportion of\n * the positional error to be corrected at each time step (default: `0.2`).\n */\n get erp(): number {\n return this.raw.erp;\n }\n\n get lengthUnit(): number {\n return this.raw.lengthUnit;\n }\n\n /**\n * Normalized amount of penetration the engine won’t attempt to correct (default: `0.001m`).\n *\n * This threshold considered by the physics engine is this value multiplied by the `lengthUnit`.\n */\n get normalizedAllowedLinearError(): number {\n return this.raw.normalizedAllowedLinearError;\n }\n\n /**\n * The maximal normalized distance separating two objects that will generate predictive contacts (default: `0.002`).\n *\n * This threshold considered by the physics engine is this value multiplied by the `lengthUnit`.\n */\n get normalizedPredictionDistance(): number {\n return this.raw.normalizedPredictionDistance;\n }\n\n /**\n * The number of solver iterations run by the constraints solver for calculating forces (default: `4`).\n */\n get numSolverIterations(): number {\n return this.raw.numSolverIterations;\n }\n\n /**\n * Number of addition friction resolution iteration run during the last solver sub-step (default: `4`).\n */\n get numAdditionalFrictionIterations(): number {\n return this.raw.numAdditionalFrictionIterations;\n }\n\n /**\n * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).\n */\n get numInternalPgsIterations(): number {\n return this.raw.numInternalPgsIterations;\n }\n\n /**\n * Minimum number of dynamic bodies in each active island (default: `128`).\n */\n get minIslandSize(): number {\n return this.raw.minIslandSize;\n }\n\n /**\n * Maximum number of substeps performed by the solver (default: `1`).\n */\n get maxCcdSubsteps(): number {\n return this.raw.maxCcdSubsteps;\n }\n\n set dt(value: number) {\n this.raw.dt = value;\n }\n\n set erp(value: number) {\n this.raw.erp = value;\n }\n\n set lengthUnit(value: number) {\n this.raw.lengthUnit = value;\n }\n\n set normalizedAllowedLinearError(value: number) {\n this.raw.normalizedAllowedLinearError = value;\n }\n\n set normalizedPredictionDistance(value: number) {\n this.raw.normalizedPredictionDistance = value;\n }\n\n /**\n * Sets the number of solver iterations run by the constraints solver for calculating forces (default: `4`).\n */\n set numSolverIterations(value: number) {\n this.raw.numSolverIterations = value;\n }\n\n /**\n * Sets the number of addition friction resolution iteration run during the last solver sub-step (default: `4`).\n */\n set numAdditionalFrictionIterations(value: number) {\n this.raw.numAdditionalFrictionIterations = value;\n }\n\n /**\n * Sets the number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).\n */\n set numInternalPgsIterations(value: number) {\n this.raw.numInternalPgsIterations = value;\n }\n\n set minIslandSize(value: number) {\n this.raw.minIslandSize = value;\n }\n\n set maxCcdSubsteps(value: number) {\n this.raw.maxCcdSubsteps = value;\n }\n\n public switchToStandardPgsSolver() {\n this.raw.switchToStandardPgsSolver();\n }\n\n public switchToSmallStepsPgsSolver() {\n this.raw.switchToSmallStepsPgsSolver();\n }\n\n public switchToSmallStepsPgsSolverWithoutWarmstart() {\n this.raw.switchToSmallStepsPgsSolverWithoutWarmstart();\n }\n}\n", "import {Rotation, Vector, VectorOps, RotationOps} from \"../math\";\nimport {\n RawGenericJoint,\n RawImpulseJointSet,\n RawRigidBodySet,\n RawJointAxis,\n RawJointType,\n RawMotorModel,\n} from \"../raw\";\nimport {RigidBody, RigidBodyHandle} from \"./rigid_body\";\nimport {RigidBodySet} from \"./rigid_body_set\";\n\n/**\n * The integer identifier of a collider added to a `ColliderSet`.\n */\nexport type ImpulseJointHandle = number;\n\n/**\n * An enum grouping all possible types of joints:\n *\n * - `Revolute`: A revolute joint that removes all degrees of freedom between the affected\n * bodies except for the rotation along one axis.\n * - `Fixed`: A fixed joint that removes all relative degrees of freedom between the affected bodies.\n * - `Prismatic`: A prismatic joint that removes all degrees of freedom between the affected\n * bodies except for the translation along one axis.\n * - `Spherical`: (3D only) A spherical joint that removes all relative linear degrees of freedom between the affected bodies.\n * - `Generic`: (3D only) A joint with customizable degrees of freedom, allowing any of the 6 axes to be locked.\n */\nexport enum JointType {\n Revolute,\n Fixed,\n Prismatic,\n Rope,\n Spring,\n}\n\nexport enum MotorModel {\n AccelerationBased,\n ForceBased,\n}\n\n/**\n * An enum representing the possible joint axes of a generic joint.\n * They can be ORed together, like:\n * JointAxesMask.X || JointAxesMask.Y\n * to get a joint that is only free in the X and Y translational (positional) axes.\n *\n * Possible free axes are:\n *\n * - `X`: X translation axis\n * - `Y`: Y translation axis\n * - `Z`: Z translation axis\n * - `AngX`: X angular rotation axis\n * - `AngY`: Y angular rotations axis\n * - `AngZ`: Z angular rotation axis\n */\nexport enum JointAxesMask {\n X = 1 << 0,\n Y = 1 << 1,\n Z = 1 << 2,\n AngX = 1 << 3,\n AngY = 1 << 4,\n AngZ = 1 << 5,\n}\n\nexport class ImpulseJoint {\n protected rawSet: RawImpulseJointSet; // The ImpulseJoint won't need to free this.\n protected bodySet: RigidBodySet; // The ImpulseJoint won’t need to free this.\n handle: ImpulseJointHandle;\n\n constructor(\n rawSet: RawImpulseJointSet,\n bodySet: RigidBodySet,\n handle: ImpulseJointHandle,\n ) {\n this.rawSet = rawSet;\n this.bodySet = bodySet;\n this.handle = handle;\n }\n\n public static newTyped(\n rawSet: RawImpulseJointSet,\n bodySet: RigidBodySet,\n handle: ImpulseJointHandle,\n ): ImpulseJoint {\n switch (rawSet.jointType(handle)) {\n case RawJointType.Revolute:\n return new RevoluteImpulseJoint(rawSet, bodySet, handle);\n case RawJointType.Prismatic:\n return new PrismaticImpulseJoint(rawSet, bodySet, handle);\n case RawJointType.Fixed:\n return new FixedImpulseJoint(rawSet, bodySet, handle);\n case RawJointType.Spring:\n return new SpringImpulseJoint(rawSet, bodySet, handle);\n case RawJointType.Rope:\n return new RopeImpulseJoint(rawSet, bodySet, handle);\n default:\n return new ImpulseJoint(rawSet, bodySet, handle);\n }\n }\n\n /** @internal */\n public finalizeDeserialization(bodySet: RigidBodySet) {\n this.bodySet = bodySet;\n }\n\n /**\n * Checks if this joint is still valid (i.e. that it has\n * not been deleted from the joint set yet).\n */\n public isValid(): boolean {\n return this.rawSet.contains(this.handle);\n }\n\n /**\n * The first rigid-body this joint it attached to.\n */\n public body1(): RigidBody {\n return this.bodySet.get(this.rawSet.jointBodyHandle1(this.handle));\n }\n\n /**\n * The second rigid-body this joint is attached to.\n */\n public body2(): RigidBody {\n return this.bodySet.get(this.rawSet.jointBodyHandle2(this.handle));\n }\n\n /**\n * The type of this joint given as a string.\n */\n public type(): JointType {\n return this.rawSet.jointType(this.handle) as number as JointType;\n }\n\n\n\n /**\n * The position of the first anchor of this joint.\n *\n * The first anchor gives the position of the application point on the\n * local frame of the first rigid-body it is attached to.\n */\n public anchor1(): Vector {\n return VectorOps.fromRaw(this.rawSet.jointAnchor1(this.handle));\n }\n\n /**\n * The position of the second anchor of this joint.\n *\n * The second anchor gives the position of the application point on the\n * local frame of the second rigid-body it is attached to.\n */\n public anchor2(): Vector {\n return VectorOps.fromRaw(this.rawSet.jointAnchor2(this.handle));\n }\n\n /**\n * Sets the position of the first anchor of this joint.\n *\n * The first anchor gives the position of the application point on the\n * local frame of the first rigid-body it is attached to.\n */\n public setAnchor1(newPos: Vector) {\n const rawPoint = VectorOps.intoRaw(newPos);\n this.rawSet.jointSetAnchor1(this.handle, rawPoint);\n rawPoint.free();\n }\n\n /**\n * Sets the position of the second anchor of this joint.\n *\n * The second anchor gives the position of the application point on the\n * local frame of the second rigid-body it is attached to.\n */\n public setAnchor2(newPos: Vector) {\n const rawPoint = VectorOps.intoRaw(newPos);\n this.rawSet.jointSetAnchor2(this.handle, rawPoint);\n rawPoint.free();\n }\n\n /**\n * Controls whether contacts are computed between colliders attached\n * to the rigid-bodies linked by this joint.\n */\n public setContactsEnabled(enabled: boolean) {\n this.rawSet.jointSetContactsEnabled(this.handle, enabled);\n }\n\n /**\n * Indicates if contacts are enabled between colliders attached\n * to the rigid-bodies linked by this joint.\n */\n public contactsEnabled(): boolean {\n return this.rawSet.jointContactsEnabled(this.handle);\n }\n}\n\nexport class UnitImpulseJoint extends ImpulseJoint {\n /**\n * The axis left free by this joint.\n */\n protected rawAxis?(): RawJointAxis;\n\n /**\n * Are the limits enabled for this joint?\n */\n public limitsEnabled(): boolean {\n return this.rawSet.jointLimitsEnabled(this.handle, this.rawAxis());\n }\n\n /**\n * The min limit of this joint.\n */\n public limitsMin(): number {\n return this.rawSet.jointLimitsMin(this.handle, this.rawAxis());\n }\n\n /**\n * The max limit of this joint.\n */\n public limitsMax(): number {\n return this.rawSet.jointLimitsMax(this.handle, this.rawAxis());\n }\n\n /**\n * Sets the limits of this joint.\n *\n * @param min - The minimum bound of this joint’s free coordinate.\n * @param max - The maximum bound of this joint’s free coordinate.\n */\n public setLimits(min: number, max: number) {\n this.rawSet.jointSetLimits(this.handle, this.rawAxis(), min, max);\n }\n\n public configureMotorModel(model: MotorModel) {\n this.rawSet.jointConfigureMotorModel(\n this.handle,\n this.rawAxis(),\n model as number as RawMotorModel,\n );\n }\n\n public configureMotorVelocity(targetVel: number, factor: number) {\n this.rawSet.jointConfigureMotorVelocity(\n this.handle,\n this.rawAxis(),\n targetVel,\n factor,\n );\n }\n\n public configureMotorPosition(\n targetPos: number,\n stiffness: number,\n damping: number,\n ) {\n this.rawSet.jointConfigureMotorPosition(\n this.handle,\n this.rawAxis(),\n targetPos,\n stiffness,\n damping,\n );\n }\n\n public configureMotor(\n targetPos: number,\n targetVel: number,\n stiffness: number,\n damping: number,\n ) {\n this.rawSet.jointConfigureMotor(\n this.handle,\n this.rawAxis(),\n targetPos,\n targetVel,\n stiffness,\n damping,\n );\n }\n}\n\nexport class FixedImpulseJoint extends ImpulseJoint {}\n\nexport class RopeImpulseJoint extends ImpulseJoint {}\n\nexport class SpringImpulseJoint extends ImpulseJoint {}\n\nexport class PrismaticImpulseJoint extends UnitImpulseJoint {\n public rawAxis(): RawJointAxis {\n return RawJointAxis.X;\n }\n}\n\nexport class RevoluteImpulseJoint extends UnitImpulseJoint {\n public rawAxis(): RawJointAxis {\n return RawJointAxis.AngX;\n }\n}\n\n\nexport class JointData {\n anchor1: Vector;\n anchor2: Vector;\n axis: Vector;\n frame1: Rotation;\n frame2: Rotation;\n jointType: JointType;\n limitsEnabled: boolean;\n limits: Array<number>;\n axesMask: JointAxesMask;\n stiffness: number;\n damping: number;\n length: number;\n\n private constructor() {}\n\n /**\n * Creates a new joint descriptor that builds a Fixed joint.\n *\n * A fixed joint removes all the degrees of freedom between the affected bodies, ensuring their\n * anchor and local frames coincide in world-space.\n *\n * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the\n * local-space of the rigid-body.\n * @param frame1 - The reference orientation of the joint wrt. the first rigid-body.\n * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the\n * local-space of the rigid-body.\n * @param frame2 - The reference orientation of the joint wrt. the second rigid-body.\n */\n public static fixed(\n anchor1: Vector,\n frame1: Rotation,\n anchor2: Vector,\n frame2: Rotation,\n ): JointData {\n let res = new JointData();\n res.anchor1 = anchor1;\n res.anchor2 = anchor2;\n res.frame1 = frame1;\n res.frame2 = frame2;\n res.jointType = JointType.Fixed;\n return res;\n }\n\n public static spring(\n rest_length: number,\n stiffness: number,\n damping: number,\n anchor1: Vector,\n anchor2: Vector,\n ): JointData {\n let res = new JointData();\n res.anchor1 = anchor1;\n res.anchor2 = anchor2;\n res.length = rest_length;\n res.stiffness = stiffness;\n res.damping = damping;\n res.jointType = JointType.Spring;\n return res;\n }\n\n public static rope(\n length: number,\n anchor1: Vector,\n anchor2: Vector,\n ): JointData {\n let res = new JointData();\n res.anchor1 = anchor1;\n res.anchor2 = anchor2;\n res.length = length;\n res.jointType = JointType.Rope;\n return res;\n }\n\n // #if DIM2\n\n /**\n * Create a new joint descriptor that builds revolute joints.\n *\n * A revolute joint allows three relative rotational degrees of freedom\n * by preventing any relative translation between the anchors of the\n * two attached rigid-bodies.\n *\n * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the\n * local-space of the rigid-body.\n * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the\n * local-space of the rigid-body.\n */\n public static revolute(anchor1: Vector, anchor2: Vector): JointData {\n let res = new JointData();\n res.anchor1 = anchor1;\n res.anchor2 = anchor2;\n res.jointType = JointType.Revolute;\n return res;\n }\n\n /**\n * Creates a new joint descriptor that builds a Prismatic joint.\n *\n * A prismatic joint removes all the degrees of freedom between the\n * affected bodies, except for the translation along one axis.\n *\n * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the\n * local-space of the rigid-body.\n * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the\n * local-space of the rigid-body.\n * @param axis - Axis of the joint, expressed in the local-space of the rigid-bodies it is attached to.\n */\n public static prismatic(\n anchor1: Vector,\n anchor2: Vector,\n axis: Vector,\n ): JointData {\n let res = new JointData();\n res.anchor1 = anchor1;\n res.anchor2 = anchor2;\n res.axis = axis;\n res.jointType = JointType.Prismatic;\n return res;\n }\n\n // #endif\n\n\n public intoRaw(): RawGenericJoint {\n let rawA1 = VectorOps.intoRaw(this.anchor1);\n let rawA2 = VectorOps.intoRaw(this.anchor2);\n let rawAx;\n let result;\n let limitsEnabled = false;\n let limitsMin = 0.0;\n let limitsMax = 0.0;\n\n switch (this.jointType) {\n case JointType.Fixed:\n let rawFra1 = RotationOps.intoRaw(this.frame1);\n let rawFra2 = RotationOps.intoRaw(this.frame2);\n result = RawGenericJoint.fixed(rawA1, rawFra1, rawA2, rawFra2);\n rawFra1.free();\n rawFra2.free();\n break;\n case JointType.Spring:\n result = RawGenericJoint.spring(\n this.length,\n this.stiffness,\n this.damping,\n rawA1,\n rawA2,\n );\n break;\n case JointType.Rope:\n result = RawGenericJoint.rope(this.length, rawA1, rawA2);\n break;\n case JointType.Prismatic:\n rawAx = VectorOps.intoRaw(this.axis);\n\n if (!!this.limitsEnabled) {\n limitsEnabled = true;\n limitsMin = this.limits[0];\n limitsMax = this.limits[1];\n }\n\n // #if DIM2\n result = RawGenericJoint.prismatic(\n rawA1,\n rawA2,\n rawAx,\n limitsEnabled,\n limitsMin,\n limitsMax,\n );\n // #endif\n\n\n rawAx.free();\n break;\n // #if DIM2\n case JointType.Revolute:\n result = RawGenericJoint.revolute(rawA1, rawA2);\n break;\n // #endif\n }\n\n rawA1.free();\n rawA2.free();\n\n return result;\n }\n}\n", "import {RawImpulseJointSet} from \"../raw\";\nimport {Coarena} from \"../coarena\";\nimport {RigidBodySet} from \"./rigid_body_set\";\nimport {\n RevoluteImpulseJoint,\n FixedImpulseJoint,\n ImpulseJoint,\n ImpulseJointHandle,\n JointData,\n JointType,\n PrismaticImpulseJoint,\n} from \"./impulse_joint\";\nimport {IslandManager} from \"./island_manager\";\nimport {RigidBodyHandle} from \"./rigid_body\";\nimport {Collider, ColliderHandle} from \"../geometry\";\n\n/**\n * A set of joints.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `jointSet.free()`\n * once you are done using it (and all the joints it created).\n */\nexport class ImpulseJointSet {\n raw: RawImpulseJointSet;\n private map: Coarena<ImpulseJoint>;\n\n /**\n * Release the WASM memory occupied by this joint set.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n\n if (!!this.map) {\n this.map.clear();\n }\n this.map = undefined;\n }\n\n constructor(raw?: RawImpulseJointSet) {\n this.raw = raw || new RawImpulseJointSet();\n this.map = new Coarena<ImpulseJoint>();\n // Initialize the map with the existing elements, if any.\n if (raw) {\n raw.forEachJointHandle((handle: ImpulseJointHandle) => {\n this.map.set(handle, ImpulseJoint.newTyped(raw, null, handle));\n });\n }\n }\n\n /** @internal */\n public finalizeDeserialization(bodies: RigidBodySet) {\n this.map.forEach((joint) => joint.finalizeDeserialization(bodies));\n }\n\n /**\n * Creates a new joint and return its integer handle.\n *\n * @param bodies - The set of rigid-bodies containing the bodies the joint is attached to.\n * @param desc - The joint's parameters.\n * @param parent1 - The handle of the first rigid-body this joint is attached to.\n * @param parent2 - The handle of the second rigid-body this joint is attached to.\n * @param wakeUp - Should the attached rigid-bodies be awakened?\n */\n public createJoint(\n bodies: RigidBodySet,\n desc: JointData,\n parent1: RigidBodyHandle,\n parent2: RigidBodyHandle,\n wakeUp: boolean,\n ): ImpulseJoint {\n const rawParams = desc.intoRaw();\n const handle = this.raw.createJoint(\n rawParams,\n parent1,\n parent2,\n wakeUp,\n );\n rawParams.free();\n let joint = ImpulseJoint.newTyped(this.raw, bodies, handle);\n this.map.set(handle, joint);\n return joint;\n }\n\n /**\n * Remove a joint from this set.\n *\n * @param handle - The integer handle of the joint.\n * @param wakeUp - If `true`, the rigid-bodies attached by the removed joint will be woken-up automatically.\n */\n public remove(handle: ImpulseJointHandle, wakeUp: boolean) {\n this.raw.remove(handle, wakeUp);\n this.unmap(handle);\n }\n\n /**\n * Calls the given closure with the integer handle of each impulse joint attached to this rigid-body.\n *\n * @param f - The closure called with the integer handle of each impulse joint attached to the rigid-body.\n */\n public forEachJointHandleAttachedToRigidBody(\n handle: RigidBodyHandle,\n f: (handle: ImpulseJointHandle) => void,\n ) {\n this.raw.forEachJointAttachedToRigidBody(handle, f);\n }\n\n /**\n * Internal function, do not call directly.\n * @param handle\n */\n public unmap(handle: ImpulseJointHandle) {\n this.map.delete(handle);\n }\n\n /**\n * The number of joints on this set.\n */\n public len(): number {\n return this.map.len();\n }\n\n /**\n * Does this set contain a joint with the given handle?\n *\n * @param handle - The joint handle to check.\n */\n public contains(handle: ImpulseJointHandle): boolean {\n return this.get(handle) != null;\n }\n\n /**\n * Gets the joint with the given handle.\n *\n * Returns `null` if no joint with the specified handle exists.\n *\n * @param handle - The integer handle of the joint to retrieve.\n */\n public get(handle: ImpulseJointHandle): ImpulseJoint | null {\n return this.map.get(handle);\n }\n\n /**\n * Applies the given closure to each joint contained by this set.\n *\n * @param f - The closure to apply.\n */\n public forEach(f: (joint: ImpulseJoint) => void) {\n this.map.forEach(f);\n }\n\n /**\n * Gets all joints in the list.\n *\n * @returns joint list.\n */\n public getAll(): ImpulseJoint[] {\n return this.map.getAll();\n }\n}\n", "import {\n RawImpulseJointSet,\n RawJointAxis,\n RawJointType,\n RawMultibodyJointSet,\n} from \"../raw\";\nimport {\n FixedImpulseJoint,\n ImpulseJointHandle,\n JointType,\n MotorModel,\n PrismaticImpulseJoint,\n RevoluteImpulseJoint,\n} from \"./impulse_joint\";\n\n\n/**\n * The integer identifier of a collider added to a `ColliderSet`.\n */\nexport type MultibodyJointHandle = number;\n\nexport class MultibodyJoint {\n protected rawSet: RawMultibodyJointSet; // The MultibodyJoint won't need to free this.\n handle: MultibodyJointHandle;\n\n constructor(rawSet: RawMultibodyJointSet, handle: MultibodyJointHandle) {\n this.rawSet = rawSet;\n this.handle = handle;\n }\n\n public static newTyped(\n rawSet: RawMultibodyJointSet,\n handle: MultibodyJointHandle,\n ): MultibodyJoint {\n switch (rawSet.jointType(handle)) {\n case RawJointType.Revolute:\n return new RevoluteMultibodyJoint(rawSet, handle);\n case RawJointType.Prismatic:\n return new PrismaticMultibodyJoint(rawSet, handle);\n case RawJointType.Fixed:\n return new FixedMultibodyJoint(rawSet, handle);\n default:\n return new MultibodyJoint(rawSet, handle);\n }\n }\n\n /**\n * Checks if this joint is still valid (i.e. that it has\n * not been deleted from the joint set yet).\n */\n public isValid(): boolean {\n return this.rawSet.contains(this.handle);\n }\n\n // /**\n // * The unique integer identifier of the first rigid-body this joint it attached to.\n // */\n // public bodyHandle1(): RigidBodyHandle {\n // return this.rawSet.jointBodyHandle1(this.handle);\n // }\n //\n // /**\n // * The unique integer identifier of the second rigid-body this joint is attached to.\n // */\n // public bodyHandle2(): RigidBodyHandle {\n // return this.rawSet.jointBodyHandle2(this.handle);\n // }\n //\n // /**\n // * The type of this joint given as a string.\n // */\n // public type(): JointType {\n // return this.rawSet.jointType(this.handle);\n // }\n //\n //\n //\n // /**\n // * The position of the first anchor of this joint.\n // *\n // * The first anchor gives the position of the points application point on the\n // * local frame of the first rigid-body it is attached to.\n // */\n // public anchor1(): Vector {\n // return VectorOps.fromRaw(this.rawSet.jointAnchor1(this.handle));\n // }\n //\n // /**\n // * The position of the second anchor of this joint.\n // *\n // * The second anchor gives the position of the points application point on the\n // * local frame of the second rigid-body it is attached to.\n // */\n // public anchor2(): Vector {\n // return VectorOps.fromRaw(this.rawSet.jointAnchor2(this.handle));\n // }\n\n /**\n * Controls whether contacts are computed between colliders attached\n * to the rigid-bodies linked by this joint.\n */\n public setContactsEnabled(enabled: boolean) {\n this.rawSet.jointSetContactsEnabled(this.handle, enabled);\n }\n\n /**\n * Indicates if contacts are enabled between colliders attached\n * to the rigid-bodies linked by this joint.\n */\n public contactsEnabled(): boolean {\n return this.rawSet.jointContactsEnabled(this.handle);\n }\n}\n\nexport class UnitMultibodyJoint extends MultibodyJoint {\n /**\n * The axis left free by this joint.\n */\n protected rawAxis?(): RawJointAxis;\n\n // /**\n // * Are the limits enabled for this joint?\n // */\n // public limitsEnabled(): boolean {\n // return this.rawSet.jointLimitsEnabled(this.handle, this.rawAxis());\n // }\n //\n // /**\n // * The min limit of this joint.\n // */\n // public limitsMin(): number {\n // return this.rawSet.jointLimitsMin(this.handle, this.rawAxis());\n // }\n //\n // /**\n // * The max limit of this joint.\n // */\n // public limitsMax(): number {\n // return this.rawSet.jointLimitsMax(this.handle, this.rawAxis());\n // }\n //\n // public configureMotorModel(model: MotorModel) {\n // this.rawSet.jointConfigureMotorModel(this.handle, this.rawAxis(), model);\n // }\n //\n // public configureMotorVelocity(targetVel: number, factor: number) {\n // this.rawSet.jointConfigureMotorVelocity(this.handle, this.rawAxis(), targetVel, factor);\n // }\n //\n // public configureMotorPosition(targetPos: number, stiffness: number, damping: number) {\n // this.rawSet.jointConfigureMotorPosition(this.handle, this.rawAxis(), targetPos, stiffness, damping);\n // }\n //\n // public configureMotor(targetPos: number, targetVel: number, stiffness: number, damping: number) {\n // this.rawSet.jointConfigureMotor(this.handle, this.rawAxis(), targetPos, targetVel, stiffness, damping);\n // }\n}\n\nexport class FixedMultibodyJoint extends MultibodyJoint {}\n\nexport class PrismaticMultibodyJoint extends UnitMultibodyJoint {\n public rawAxis(): RawJointAxis {\n return RawJointAxis.X;\n }\n}\n\nexport class RevoluteMultibodyJoint extends UnitMultibodyJoint {\n public rawAxis(): RawJointAxis {\n return RawJointAxis.AngX;\n }\n}\n\n", "import {RawMultibodyJointSet} from \"../raw\";\nimport {Coarena} from \"../coarena\";\nimport {RigidBodySet} from \"./rigid_body_set\";\nimport {\n MultibodyJoint,\n MultibodyJointHandle,\n RevoluteMultibodyJoint,\n FixedMultibodyJoint,\n PrismaticMultibodyJoint,\n} from \"./multibody_joint\";\nimport {ImpulseJointHandle, JointData, JointType} from \"./impulse_joint\";\nimport {IslandManager} from \"./island_manager\";\nimport {ColliderHandle} from \"../geometry\";\nimport {RigidBodyHandle} from \"./rigid_body\";\n\n/**\n * A set of joints.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `jointSet.free()`\n * once you are done using it (and all the joints it created).\n */\nexport class MultibodyJointSet {\n raw: RawMultibodyJointSet;\n private map: Coarena<MultibodyJoint>;\n\n /**\n * Release the WASM memory occupied by this joint set.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n\n if (!!this.map) {\n this.map.clear();\n }\n this.map = undefined;\n }\n\n constructor(raw?: RawMultibodyJointSet) {\n this.raw = raw || new RawMultibodyJointSet();\n this.map = new Coarena<MultibodyJoint>();\n // Initialize the map with the existing elements, if any.\n if (raw) {\n raw.forEachJointHandle((handle: MultibodyJointHandle) => {\n this.map.set(handle, MultibodyJoint.newTyped(this.raw, handle));\n });\n }\n }\n\n /**\n * Creates a new joint and return its integer handle.\n *\n * @param desc - The joint's parameters.\n * @param parent1 - The handle of the first rigid-body this joint is attached to.\n * @param parent2 - The handle of the second rigid-body this joint is attached to.\n * @param wakeUp - Should the attached rigid-bodies be awakened?\n */\n public createJoint(\n desc: JointData,\n parent1: RigidBodyHandle,\n parent2: RigidBodyHandle,\n wakeUp: boolean,\n ): MultibodyJoint {\n const rawParams = desc.intoRaw();\n const handle = this.raw.createJoint(\n rawParams,\n parent1,\n parent2,\n wakeUp,\n );\n rawParams.free();\n let joint = MultibodyJoint.newTyped(this.raw, handle);\n this.map.set(handle, joint);\n return joint;\n }\n\n /**\n * Remove a joint from this set.\n *\n * @param handle - The integer handle of the joint.\n * @param wake_up - If `true`, the rigid-bodies attached by the removed joint will be woken-up automatically.\n */\n public remove(handle: MultibodyJointHandle, wake_up: boolean) {\n this.raw.remove(handle, wake_up);\n this.map.delete(handle);\n }\n\n /**\n * Internal function, do not call directly.\n * @param handle\n */\n public unmap(handle: MultibodyJointHandle) {\n this.map.delete(handle);\n }\n\n /**\n * The number of joints on this set.\n */\n public len(): number {\n return this.map.len();\n }\n\n /**\n * Does this set contain a joint with the given handle?\n *\n * @param handle - The joint handle to check.\n */\n public contains(handle: MultibodyJointHandle): boolean {\n return this.get(handle) != null;\n }\n\n /**\n * Gets the joint with the given handle.\n *\n * Returns `null` if no joint with the specified handle exists.\n *\n * @param handle - The integer handle of the joint to retrieve.\n */\n public get(handle: MultibodyJointHandle): MultibodyJoint | null {\n return this.map.get(handle);\n }\n\n /**\n * Applies the given closure to each joint contained by this set.\n *\n * @param f - The closure to apply.\n */\n public forEach(f: (joint: MultibodyJoint) => void) {\n this.map.forEach(f);\n }\n\n /**\n * Calls the given closure with the integer handle of each multibody joint attached to this rigid-body.\n *\n * @param f - The closure called with the integer handle of each multibody joint attached to the rigid-body.\n */\n public forEachJointHandleAttachedToRigidBody(\n handle: RigidBodyHandle,\n f: (handle: MultibodyJointHandle) => void,\n ) {\n this.raw.forEachJointAttachedToRigidBody(handle, f);\n }\n\n /**\n * Gets all joints in the list.\n *\n * @returns joint list.\n */\n public getAll(): MultibodyJoint[] {\n return this.map.getAll();\n }\n}\n", "/**\n * A rule applied to combine coefficients.\n *\n * Use this when configuring the `ColliderDesc` to specify\n * how friction and restitution coefficient should be combined\n * in a contact.\n */\nexport enum CoefficientCombineRule {\n Average = 0,\n Min = 1,\n Multiply = 2,\n Max = 3,\n}\n", "import {RawCCDSolver} from \"../raw\";\n\n/**\n * The CCD solver responsible for resolving Continuous Collision Detection.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `ccdSolver.free()`\n * once you are done using it.\n */\nexport class CCDSolver {\n raw: RawCCDSolver;\n\n /**\n * Release the WASM memory occupied by this narrow-phase.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawCCDSolver) {\n this.raw = raw || new RawCCDSolver();\n }\n}\n", "import {RawIslandManager} from \"../raw\";\nimport {RigidBodyHandle} from \"./rigid_body\";\n\n/**\n * The CCD solver responsible for resolving Continuous Collision Detection.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `ccdSolver.free()`\n * once you are done using it.\n */\nexport class IslandManager {\n raw: RawIslandManager;\n\n /**\n * Release the WASM memory occupied by this narrow-phase.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawIslandManager) {\n this.raw = raw || new RawIslandManager();\n }\n\n /**\n * Applies the given closure to the handle of each active rigid-bodies contained by this set.\n *\n * A rigid-body is active if it is not sleeping, i.e., if it moved recently.\n *\n * @param f - The closure to apply.\n */\n public forEachActiveRigidBodyHandle(f: (handle: RigidBodyHandle) => void) {\n this.raw.forEachActiveRigidBodyHandle(f);\n }\n}\n", "import {RawBroadPhase} from \"../raw\";\n\n/**\n * The broad-phase used for coarse collision-detection.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `broadPhase.free()`\n * once you are done using it.\n */\nexport class BroadPhase {\n raw: RawBroadPhase;\n\n /**\n * Release the WASM memory occupied by this broad-phase.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawBroadPhase) {\n this.raw = raw || new RawBroadPhase();\n }\n}\n", "import {RawNarrowPhase, RawContactManifold} from \"../raw\";\nimport {ColliderHandle} from \"./collider\";\nimport {Vector, VectorOps} from \"../math\";\n\n/**\n * The narrow-phase used for precise collision-detection.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `narrowPhase.free()`\n * once you are done using it.\n */\nexport class NarrowPhase {\n raw: RawNarrowPhase;\n tempManifold: TempContactManifold;\n\n /**\n * Release the WASM memory occupied by this narrow-phase.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawNarrowPhase) {\n this.raw = raw || new RawNarrowPhase();\n this.tempManifold = new TempContactManifold(null);\n }\n\n /**\n * Enumerates all the colliders potentially in contact with the given collider.\n *\n * @param collider1 - The second collider involved in the contact.\n * @param f - Closure that will be called on each collider that is in contact with `collider1`.\n */\n public contactPairsWith(\n collider1: ColliderHandle,\n f: (collider2: ColliderHandle) => void,\n ) {\n this.raw.contact_pairs_with(collider1, f);\n }\n\n /**\n * Enumerates all the colliders intersecting the given colliders, assuming one of them\n * is a sensor.\n */\n public intersectionPairsWith(\n collider1: ColliderHandle,\n f: (collider2: ColliderHandle) => void,\n ) {\n this.raw.intersection_pairs_with(collider1, f);\n }\n\n /**\n * Iterates through all the contact manifolds between the given pair of colliders.\n *\n * @param collider1 - The first collider involved in the contact.\n * @param collider2 - The second collider involved in the contact.\n * @param f - Closure that will be called on each contact manifold between the two colliders. If the second argument\n * passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1`\n * actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`.\n */\n public contactPair(\n collider1: ColliderHandle,\n collider2: ColliderHandle,\n f: (manifold: TempContactManifold, flipped: boolean) => void,\n ) {\n const rawPair = this.raw.contact_pair(collider1, collider2);\n\n if (!!rawPair) {\n const flipped = rawPair.collider1() != collider1;\n\n let i;\n for (i = 0; i < rawPair.numContactManifolds(); ++i) {\n this.tempManifold.raw = rawPair.contactManifold(i);\n if (!!this.tempManifold.raw) {\n f(this.tempManifold, flipped);\n }\n\n // SAFETY: The RawContactManifold stores a raw pointer that will be invalidated\n // at the next timestep. So we must be sure to free the pair here\n // to avoid unsoundness in the Rust code.\n this.tempManifold.free();\n }\n rawPair.free();\n }\n }\n\n /**\n * Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor.\n * @param collider1 − The first collider involved in the intersection.\n * @param collider2 − The second collider involved in the intersection.\n */\n public intersectionPair(\n collider1: ColliderHandle,\n collider2: ColliderHandle,\n ): boolean {\n return this.raw.intersection_pair(collider1, collider2);\n }\n}\n\nexport class TempContactManifold {\n raw: RawContactManifold;\n\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw: RawContactManifold) {\n this.raw = raw;\n }\n\n public normal(): Vector {\n return VectorOps.fromRaw(this.raw.normal());\n }\n\n public localNormal1(): Vector {\n return VectorOps.fromRaw(this.raw.local_n1());\n }\n\n public localNormal2(): Vector {\n return VectorOps.fromRaw(this.raw.local_n2());\n }\n\n public subshape1(): number {\n return this.raw.subshape1();\n }\n\n public subshape2(): number {\n return this.raw.subshape2();\n }\n\n public numContacts(): number {\n return this.raw.num_contacts();\n }\n\n public localContactPoint1(i: number): Vector | null {\n return VectorOps.fromRaw(this.raw.contact_local_p1(i));\n }\n\n public localContactPoint2(i: number): Vector | null {\n return VectorOps.fromRaw(this.raw.contact_local_p2(i));\n }\n\n public contactDist(i: number): number {\n return this.raw.contact_dist(i);\n }\n\n public contactFid1(i: number): number {\n return this.raw.contact_fid1(i);\n }\n\n public contactFid2(i: number): number {\n return this.raw.contact_fid2(i);\n }\n\n public contactImpulse(i: number): number {\n return this.raw.contact_impulse(i);\n }\n\n // #if DIM2\n public contactTangentImpulse(i: number): number {\n return this.raw.contact_tangent_impulse(i);\n }\n // #endif\n\n\n public numSolverContacts(): number {\n return this.raw.num_solver_contacts();\n }\n\n public solverContactPoint(i: number): Vector {\n return VectorOps.fromRaw(this.raw.solver_contact_point(i));\n }\n\n public solverContactDist(i: number): number {\n return this.raw.solver_contact_dist(i);\n }\n\n public solverContactFriction(i: number): number {\n return this.raw.solver_contact_friction(i);\n }\n\n public solverContactRestitution(i: number): number {\n return this.raw.solver_contact_restitution(i);\n }\n\n public solverContactTangentVelocity(i: number): Vector {\n return VectorOps.fromRaw(this.raw.solver_contact_tangent_velocity(i));\n }\n}\n", "import {Vector, VectorOps} from \"../math\";\nimport {RawShapeContact} from \"../raw\";\n\n/**\n * The contact info between two shapes.\n */\nexport class ShapeContact {\n /**\n * Distance between the two contact points.\n * If this is negative, this contact represents a penetration.\n */\n distance: number;\n\n /**\n * Position of the contact on the first shape.\n */\n point1: Vector;\n\n /**\n * Position of the contact on the second shape.\n */\n point2: Vector;\n\n /**\n * Contact normal, pointing towards the exterior of the first shape.\n */\n normal1: Vector;\n\n /**\n * Contact normal, pointing towards the exterior of the second shape.\n * If these contact data are expressed in world-space, this normal is equal to -normal1.\n */\n normal2: Vector;\n\n constructor(\n dist: number,\n point1: Vector,\n point2: Vector,\n normal1: Vector,\n normal2: Vector,\n ) {\n this.distance = dist;\n this.point1 = point1;\n this.point2 = point2;\n this.normal1 = normal1;\n this.normal2 = normal2;\n }\n\n public static fromRaw(raw: RawShapeContact): ShapeContact {\n if (!raw) return null;\n\n const result = new ShapeContact(\n raw.distance(),\n VectorOps.fromRaw(raw.point1()),\n VectorOps.fromRaw(raw.point2()),\n VectorOps.fromRaw(raw.normal1()),\n VectorOps.fromRaw(raw.normal2()),\n );\n raw.free();\n return result;\n }\n}\n", "// #if DIM2\nexport enum FeatureType {\n Vertex,\n Face,\n Unknown,\n}\n// #endif\n\n", "import {Collider, ColliderHandle} from \"./collider\";\nimport {Vector, VectorOps} from \"../math\";\nimport {\n RawFeatureType,\n RawPointColliderProjection,\n RawPointProjection,\n} from \"../raw\";\nimport {FeatureType} from \"./feature\";\nimport {ColliderSet} from \"./collider_set\";\n\n/**\n * The projection of a point on a collider.\n */\nexport class PointProjection {\n /**\n * The projection of the point on the collider.\n */\n point: Vector;\n /**\n * Is the point inside of the collider?\n */\n isInside: boolean;\n\n constructor(point: Vector, isInside: boolean) {\n this.point = point;\n this.isInside = isInside;\n }\n\n public static fromRaw(raw: RawPointProjection): PointProjection {\n if (!raw) return null;\n\n const result = new PointProjection(\n VectorOps.fromRaw(raw.point()),\n raw.isInside(),\n );\n raw.free();\n return result;\n }\n}\n\n/**\n * The projection of a point on a collider (includes the collider handle).\n */\nexport class PointColliderProjection {\n /**\n * The collider hit by the ray.\n */\n collider: Collider;\n /**\n * The projection of the point on the collider.\n */\n point: Vector;\n /**\n * Is the point inside of the collider?\n */\n isInside: boolean;\n\n /**\n * The type of the geometric feature the point was projected on.\n */\n featureType = FeatureType.Unknown;\n\n /**\n * The id of the geometric feature the point was projected on.\n */\n featureId: number | undefined = undefined;\n\n constructor(\n collider: Collider,\n point: Vector,\n isInside: boolean,\n featureType?: FeatureType,\n featureId?: number,\n ) {\n this.collider = collider;\n this.point = point;\n this.isInside = isInside;\n if (featureId !== undefined) this.featureId = featureId;\n if (featureType !== undefined) this.featureType = featureType;\n }\n\n public static fromRaw(\n colliderSet: ColliderSet,\n raw: RawPointColliderProjection,\n ): PointColliderProjection {\n if (!raw) return null;\n\n const result = new PointColliderProjection(\n colliderSet.get(raw.colliderHandle()),\n VectorOps.fromRaw(raw.point()),\n raw.isInside(),\n raw.featureType() as number as FeatureType,\n raw.featureId(),\n );\n raw.free();\n return result;\n }\n}\n", "import {Vector, VectorOps} from \"../math\";\nimport {\n RawFeatureType,\n RawRayColliderIntersection,\n RawRayColliderHit,\n RawRayIntersection,\n} from \"../raw\";\nimport {Collider} from \"./collider\";\nimport {FeatureType} from \"./feature\";\nimport {ColliderSet} from \"./collider_set\";\n\n/**\n * A ray. This is a directed half-line.\n */\nexport class Ray {\n /**\n * The starting point of the ray.\n */\n public origin: Vector;\n /**\n * The direction of propagation of the ray.\n */\n public dir: Vector;\n\n /**\n * Builds a ray from its origin and direction.\n *\n * @param origin - The ray's starting point.\n * @param dir - The ray's direction of propagation.\n */\n constructor(origin: Vector, dir: Vector) {\n this.origin = origin;\n this.dir = dir;\n }\n\n public pointAt(t: number): Vector {\n return {\n x: this.origin.x + this.dir.x * t,\n y: this.origin.y + this.dir.y * t,\n };\n }\n}\n\n/**\n * The intersection between a ray and a collider.\n */\nexport class RayIntersection {\n /**\n * The time-of-impact of the ray with the collider.\n *\n * The hit point is obtained from the ray's origin and direction: `origin + dir * timeOfImpact`.\n */\n timeOfImpact: number;\n /**\n * The normal of the collider at the hit point.\n */\n normal: Vector;\n\n /**\n * The type of the geometric feature the point was projected on.\n */\n featureType = FeatureType.Unknown;\n\n /**\n * The id of the geometric feature the point was projected on.\n */\n featureId: number | undefined = undefined;\n\n constructor(\n timeOfImpact: number,\n normal: Vector,\n featureType?: FeatureType,\n featureId?: number,\n ) {\n this.timeOfImpact = timeOfImpact;\n this.normal = normal;\n if (featureId !== undefined) this.featureId = featureId;\n if (featureType !== undefined) this.featureType = featureType;\n }\n\n public static fromRaw(raw: RawRayIntersection): RayIntersection {\n if (!raw) return null;\n\n const result = new RayIntersection(\n raw.time_of_impact(),\n VectorOps.fromRaw(raw.normal()),\n raw.featureType() as number as FeatureType,\n raw.featureId(),\n );\n raw.free();\n return result;\n }\n}\n\n/**\n * The intersection between a ray and a collider (includes the collider handle).\n */\nexport class RayColliderIntersection {\n /**\n * The collider hit by the ray.\n */\n collider: Collider;\n /**\n * The time-of-impact of the ray with the collider.\n *\n * The hit point is obtained from the ray's origin and direction: `origin + dir * timeOfImpact`.\n */\n timeOfImpact: number;\n /**\n * The normal of the collider at the hit point.\n */\n normal: Vector;\n\n /**\n * The type of the geometric feature the point was projected on.\n */\n featureType = FeatureType.Unknown;\n\n /**\n * The id of the geometric feature the point was projected on.\n */\n featureId: number | undefined = undefined;\n\n constructor(\n collider: Collider,\n timeOfImpact: number,\n normal: Vector,\n featureType?: FeatureType,\n featureId?: number,\n ) {\n this.collider = collider;\n this.timeOfImpact = timeOfImpact;\n this.normal = normal;\n if (featureId !== undefined) this.featureId = featureId;\n if (featureType !== undefined) this.featureType = featureType;\n }\n\n public static fromRaw(\n colliderSet: ColliderSet,\n raw: RawRayColliderIntersection,\n ): RayColliderIntersection {\n if (!raw) return null;\n\n const result = new RayColliderIntersection(\n colliderSet.get(raw.colliderHandle()),\n raw.time_of_impact(),\n VectorOps.fromRaw(raw.normal()),\n raw.featureType() as number as FeatureType,\n raw.featureId(),\n );\n raw.free();\n return result;\n }\n}\n\n/**\n * The time of impact between a ray and a collider.\n */\nexport class RayColliderHit {\n /**\n * The handle of the collider hit by the ray.\n */\n collider: Collider;\n /**\n * The time-of-impact of the ray with the collider.\n *\n * The hit point is obtained from the ray's origin and direction: `origin + dir * timeOfImpact`.\n */\n timeOfImpact: number;\n\n constructor(collider: Collider, timeOfImpact: number) {\n this.collider = collider;\n this.timeOfImpact = timeOfImpact;\n }\n\n public static fromRaw(\n colliderSet: ColliderSet,\n raw: RawRayColliderHit,\n ): RayColliderHit {\n if (!raw) return null;\n\n const result = new RayColliderHit(\n colliderSet.get(raw.colliderHandle()),\n raw.timeOfImpact(),\n );\n raw.free();\n return result;\n }\n}\n", "import {Collider} from \"./collider\";\nimport {Vector, VectorOps} from \"../math\";\nimport {RawShapeCastHit, RawColliderShapeCastHit} from \"../raw\";\nimport {ColliderSet} from \"./collider_set\";\n\n/**\n * The intersection between a ray and a collider.\n */\nexport class ShapeCastHit {\n /**\n * The time of impact of the two shapes.\n */\n time_of_impact: number;\n /**\n * The local-space contact point on the first shape, at\n * the time of impact.\n */\n witness1: Vector;\n /**\n * The local-space contact point on the second shape, at\n * the time of impact.\n */\n witness2: Vector;\n /**\n * The local-space normal on the first shape, at\n * the time of impact.\n */\n normal1: Vector;\n /**\n * The local-space normal on the second shape, at\n * the time of impact.\n */\n normal2: Vector;\n\n constructor(\n time_of_impact: number,\n witness1: Vector,\n witness2: Vector,\n normal1: Vector,\n normal2: Vector,\n ) {\n this.time_of_impact = time_of_impact;\n this.witness1 = witness1;\n this.witness2 = witness2;\n this.normal1 = normal1;\n this.normal2 = normal2;\n }\n\n public static fromRaw(\n colliderSet: ColliderSet,\n raw: RawShapeCastHit,\n ): ShapeCastHit {\n if (!raw) return null;\n\n const result = new ShapeCastHit(\n raw.time_of_impact(),\n VectorOps.fromRaw(raw.witness1()),\n VectorOps.fromRaw(raw.witness2()),\n VectorOps.fromRaw(raw.normal1()),\n VectorOps.fromRaw(raw.normal2()),\n );\n raw.free();\n return result;\n }\n}\n\n/**\n * The intersection between a ray and a collider.\n */\nexport class ColliderShapeCastHit extends ShapeCastHit {\n /**\n * The handle of the collider hit by the ray.\n */\n collider: Collider;\n\n constructor(\n collider: Collider,\n time_of_impact: number,\n witness1: Vector,\n witness2: Vector,\n normal1: Vector,\n normal2: Vector,\n ) {\n super(time_of_impact, witness1, witness2, normal1, normal2);\n this.collider = collider;\n }\n\n public static fromRaw(\n colliderSet: ColliderSet,\n raw: RawColliderShapeCastHit,\n ): ColliderShapeCastHit {\n if (!raw) return null;\n\n const result = new ColliderShapeCastHit(\n colliderSet.get(raw.colliderHandle()),\n raw.time_of_impact(),\n VectorOps.fromRaw(raw.witness1()),\n VectorOps.fromRaw(raw.witness2()),\n VectorOps.fromRaw(raw.normal1()),\n VectorOps.fromRaw(raw.normal2()),\n );\n raw.free();\n return result;\n }\n}\n", "import {Vector, VectorOps, Rotation, RotationOps} from \"../math\";\nimport {RawColliderSet, RawShape, RawShapeType} from \"../raw\";\nimport {ShapeContact} from \"./contact\";\nimport {PointProjection} from \"./point\";\nimport {Ray, RayIntersection} from \"./ray\";\nimport {ShapeCastHit} from \"./toi\";\nimport {ColliderHandle} from \"./collider\";\n\nexport abstract class Shape {\n public abstract intoRaw(): RawShape;\n\n /**\n * The concrete type of this shape.\n */\n public abstract get type(): ShapeType;\n\n /**\n * instant mode without cache\n */\n public static fromRaw(\n rawSet: RawColliderSet,\n handle: ColliderHandle,\n ): Shape {\n const rawType = rawSet.coShapeType(handle);\n\n let extents: Vector;\n let borderRadius: number;\n let vs: Float32Array;\n let indices: Uint32Array;\n let halfHeight: number;\n let radius: number;\n let normal: Vector;\n\n switch (rawType) {\n case RawShapeType.Ball:\n return new Ball(rawSet.coRadius(handle));\n case RawShapeType.Cuboid:\n extents = rawSet.coHalfExtents(handle);\n // #if DIM2\n return new Cuboid(extents.x, extents.y);\n // #endif\n\n\n case RawShapeType.RoundCuboid:\n extents = rawSet.coHalfExtents(handle);\n borderRadius = rawSet.coRoundRadius(handle);\n\n // #if DIM2\n return new RoundCuboid(extents.x, extents.y, borderRadius);\n // #endif\n\n\n case RawShapeType.Capsule:\n halfHeight = rawSet.coHalfHeight(handle);\n radius = rawSet.coRadius(handle);\n return new Capsule(halfHeight, radius);\n case RawShapeType.Segment:\n vs = rawSet.coVertices(handle);\n\n // #if DIM2\n return new Segment(\n VectorOps.new(vs[0], vs[1]),\n VectorOps.new(vs[2], vs[3]),\n );\n // #endif\n\n\n case RawShapeType.Polyline:\n vs = rawSet.coVertices(handle);\n indices = rawSet.coIndices(handle);\n return new Polyline(vs, indices);\n case RawShapeType.Triangle:\n vs = rawSet.coVertices(handle);\n\n // #if DIM2\n return new Triangle(\n VectorOps.new(vs[0], vs[1]),\n VectorOps.new(vs[2], vs[3]),\n VectorOps.new(vs[4], vs[5]),\n );\n // #endif\n\n\n case RawShapeType.RoundTriangle:\n vs = rawSet.coVertices(handle);\n borderRadius = rawSet.coRoundRadius(handle);\n\n // #if DIM2\n return new RoundTriangle(\n VectorOps.new(vs[0], vs[1]),\n VectorOps.new(vs[2], vs[3]),\n VectorOps.new(vs[4], vs[5]),\n borderRadius,\n );\n // #endif\n\n\n case RawShapeType.HalfSpace:\n normal = VectorOps.fromRaw(rawSet.coHalfspaceNormal(handle));\n return new HalfSpace(normal);\n\n case RawShapeType.TriMesh:\n vs = rawSet.coVertices(handle);\n indices = rawSet.coIndices(handle);\n const tri_flags = rawSet.coTriMeshFlags(handle);\n return new TriMesh(vs, indices, tri_flags);\n\n case RawShapeType.HeightField:\n const scale = rawSet.coHeightfieldScale(handle);\n const heights = rawSet.coHeightfieldHeights(handle);\n\n // #if DIM2\n return new Heightfield(heights, scale);\n // #endif\n\n\n // #if DIM2\n case RawShapeType.ConvexPolygon:\n vs = rawSet.coVertices(handle);\n return new ConvexPolygon(vs, false);\n case RawShapeType.RoundConvexPolygon:\n vs = rawSet.coVertices(handle);\n borderRadius = rawSet.coRoundRadius(handle);\n return new RoundConvexPolygon(vs, borderRadius, false);\n // #endif\n\n\n default:\n throw new Error(\"unknown shape type: \" + rawType);\n }\n }\n\n /**\n * Computes the time of impact between two moving shapes.\n * @param shapePos1 - The initial position of this sahpe.\n * @param shapeRot1 - The rotation of this shape.\n * @param shapeVel1 - The velocity of this shape.\n * @param shape2 - The second moving shape.\n * @param shapePos2 - The initial position of the second shape.\n * @param shapeRot2 - The rotation of the second shape.\n * @param shapeVel2 - The velocity of the second shape.\n * @param targetDistance − If the shape moves closer to this distance from a collider, a hit\n * will be returned.\n * @param maxToi - The maximum time when the impact can happen.\n * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if\n * the shape is penetrating another shape at its starting point **and** its trajectory is such\n * that it’s on a path to exist that penetration state.\n * @returns If the two moving shapes collider at some point along their trajectories, this returns the\n * time at which the two shape collider as well as the contact information during the impact. Returns\n * `null`if the two shapes never collide along their paths.\n */\n public castShape(\n shapePos1: Vector,\n shapeRot1: Rotation,\n shapeVel1: Vector,\n shape2: Shape,\n shapePos2: Vector,\n shapeRot2: Rotation,\n shapeVel2: Vector,\n targetDistance: number,\n maxToi: number,\n stopAtPenetration: boolean,\n ): ShapeCastHit | null {\n let rawPos1 = VectorOps.intoRaw(shapePos1);\n let rawRot1 = RotationOps.intoRaw(shapeRot1);\n let rawVel1 = VectorOps.intoRaw(shapeVel1);\n let rawPos2 = VectorOps.intoRaw(shapePos2);\n let rawRot2 = RotationOps.intoRaw(shapeRot2);\n let rawVel2 = VectorOps.intoRaw(shapeVel2);\n\n let rawShape1 = this.intoRaw();\n let rawShape2 = shape2.intoRaw();\n\n let result = ShapeCastHit.fromRaw(\n null,\n rawShape1.castShape(\n rawPos1,\n rawRot1,\n rawVel1,\n rawShape2,\n rawPos2,\n rawRot2,\n rawVel2,\n targetDistance,\n maxToi,\n stopAtPenetration,\n ),\n );\n\n rawPos1.free();\n rawRot1.free();\n rawVel1.free();\n rawPos2.free();\n rawRot2.free();\n rawVel2.free();\n\n rawShape1.free();\n rawShape2.free();\n\n return result;\n }\n\n /**\n * Tests if this shape intersects another shape.\n *\n * @param shapePos1 - The position of this shape.\n * @param shapeRot1 - The rotation of this shape.\n * @param shape2 - The second shape to test.\n * @param shapePos2 - The position of the second shape.\n * @param shapeRot2 - The rotation of the second shape.\n * @returns `true` if the two shapes intersect, `false` if they don’t.\n */\n public intersectsShape(\n shapePos1: Vector,\n shapeRot1: Rotation,\n shape2: Shape,\n shapePos2: Vector,\n shapeRot2: Rotation,\n ): boolean {\n let rawPos1 = VectorOps.intoRaw(shapePos1);\n let rawRot1 = RotationOps.intoRaw(shapeRot1);\n let rawPos2 = VectorOps.intoRaw(shapePos2);\n let rawRot2 = RotationOps.intoRaw(shapeRot2);\n\n let rawShape1 = this.intoRaw();\n let rawShape2 = shape2.intoRaw();\n\n let result = rawShape1.intersectsShape(\n rawPos1,\n rawRot1,\n rawShape2,\n rawPos2,\n rawRot2,\n );\n\n rawPos1.free();\n rawRot1.free();\n rawPos2.free();\n rawRot2.free();\n\n rawShape1.free();\n rawShape2.free();\n\n return result;\n }\n\n /**\n * Computes one pair of contact points between two shapes.\n *\n * @param shapePos1 - The initial position of this sahpe.\n * @param shapeRot1 - The rotation of this shape.\n * @param shape2 - The second shape.\n * @param shapePos2 - The initial position of the second shape.\n * @param shapeRot2 - The rotation of the second shape.\n * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail.\n * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space.\n */\n contactShape(\n shapePos1: Vector,\n shapeRot1: Rotation,\n shape2: Shape,\n shapePos2: Vector,\n shapeRot2: Rotation,\n prediction: number,\n ): ShapeContact | null {\n let rawPos1 = VectorOps.intoRaw(shapePos1);\n let rawRot1 = RotationOps.intoRaw(shapeRot1);\n let rawPos2 = VectorOps.intoRaw(shapePos2);\n let rawRot2 = RotationOps.intoRaw(shapeRot2);\n\n let rawShape1 = this.intoRaw();\n let rawShape2 = shape2.intoRaw();\n\n let result = ShapeContact.fromRaw(\n rawShape1.contactShape(\n rawPos1,\n rawRot1,\n rawShape2,\n rawPos2,\n rawRot2,\n prediction,\n ),\n );\n\n rawPos1.free();\n rawRot1.free();\n rawPos2.free();\n rawRot2.free();\n\n rawShape1.free();\n rawShape2.free();\n\n return result;\n }\n\n containsPoint(\n shapePos: Vector,\n shapeRot: Rotation,\n point: Vector,\n ): boolean {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawPoint = VectorOps.intoRaw(point);\n let rawShape = this.intoRaw();\n\n let result = rawShape.containsPoint(rawPos, rawRot, rawPoint);\n\n rawPos.free();\n rawRot.free();\n rawPoint.free();\n rawShape.free();\n\n return result;\n }\n\n projectPoint(\n shapePos: Vector,\n shapeRot: Rotation,\n point: Vector,\n solid: boolean,\n ): PointProjection {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawPoint = VectorOps.intoRaw(point);\n let rawShape = this.intoRaw();\n\n let result = PointProjection.fromRaw(\n rawShape.projectPoint(rawPos, rawRot, rawPoint, solid),\n );\n\n rawPos.free();\n rawRot.free();\n rawPoint.free();\n rawShape.free();\n\n return result;\n }\n\n intersectsRay(\n ray: Ray,\n shapePos: Vector,\n shapeRot: Rotation,\n maxToi: number,\n ): boolean {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawRayOrig = VectorOps.intoRaw(ray.origin);\n let rawRayDir = VectorOps.intoRaw(ray.dir);\n let rawShape = this.intoRaw();\n\n let result = rawShape.intersectsRay(\n rawPos,\n rawRot,\n rawRayOrig,\n rawRayDir,\n maxToi,\n );\n\n rawPos.free();\n rawRot.free();\n rawRayOrig.free();\n rawRayDir.free();\n rawShape.free();\n\n return result;\n }\n\n castRay(\n ray: Ray,\n shapePos: Vector,\n shapeRot: Rotation,\n maxToi: number,\n solid: boolean,\n ): number {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawRayOrig = VectorOps.intoRaw(ray.origin);\n let rawRayDir = VectorOps.intoRaw(ray.dir);\n let rawShape = this.intoRaw();\n\n let result = rawShape.castRay(\n rawPos,\n rawRot,\n rawRayOrig,\n rawRayDir,\n maxToi,\n solid,\n );\n\n rawPos.free();\n rawRot.free();\n rawRayOrig.free();\n rawRayDir.free();\n rawShape.free();\n\n return result;\n }\n\n castRayAndGetNormal(\n ray: Ray,\n shapePos: Vector,\n shapeRot: Rotation,\n maxToi: number,\n solid: boolean,\n ): RayIntersection {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawRayOrig = VectorOps.intoRaw(ray.origin);\n let rawRayDir = VectorOps.intoRaw(ray.dir);\n let rawShape = this.intoRaw();\n\n let result = RayIntersection.fromRaw(\n rawShape.castRayAndGetNormal(\n rawPos,\n rawRot,\n rawRayOrig,\n rawRayDir,\n maxToi,\n solid,\n ),\n );\n\n rawPos.free();\n rawRot.free();\n rawRayOrig.free();\n rawRayDir.free();\n rawShape.free();\n\n return result;\n }\n}\n\n// #if DIM2\n/**\n * An enumeration representing the type of a shape.\n */\nexport enum ShapeType {\n Ball = 0,\n Cuboid = 1,\n Capsule = 2,\n Segment = 3,\n Polyline = 4,\n Triangle = 5,\n TriMesh = 6,\n HeightField = 7,\n // Compound = 8,\n ConvexPolygon = 9,\n RoundCuboid = 10,\n RoundTriangle = 11,\n RoundConvexPolygon = 12,\n HalfSpace = 13,\n}\n\n// #endif\n\n\n// NOTE: this **must** match the TriMeshFlags on the rust side.\n/**\n * Flags controlling the behavior of the triangle mesh creation and of some\n * operations involving triangle meshes.\n */\nexport enum TriMeshFlags {\n // NOTE: these two flags are not really useful in JS.\n //\n // /**\n // * If set, the half-edge topology of the trimesh will be computed if possible.\n // */\n // HALF_EDGE_TOPOLOGY = 0b0000_0001,\n // /** If set, the half-edge topology and connected components of the trimesh will be computed if possible.\n // *\n // * Because of the way it is currently implemented, connected components can only be computed on\n // * a mesh where the half-edge topology computation succeeds. It will no longer be the case in the\n // * future once we decouple the computations.\n // */\n // CONNECTED_COMPONENTS = 0b0000_0010,\n /**\n * If set, any triangle that results in a failing half-hedge topology computation will be deleted.\n */\n DELETE_BAD_TOPOLOGY_TRIANGLES = 0b0000_0100,\n /**\n * If set, the trimesh will be assumed to be oriented (with outward normals).\n *\n * The pseudo-normals of its vertices and edges will be computed.\n */\n ORIENTED = 0b0000_1000,\n /**\n * If set, the duplicate vertices of the trimesh will be merged.\n *\n * Two vertices with the exact same coordinates will share the same entry on the\n * vertex buffer and the index buffer is adjusted accordingly.\n */\n MERGE_DUPLICATE_VERTICES = 0b0001_0000,\n /**\n * If set, the triangles sharing two vertices with identical index values will be removed.\n *\n * Because of the way it is currently implemented, this methods implies that duplicate\n * vertices will be merged. It will no longer be the case in the future once we decouple\n * the computations.\n */\n DELETE_DEGENERATE_TRIANGLES = 0b0010_0000,\n /**\n * If set, two triangles sharing three vertices with identical index values (in any order)\n * will be removed.\n *\n * Because of the way it is currently implemented, this methods implies that duplicate\n * vertices will be merged. It will no longer be the case in the future once we decouple\n * the computations.\n */\n DELETE_DUPLICATE_TRIANGLES = 0b0100_0000,\n /**\n * If set, a special treatment will be applied to contact manifold calculation to eliminate\n * or fix contacts normals that could lead to incorrect bumps in physics simulation\n * (especially on flat surfaces).\n *\n * This is achieved by taking into account adjacent triangle normals when computing contact\n * points for a given triangle.\n *\n * /!\\ NOT SUPPORTED IN THE 2D VERSION OF RAPIER.\n */\n FIX_INTERNAL_EDGES = 0b1000_0000 |\n TriMeshFlags.ORIENTED |\n TriMeshFlags.MERGE_DUPLICATE_VERTICES,\n}\n\n/**\n * A shape that is a sphere in 3D and a circle in 2D.\n */\nexport class Ball extends Shape {\n readonly type = ShapeType.Ball;\n\n /**\n * The balls radius.\n */\n radius: number;\n\n /**\n * Creates a new ball with the given radius.\n * @param radius - The balls radius.\n */\n constructor(radius: number) {\n super();\n this.radius = radius;\n }\n\n public intoRaw(): RawShape {\n return RawShape.ball(this.radius);\n }\n}\n\nexport class HalfSpace extends Shape {\n readonly type = ShapeType.HalfSpace;\n\n /**\n * The outward normal of the half-space.\n */\n normal: Vector;\n\n /**\n * Creates a new halfspace delimited by an infinite plane.\n *\n * @param normal - The outward normal of the plane.\n */\n constructor(normal: Vector) {\n super();\n this.normal = normal;\n }\n\n public intoRaw(): RawShape {\n let n = VectorOps.intoRaw(this.normal);\n let result = RawShape.halfspace(n);\n n.free();\n return result;\n }\n}\n\n/**\n * A shape that is a box in 3D and a rectangle in 2D.\n */\nexport class Cuboid extends Shape {\n readonly type = ShapeType.Cuboid;\n\n /**\n * The half extent of the cuboid along each coordinate axis.\n */\n halfExtents: Vector;\n\n // #if DIM2\n /**\n * Creates a new 2D rectangle.\n * @param hx - The half width of the rectangle.\n * @param hy - The helf height of the rectangle.\n */\n constructor(hx: number, hy: number) {\n super();\n this.halfExtents = VectorOps.new(hx, hy);\n }\n\n // #endif\n\n\n public intoRaw(): RawShape {\n // #if DIM2\n return RawShape.cuboid(this.halfExtents.x, this.halfExtents.y);\n // #endif\n\n }\n}\n\n/**\n * A shape that is a box in 3D and a rectangle in 2D, with round corners.\n */\nexport class RoundCuboid extends Shape {\n readonly type = ShapeType.RoundCuboid;\n\n /**\n * The half extent of the cuboid along each coordinate axis.\n */\n halfExtents: Vector;\n\n /**\n * The radius of the cuboid's round border.\n */\n borderRadius: number;\n\n // #if DIM2\n /**\n * Creates a new 2D rectangle.\n * @param hx - The half width of the rectangle.\n * @param hy - The helf height of the rectangle.\n * @param borderRadius - The radius of the borders of this cuboid. This will\n * effectively increase the half-extents of the cuboid by this radius.\n */\n constructor(hx: number, hy: number, borderRadius: number) {\n super();\n this.halfExtents = VectorOps.new(hx, hy);\n this.borderRadius = borderRadius;\n }\n\n // #endif\n\n\n public intoRaw(): RawShape {\n // #if DIM2\n return RawShape.roundCuboid(\n this.halfExtents.x,\n this.halfExtents.y,\n this.borderRadius,\n );\n // #endif\n\n }\n}\n\n/**\n * A shape that is a capsule.\n */\nexport class Capsule extends Shape {\n readonly type = ShapeType.Capsule;\n\n /**\n * The radius of the capsule's basis.\n */\n radius: number;\n\n /**\n * The capsule's half height, along the `y` axis.\n */\n halfHeight: number;\n\n /**\n * Creates a new capsule with the given radius and half-height.\n * @param halfHeight - The balls half-height along the `y` axis.\n * @param radius - The balls radius.\n */\n constructor(halfHeight: number, radius: number) {\n super();\n this.halfHeight = halfHeight;\n this.radius = radius;\n }\n\n public intoRaw(): RawShape {\n return RawShape.capsule(this.halfHeight, this.radius);\n }\n}\n\n/**\n * A shape that is a segment.\n */\nexport class Segment extends Shape {\n readonly type = ShapeType.Segment;\n\n /**\n * The first point of the segment.\n */\n a: Vector;\n\n /**\n * The second point of the segment.\n */\n b: Vector;\n\n /**\n * Creates a new segment shape.\n * @param a - The first point of the segment.\n * @param b - The second point of the segment.\n */\n constructor(a: Vector, b: Vector) {\n super();\n this.a = a;\n this.b = b;\n }\n\n public intoRaw(): RawShape {\n let ra = VectorOps.intoRaw(this.a);\n let rb = VectorOps.intoRaw(this.b);\n let result = RawShape.segment(ra, rb);\n ra.free();\n rb.free();\n return result;\n }\n}\n\n/**\n * A shape that is a segment.\n */\nexport class Triangle extends Shape {\n readonly type = ShapeType.Triangle;\n\n /**\n * The first point of the triangle.\n */\n a: Vector;\n\n /**\n * The second point of the triangle.\n */\n b: Vector;\n\n /**\n * The second point of the triangle.\n */\n c: Vector;\n\n /**\n * Creates a new triangle shape.\n *\n * @param a - The first point of the triangle.\n * @param b - The second point of the triangle.\n * @param c - The third point of the triangle.\n */\n constructor(a: Vector, b: Vector, c: Vector) {\n super();\n this.a = a;\n this.b = b;\n this.c = c;\n }\n\n public intoRaw(): RawShape {\n let ra = VectorOps.intoRaw(this.a);\n let rb = VectorOps.intoRaw(this.b);\n let rc = VectorOps.intoRaw(this.c);\n let result = RawShape.triangle(ra, rb, rc);\n ra.free();\n rb.free();\n rc.free();\n return result;\n }\n}\n\n/**\n * A shape that is a triangle with round borders and a non-zero thickness.\n */\nexport class RoundTriangle extends Shape {\n readonly type = ShapeType.RoundTriangle;\n\n /**\n * The first point of the triangle.\n */\n a: Vector;\n\n /**\n * The second point of the triangle.\n */\n b: Vector;\n\n /**\n * The second point of the triangle.\n */\n c: Vector;\n\n /**\n * The radius of the triangles's rounded edges and vertices.\n * In 3D, this is also equal to half the thickness of the round triangle.\n */\n borderRadius: number;\n\n /**\n * Creates a new triangle shape with round corners.\n *\n * @param a - The first point of the triangle.\n * @param b - The second point of the triangle.\n * @param c - The third point of the triangle.\n * @param borderRadius - The radius of the borders of this triangle. In 3D,\n * this is also equal to half the thickness of the triangle.\n */\n constructor(a: Vector, b: Vector, c: Vector, borderRadius: number) {\n super();\n this.a = a;\n this.b = b;\n this.c = c;\n this.borderRadius = borderRadius;\n }\n\n public intoRaw(): RawShape {\n let ra = VectorOps.intoRaw(this.a);\n let rb = VectorOps.intoRaw(this.b);\n let rc = VectorOps.intoRaw(this.c);\n let result = RawShape.roundTriangle(ra, rb, rc, this.borderRadius);\n ra.free();\n rb.free();\n rc.free();\n return result;\n }\n}\n\n/**\n * A shape that is a triangle mesh.\n */\nexport class Polyline extends Shape {\n readonly type = ShapeType.Polyline;\n\n /**\n * The vertices of the polyline.\n */\n vertices: Float32Array;\n\n /**\n * The indices of the segments.\n */\n indices: Uint32Array;\n\n /**\n * Creates a new polyline shape.\n *\n * @param vertices - The coordinates of the polyline's vertices.\n * @param indices - The indices of the polyline's segments. If this is `null` or not provided, then\n * the vertices are assumed to form a line strip.\n */\n constructor(vertices: Float32Array, indices?: Uint32Array) {\n super();\n this.vertices = vertices;\n this.indices = indices ?? new Uint32Array(0);\n }\n\n public intoRaw(): RawShape {\n return RawShape.polyline(this.vertices, this.indices);\n }\n}\n\n/**\n * A shape that is a triangle mesh.\n */\nexport class TriMesh extends Shape {\n readonly type = ShapeType.TriMesh;\n\n /**\n * The vertices of the triangle mesh.\n */\n vertices: Float32Array;\n\n /**\n * The indices of the triangles.\n */\n indices: Uint32Array;\n\n /**\n * The triangle mesh flags.\n */\n flags: TriMeshFlags;\n\n /**\n * Creates a new triangle mesh shape.\n *\n * @param vertices - The coordinates of the triangle mesh's vertices.\n * @param indices - The indices of the triangle mesh's triangles.\n */\n constructor(\n vertices: Float32Array,\n indices: Uint32Array,\n flags?: TriMeshFlags,\n ) {\n super();\n this.vertices = vertices;\n this.indices = indices;\n this.flags = flags;\n }\n\n public intoRaw(): RawShape {\n return RawShape.trimesh(this.vertices, this.indices, this.flags);\n }\n}\n\n// #if DIM2\n/**\n * A shape that is a convex polygon.\n */\nexport class ConvexPolygon extends Shape {\n readonly type = ShapeType.ConvexPolygon;\n\n /**\n * The vertices of the convex polygon.\n */\n vertices: Float32Array;\n\n /**\n * Do we want to assume the vertices already form a convex hull?\n */\n skipConvexHullComputation: boolean;\n\n /**\n * Creates a new convex polygon shape.\n *\n * @param vertices - The coordinates of the convex polygon's vertices.\n * @param skipConvexHullComputation - If set to `true`, the input points will\n * be assumed to form a convex polyline and no convex-hull computation will\n * be done automatically.\n */\n constructor(vertices: Float32Array, skipConvexHullComputation: boolean) {\n super();\n this.vertices = vertices;\n this.skipConvexHullComputation = !!skipConvexHullComputation;\n }\n\n public intoRaw(): RawShape {\n if (this.skipConvexHullComputation) {\n return RawShape.convexPolyline(this.vertices);\n } else {\n return RawShape.convexHull(this.vertices);\n }\n }\n}\n\n/**\n * A shape that is a convex polygon.\n */\nexport class RoundConvexPolygon extends Shape {\n readonly type = ShapeType.RoundConvexPolygon;\n\n /**\n * The vertices of the convex polygon.\n */\n vertices: Float32Array;\n\n /**\n * Do we want to assume the vertices already form a convex hull?\n */\n skipConvexHullComputation: boolean;\n\n /**\n * The radius of the convex polygon's rounded edges and vertices.\n */\n borderRadius: number;\n\n /**\n * Creates a new convex polygon shape.\n *\n * @param vertices - The coordinates of the convex polygon's vertices.\n * @param borderRadius - The radius of the borders of this convex polygon.\n * @param skipConvexHullComputation - If set to `true`, the input points will\n * be assumed to form a convex polyline and no convex-hull computation will\n * be done automatically.\n */\n constructor(\n vertices: Float32Array,\n borderRadius: number,\n skipConvexHullComputation: boolean,\n ) {\n super();\n this.vertices = vertices;\n this.borderRadius = borderRadius;\n this.skipConvexHullComputation = !!skipConvexHullComputation;\n }\n\n public intoRaw(): RawShape {\n if (this.skipConvexHullComputation) {\n return RawShape.roundConvexPolyline(\n this.vertices,\n this.borderRadius,\n );\n } else {\n return RawShape.roundConvexHull(this.vertices, this.borderRadius);\n }\n }\n}\n\n/**\n * A shape that is a heightfield.\n */\nexport class Heightfield extends Shape {\n readonly type = ShapeType.HeightField;\n\n /**\n * The heights of the heightfield, along its local `y` axis.\n */\n heights: Float32Array;\n\n /**\n * The heightfield's length along its local `x` axis.\n */\n scale: Vector;\n\n /**\n * Creates a new heightfield shape.\n *\n * @param heights - The heights of the heightfield, along its local `y` axis.\n * @param scale - The scale factor applied to the heightfield.\n */\n constructor(heights: Float32Array, scale: Vector) {\n super();\n this.heights = heights;\n this.scale = scale;\n }\n\n public intoRaw(): RawShape {\n let rawScale = VectorOps.intoRaw(this.scale);\n let rawShape = RawShape.heightfield(this.heights, rawScale);\n rawScale.free();\n return rawShape;\n }\n}\n\n// #endif\n\n", "import {RawPhysicsPipeline} from \"../raw\";\nimport {Vector, VectorOps} from \"../math\";\nimport {\n IntegrationParameters,\n ImpulseJointSet,\n MultibodyJointSet,\n RigidBodyHandle,\n RigidBodySet,\n CCDSolver,\n IslandManager,\n} from \"../dynamics\";\nimport {\n BroadPhase,\n ColliderHandle,\n ColliderSet,\n NarrowPhase,\n} from \"../geometry\";\nimport {EventQueue} from \"./event_queue\";\nimport {PhysicsHooks} from \"./physics_hooks\";\n\nexport class PhysicsPipeline {\n raw: RawPhysicsPipeline;\n\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawPhysicsPipeline) {\n this.raw = raw || new RawPhysicsPipeline();\n }\n\n public step(\n gravity: Vector,\n integrationParameters: IntegrationParameters,\n islands: IslandManager,\n broadPhase: BroadPhase,\n narrowPhase: NarrowPhase,\n bodies: RigidBodySet,\n colliders: ColliderSet,\n impulseJoints: ImpulseJointSet,\n multibodyJoints: MultibodyJointSet,\n ccdSolver: CCDSolver,\n eventQueue?: EventQueue,\n hooks?: PhysicsHooks,\n ) {\n let rawG = VectorOps.intoRaw(gravity);\n\n if (!!eventQueue) {\n this.raw.stepWithEvents(\n rawG,\n integrationParameters.raw,\n islands.raw,\n broadPhase.raw,\n narrowPhase.raw,\n bodies.raw,\n colliders.raw,\n impulseJoints.raw,\n multibodyJoints.raw,\n ccdSolver.raw,\n eventQueue.raw,\n hooks,\n !!hooks ? hooks.filterContactPair : null,\n !!hooks ? hooks.filterIntersectionPair : null,\n );\n } else {\n this.raw.step(\n rawG,\n integrationParameters.raw,\n islands.raw,\n broadPhase.raw,\n narrowPhase.raw,\n bodies.raw,\n colliders.raw,\n impulseJoints.raw,\n multibodyJoints.raw,\n ccdSolver.raw,\n );\n }\n\n rawG.free();\n }\n}\n", "import {RawQueryPipeline, RawRayColliderIntersection} from \"../raw\";\nimport {\n ColliderHandle,\n ColliderSet,\n InteractionGroups,\n PointColliderProjection,\n Ray,\n RayColliderIntersection,\n RayColliderHit,\n Shape,\n ColliderShapeCastHit,\n} from \"../geometry\";\nimport {IslandManager, RigidBodyHandle, RigidBodySet} from \"../dynamics\";\nimport {Rotation, RotationOps, Vector, VectorOps} from \"../math\";\n\n// NOTE: must match the bits in the QueryFilterFlags on the Rust side.\n/**\n * Flags for excluding whole sets of colliders from a scene query.\n */\nexport enum QueryFilterFlags {\n /**\n * Exclude from the query any collider attached to a fixed rigid-body and colliders with no rigid-body attached.\n */\n EXCLUDE_FIXED = 0b0000_0001,\n /**\n * Exclude from the query any collider attached to a dynamic rigid-body.\n */\n EXCLUDE_KINEMATIC = 0b0000_0010,\n /**\n * Exclude from the query any collider attached to a kinematic rigid-body.\n */\n EXCLUDE_DYNAMIC = 0b0000_0100,\n /**\n * Exclude from the query any collider that is a sensor.\n */\n EXCLUDE_SENSORS = 0b0000_1000,\n /**\n * Exclude from the query any collider that is not a sensor.\n */\n EXCLUDE_SOLIDS = 0b0001_0000,\n /**\n * Excludes all colliders not attached to a dynamic rigid-body.\n */\n ONLY_DYNAMIC = QueryFilterFlags.EXCLUDE_FIXED |\n QueryFilterFlags.EXCLUDE_KINEMATIC,\n /**\n * Excludes all colliders not attached to a kinematic rigid-body.\n */\n ONLY_KINEMATIC = QueryFilterFlags.EXCLUDE_DYNAMIC |\n QueryFilterFlags.EXCLUDE_FIXED,\n /**\n * Exclude all colliders attached to a non-fixed rigid-body\n * (this will not exclude colliders not attached to any rigid-body).\n */\n ONLY_FIXED = QueryFilterFlags.EXCLUDE_DYNAMIC |\n QueryFilterFlags.EXCLUDE_KINEMATIC,\n}\n\n/**\n * A pipeline for performing queries on all the colliders of a scene.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `queryPipeline.free()`\n * once you are done using it (and all the rigid-bodies it created).\n */\nexport class QueryPipeline {\n raw: RawQueryPipeline;\n\n /**\n * Release the WASM memory occupied by this query pipeline.\n */\n free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawQueryPipeline) {\n this.raw = raw || new RawQueryPipeline();\n }\n\n /**\n * Updates the acceleration structure of the query pipeline.\n * @param bodies - The set of rigid-bodies taking part in this pipeline.\n * @param colliders - The set of colliders taking part in this pipeline.\n */\n public update(bodies: RigidBodySet, colliders: ColliderSet) {\n this.raw.update(bodies.raw, colliders.raw);\n }\n\n /**\n * Find the closest intersection between a ray and a set of collider.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @param groups - Used to filter the colliders that can or cannot be hit by the ray.\n * @param filter - The callback to filter out which collider will be hit.\n */\n public castRay(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n ray: Ray,\n maxToi: number,\n solid: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ): RayColliderHit | null {\n let rawOrig = VectorOps.intoRaw(ray.origin);\n let rawDir = VectorOps.intoRaw(ray.dir);\n let result = RayColliderHit.fromRaw(\n colliders,\n this.raw.castRay(\n bodies.raw,\n colliders.raw,\n rawOrig,\n rawDir,\n maxToi,\n solid,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n ),\n );\n\n rawOrig.free();\n rawDir.free();\n\n return result;\n }\n\n /**\n * Find the closest intersection between a ray and a set of collider.\n *\n * This also computes the normal at the hit point.\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @param groups - Used to filter the colliders that can or cannot be hit by the ray.\n */\n public castRayAndGetNormal(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n ray: Ray,\n maxToi: number,\n solid: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ): RayColliderIntersection | null {\n let rawOrig = VectorOps.intoRaw(ray.origin);\n let rawDir = VectorOps.intoRaw(ray.dir);\n let result = RayColliderIntersection.fromRaw(\n colliders,\n this.raw.castRayAndGetNormal(\n bodies.raw,\n colliders.raw,\n rawOrig,\n rawDir,\n maxToi,\n solid,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n ),\n );\n\n rawOrig.free();\n rawDir.free();\n\n return result;\n }\n\n /**\n * Cast a ray and collects all the intersections between a ray and the scene.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @param groups - Used to filter the colliders that can or cannot be hit by the ray.\n * @param callback - The callback called once per hit (in no particular order) between a ray and a collider.\n * If this callback returns `false`, then the cast will stop and no further hits will be detected/reported.\n */\n public intersectionsWithRay(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n ray: Ray,\n maxToi: number,\n solid: boolean,\n callback: (intersect: RayColliderIntersection) => boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ) {\n let rawOrig = VectorOps.intoRaw(ray.origin);\n let rawDir = VectorOps.intoRaw(ray.dir);\n let rawCallback = (rawInter: RawRayColliderIntersection) => {\n return callback(\n RayColliderIntersection.fromRaw(colliders, rawInter),\n );\n };\n\n this.raw.intersectionsWithRay(\n bodies.raw,\n colliders.raw,\n rawOrig,\n rawDir,\n maxToi,\n solid,\n rawCallback,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n );\n\n rawOrig.free();\n rawDir.free();\n }\n\n /**\n * Gets the handle of up to one collider intersecting the given shape.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param shapePos - The position of the shape used for the intersection test.\n * @param shapeRot - The orientation of the shape used for the intersection test.\n * @param shape - The shape used for the intersection test.\n * @param groups - The bit groups and filter associated to the ray, in order to only\n * hit the colliders with collision groups compatible with the ray's group.\n */\n public intersectionWithShape(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n shapePos: Vector,\n shapeRot: Rotation,\n shape: Shape,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ): ColliderHandle | null {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawShape = shape.intoRaw();\n let result = this.raw.intersectionWithShape(\n bodies.raw,\n colliders.raw,\n rawPos,\n rawRot,\n rawShape,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n );\n\n rawPos.free();\n rawRot.free();\n rawShape.free();\n\n return result;\n }\n\n /**\n * Find the projection of a point on the closest collider.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param point - The point to project.\n * @param solid - If this is set to `true` then the collider shapes are considered to\n * be plain (if the point is located inside of a plain shape, its projection is the point\n * itself). If it is set to `false` the collider shapes are considered to be hollow\n * (if the point is located inside of an hollow shape, it is projected on the shape's\n * boundary).\n * @param groups - The bit groups and filter associated to the point to project, in order to only\n * project on colliders with collision groups compatible with the ray's group.\n */\n public projectPoint(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n point: Vector,\n solid: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ): PointColliderProjection | null {\n let rawPoint = VectorOps.intoRaw(point);\n let result = PointColliderProjection.fromRaw(\n colliders,\n this.raw.projectPoint(\n bodies.raw,\n colliders.raw,\n rawPoint,\n solid,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n ),\n );\n\n rawPoint.free();\n\n return result;\n }\n\n /**\n * Find the projection of a point on the closest collider.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param point - The point to project.\n * @param groups - The bit groups and filter associated to the point to project, in order to only\n * project on colliders with collision groups compatible with the ray's group.\n */\n public projectPointAndGetFeature(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n point: Vector,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ): PointColliderProjection | null {\n let rawPoint = VectorOps.intoRaw(point);\n let result = PointColliderProjection.fromRaw(\n colliders,\n this.raw.projectPointAndGetFeature(\n bodies.raw,\n colliders.raw,\n rawPoint,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n ),\n );\n\n rawPoint.free();\n\n return result;\n }\n\n /**\n * Find all the colliders containing the given point.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param point - The point used for the containment test.\n * @param groups - The bit groups and filter associated to the point to test, in order to only\n * test on colliders with collision groups compatible with the ray's group.\n * @param callback - A function called with the handles of each collider with a shape\n * containing the `point`.\n */\n public intersectionsWithPoint(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n point: Vector,\n callback: (handle: ColliderHandle) => boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ) {\n let rawPoint = VectorOps.intoRaw(point);\n\n this.raw.intersectionsWithPoint(\n bodies.raw,\n colliders.raw,\n rawPoint,\n callback,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n );\n\n rawPoint.free();\n }\n\n /**\n * Casts a shape at a constant linear velocity and retrieve the first collider it hits.\n * This is similar to ray-casting except that we are casting a whole shape instead of\n * just a point (the ray origin).\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param shapePos - The initial position of the shape to cast.\n * @param shapeRot - The initial rotation of the shape to cast.\n * @param shapeVel - The constant velocity of the shape to cast (i.e. the cast direction).\n * @param shape - The shape to cast.\n * @param targetDistance − If the shape moves closer to this distance from a collider, a hit\n * will be returned.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.\n * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if\n * the shape is penetrating another shape at its starting point **and** its trajectory is such\n * that it’s on a path to exist that penetration state.\n * @param groups - The bit groups and filter associated to the shape to cast, in order to only\n * test on colliders with collision groups compatible with this group.\n */\n public castShape(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n shapePos: Vector,\n shapeRot: Rotation,\n shapeVel: Vector,\n shape: Shape,\n targetDistance: number,\n maxToi: number,\n stopAtPenetration: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ): ColliderShapeCastHit | null {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawVel = VectorOps.intoRaw(shapeVel);\n let rawShape = shape.intoRaw();\n\n let result = ColliderShapeCastHit.fromRaw(\n colliders,\n this.raw.castShape(\n bodies.raw,\n colliders.raw,\n rawPos,\n rawRot,\n rawVel,\n rawShape,\n targetDistance,\n maxToi,\n stopAtPenetration,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n ),\n );\n\n rawPos.free();\n rawRot.free();\n rawVel.free();\n rawShape.free();\n\n return result;\n }\n\n /**\n * Retrieve all the colliders intersecting the given shape.\n *\n * @param colliders - The set of colliders taking part in this pipeline.\n * @param shapePos - The position of the shape to test.\n * @param shapeRot - The orientation of the shape to test.\n * @param shape - The shape to test.\n * @param groups - The bit groups and filter associated to the shape to test, in order to only\n * test on colliders with collision groups compatible with this group.\n * @param callback - A function called with the handles of each collider intersecting the `shape`.\n */\n public intersectionsWithShape(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n shapePos: Vector,\n shapeRot: Rotation,\n shape: Shape,\n callback: (handle: ColliderHandle) => boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: ColliderHandle,\n filterExcludeRigidBody?: RigidBodyHandle,\n filterPredicate?: (collider: ColliderHandle) => boolean,\n ) {\n let rawPos = VectorOps.intoRaw(shapePos);\n let rawRot = RotationOps.intoRaw(shapeRot);\n let rawShape = shape.intoRaw();\n\n this.raw.intersectionsWithShape(\n bodies.raw,\n colliders.raw,\n rawPos,\n rawRot,\n rawShape,\n callback,\n filterFlags,\n filterGroups,\n filterExcludeCollider,\n filterExcludeRigidBody,\n filterPredicate,\n );\n\n rawPos.free();\n rawRot.free();\n rawShape.free();\n }\n\n /**\n * Finds the handles of all the colliders with an AABB intersecting the given AABB.\n *\n * @param aabbCenter - The center of the AABB to test.\n * @param aabbHalfExtents - The half-extents of the AABB to test.\n * @param callback - The callback that will be called with the handles of all the colliders\n * currently intersecting the given AABB.\n */\n public collidersWithAabbIntersectingAabb(\n aabbCenter: Vector,\n aabbHalfExtents: Vector,\n callback: (handle: ColliderHandle) => boolean,\n ) {\n let rawCenter = VectorOps.intoRaw(aabbCenter);\n let rawHalfExtents = VectorOps.intoRaw(aabbHalfExtents);\n this.raw.collidersWithAabbIntersectingAabb(\n rawCenter,\n rawHalfExtents,\n callback,\n );\n rawCenter.free();\n rawHalfExtents.free();\n }\n}\n", "import {RawSerializationPipeline} from \"../raw\";\nimport {Vector, VectorOps} from \"../math\";\nimport {\n IntegrationParameters,\n IslandManager,\n ImpulseJointSet,\n MultibodyJointSet,\n RigidBodySet,\n} from \"../dynamics\";\nimport {BroadPhase, ColliderSet, NarrowPhase} from \"../geometry\";\nimport {World} from \"./world\";\n\n/**\n * A pipeline for serializing the physics scene.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `queryPipeline.free()`\n * once you are done using it (and all the rigid-bodies it created).\n */\nexport class SerializationPipeline {\n raw: RawSerializationPipeline;\n\n /**\n * Release the WASM memory occupied by this serialization pipeline.\n */\n free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n constructor(raw?: RawSerializationPipeline) {\n this.raw = raw || new RawSerializationPipeline();\n }\n\n /**\n * Serialize a complete physics state into a single byte array.\n * @param gravity - The current gravity affecting the simulation.\n * @param integrationParameters - The integration parameters of the simulation.\n * @param broadPhase - The broad-phase of the simulation.\n * @param narrowPhase - The narrow-phase of the simulation.\n * @param bodies - The rigid-bodies taking part into the simulation.\n * @param colliders - The colliders taking part into the simulation.\n * @param impulseJoints - The impulse joints taking part into the simulation.\n * @param multibodyJoints - The multibody joints taking part into the simulation.\n */\n public serializeAll(\n gravity: Vector,\n integrationParameters: IntegrationParameters,\n islands: IslandManager,\n broadPhase: BroadPhase,\n narrowPhase: NarrowPhase,\n bodies: RigidBodySet,\n colliders: ColliderSet,\n impulseJoints: ImpulseJointSet,\n multibodyJoints: MultibodyJointSet,\n ): Uint8Array {\n let rawGra = VectorOps.intoRaw(gravity);\n\n const res = this.raw.serializeAll(\n rawGra,\n integrationParameters.raw,\n islands.raw,\n broadPhase.raw,\n narrowPhase.raw,\n bodies.raw,\n colliders.raw,\n impulseJoints.raw,\n multibodyJoints.raw,\n );\n rawGra.free();\n\n return res;\n }\n\n /**\n * Deserialize the complete physics state from a single byte array.\n *\n * @param data - The byte array to deserialize.\n */\n public deserializeAll(data: Uint8Array): World {\n return World.fromRaw(this.raw.deserializeAll(data));\n }\n}\n", "import {RawDebugRenderPipeline} from \"../raw\";\nimport {Vector, VectorOps} from \"../math\";\nimport {\n IntegrationParameters,\n IslandManager,\n ImpulseJointSet,\n MultibodyJointSet,\n RigidBodySet,\n} from \"../dynamics\";\nimport {BroadPhase, ColliderSet, NarrowPhase} from \"../geometry\";\n\n/**\n * The vertex and color buffers for debug-redering the physics scene.\n */\nexport class DebugRenderBuffers {\n /**\n * The lines to render. This is a flat array containing all the lines\n * to render. Each line is described as two consecutive point. Each\n * point is described as two (in 2D) or three (in 3D) consecutive\n * floats. For example, in 2D, the array: `[1, 2, 3, 4, 5, 6, 7, 8]`\n * describes the two segments `[[1, 2], [3, 4]]` and `[[5, 6], [7, 8]]`.\n */\n public vertices: Float32Array;\n /**\n * The color buffer. There is one color per vertex, and each color\n * has four consecutive components (in RGBA format).\n */\n public colors: Float32Array;\n\n constructor(vertices: Float32Array, colors: Float32Array) {\n this.vertices = vertices;\n this.colors = colors;\n }\n}\n\n/**\n * A pipeline for rendering the physics scene.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `debugRenderPipeline.free()`\n * once you are done using it (and all the rigid-bodies it created).\n */\nexport class DebugRenderPipeline {\n raw: RawDebugRenderPipeline;\n public vertices: Float32Array;\n public colors: Float32Array;\n\n /**\n * Release the WASM memory occupied by this serialization pipeline.\n */\n free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n this.vertices = undefined;\n this.colors = undefined;\n }\n\n constructor(raw?: RawDebugRenderPipeline) {\n this.raw = raw || new RawDebugRenderPipeline();\n }\n\n public render(\n bodies: RigidBodySet,\n colliders: ColliderSet,\n impulse_joints: ImpulseJointSet,\n multibody_joints: MultibodyJointSet,\n narrow_phase: NarrowPhase,\n ) {\n this.raw.render(\n bodies.raw,\n colliders.raw,\n impulse_joints.raw,\n multibody_joints.raw,\n narrow_phase.raw,\n );\n this.vertices = this.raw.vertices();\n this.colors = this.raw.colors();\n }\n}\n", "import {RawKinematicCharacterController, RawCharacterCollision} from \"../raw\";\nimport {Rotation, Vector, VectorOps} from \"../math\";\nimport {Collider, ColliderSet, InteractionGroups, Shape} from \"../geometry\";\nimport {QueryFilterFlags, QueryPipeline, World} from \"../pipeline\";\nimport {IntegrationParameters, RigidBody, RigidBodySet} from \"../dynamics\";\n\n/**\n * A collision between the character and an obstacle hit on its path.\n */\nexport class CharacterCollision {\n /** The collider involved in the collision. Null if the collider no longer exists in the physics world. */\n public collider: Collider | null;\n /** The translation delta applied to the character before this collision took place. */\n public translationDeltaApplied: Vector;\n /** The translation delta the character would move after this collision if there is no other obstacles. */\n public translationDeltaRemaining: Vector;\n /** The time-of-impact between the character and the obstacles. */\n public toi: number;\n /** The world-space contact point on the collider when the collision happens. */\n public witness1: Vector;\n /** The local-space contact point on the character when the collision happens. */\n public witness2: Vector;\n /** The world-space outward contact normal on the collider when the collision happens. */\n public normal1: Vector;\n /** The local-space outward contact normal on the character when the collision happens. */\n public normal2: Vector;\n}\n\n/**\n * A character controller for controlling kinematic bodies and parentless colliders by hitting\n * and sliding against obstacles.\n */\nexport class KinematicCharacterController {\n private raw: RawKinematicCharacterController;\n private rawCharacterCollision: RawCharacterCollision;\n\n private params: IntegrationParameters;\n private bodies: RigidBodySet;\n private colliders: ColliderSet;\n private queries: QueryPipeline;\n private _applyImpulsesToDynamicBodies: boolean;\n private _characterMass: number | null;\n\n constructor(\n offset: number,\n params: IntegrationParameters,\n bodies: RigidBodySet,\n colliders: ColliderSet,\n queries: QueryPipeline,\n ) {\n this.params = params;\n this.bodies = bodies;\n this.colliders = colliders;\n this.queries = queries;\n this.raw = new RawKinematicCharacterController(offset);\n this.rawCharacterCollision = new RawCharacterCollision();\n this._applyImpulsesToDynamicBodies = false;\n this._characterMass = null;\n }\n\n /** @internal */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n this.rawCharacterCollision.free();\n }\n\n this.raw = undefined;\n this.rawCharacterCollision = undefined;\n }\n\n /**\n * The direction that goes \"up\". Used to determine where the floor is, and the floor’s angle.\n */\n public up(): Vector {\n return this.raw.up();\n }\n\n /**\n * Sets the direction that goes \"up\". Used to determine where the floor is, and the floor’s angle.\n */\n public setUp(vector: Vector) {\n let rawVect = VectorOps.intoRaw(vector);\n return this.raw.setUp(rawVect);\n rawVect.free();\n }\n\n public applyImpulsesToDynamicBodies(): boolean {\n return this._applyImpulsesToDynamicBodies;\n }\n\n public setApplyImpulsesToDynamicBodies(enabled: boolean) {\n this._applyImpulsesToDynamicBodies = enabled;\n }\n\n /**\n * Returns the custom value of the character mass, if it was set by `this.setCharacterMass`.\n */\n public characterMass(): number | null {\n return this._characterMass;\n }\n\n /**\n * Set the mass of the character to be used for impulse resolution if `self.applyImpulsesToDynamicBodies`\n * is set to `true`.\n *\n * If no character mass is set explicitly (or if it is set to `null`) it is automatically assumed to be equal\n * to the mass of the rigid-body the character collider is attached to; or equal to 0 if the character collider\n * isn’t attached to any rigid-body.\n *\n * @param mass - The mass to set.\n */\n public setCharacterMass(mass: number | null) {\n this._characterMass = mass;\n }\n\n /**\n * A small gap to preserve between the character and its surroundings.\n *\n * This value should not be too large to avoid visual artifacts, but shouldn’t be too small\n * (must not be zero) to improve numerical stability of the character controller.\n */\n public offset(): number {\n return this.raw.offset();\n }\n\n /**\n * Sets a small gap to preserve between the character and its surroundings.\n *\n * This value should not be too large to avoid visual artifacts, but shouldn’t be too small\n * (must not be zero) to improve numerical stability of the character controller.\n */\n public setOffset(value: number) {\n this.raw.setOffset(value);\n }\n\n /// Increase this number if your character appears to get stuck when sliding against surfaces.\n ///\n /// This is a small distance applied to the movement toward the contact normals of shapes hit\n /// by the character controller. This helps shape-casting not getting stuck in an always-penetrating\n /// state during the sliding calculation.\n ///\n /// This value should remain fairly small since it can introduce artificial \"bumps\" when sliding\n /// along a flat surface.\n public normalNudgeFactor(): number {\n return this.raw.normalNudgeFactor();\n }\n\n /// Increase this number if your character appears to get stuck when sliding against surfaces.\n ///\n /// This is a small distance applied to the movement toward the contact normals of shapes hit\n /// by the character controller. This helps shape-casting not getting stuck in an always-penetrating\n /// state during the sliding calculation.\n ///\n /// This value should remain fairly small since it can introduce artificial \"bumps\" when sliding\n /// along a flat surface.\n public setNormalNudgeFactor(value: number) {\n this.raw.setNormalNudgeFactor(value);\n }\n\n /**\n * Is sliding against obstacles enabled?\n */\n public slideEnabled(): boolean {\n return this.raw.slideEnabled();\n }\n\n /**\n * Enable or disable sliding against obstacles.\n */\n public setSlideEnabled(enabled: boolean) {\n this.raw.setSlideEnabled(enabled);\n }\n\n /**\n * The maximum step height a character can automatically step over.\n */\n public autostepMaxHeight(): number | null {\n return this.raw.autostepMaxHeight();\n }\n\n /**\n * The minimum width of free space that must be available after stepping on a stair.\n */\n public autostepMinWidth(): number | null {\n return this.raw.autostepMinWidth();\n }\n\n /**\n * Can the character automatically step over dynamic bodies too?\n */\n public autostepIncludesDynamicBodies(): boolean | null {\n return this.raw.autostepIncludesDynamicBodies();\n }\n\n /**\n * Is automatically stepping over small objects enabled?\n */\n public autostepEnabled(): boolean {\n return this.raw.autostepEnabled();\n }\n\n /**\n * Enabled automatically stepping over small objects.\n *\n * @param maxHeight - The maximum step height a character can automatically step over.\n * @param minWidth - The minimum width of free space that must be available after stepping on a stair.\n * @param includeDynamicBodies - Can the character automatically step over dynamic bodies too?\n */\n public enableAutostep(\n maxHeight: number,\n minWidth: number,\n includeDynamicBodies: boolean,\n ) {\n this.raw.enableAutostep(maxHeight, minWidth, includeDynamicBodies);\n }\n\n /**\n * Disable automatically stepping over small objects.\n */\n public disableAutostep() {\n return this.raw.disableAutostep();\n }\n\n /**\n * The maximum angle (radians) between the floor’s normal and the `up` vector that the\n * character is able to climb.\n */\n public maxSlopeClimbAngle(): number {\n return this.raw.maxSlopeClimbAngle();\n }\n\n /**\n * Sets the maximum angle (radians) between the floor’s normal and the `up` vector that the\n * character is able to climb.\n */\n public setMaxSlopeClimbAngle(angle: number) {\n this.raw.setMaxSlopeClimbAngle(angle);\n }\n\n /**\n * The minimum angle (radians) between the floor’s normal and the `up` vector before the\n * character starts to slide down automatically.\n */\n public minSlopeSlideAngle(): number {\n return this.raw.minSlopeSlideAngle();\n }\n\n /**\n * Sets the minimum angle (radians) between the floor’s normal and the `up` vector before the\n * character starts to slide down automatically.\n */\n public setMinSlopeSlideAngle(angle: number) {\n this.raw.setMinSlopeSlideAngle(angle);\n }\n\n /**\n * If snap-to-ground is enabled, should the character be automatically snapped to the ground if\n * the distance between the ground and its feet are smaller than the specified threshold?\n */\n public snapToGroundDistance(): number | null {\n return this.raw.snapToGroundDistance();\n }\n\n /**\n * Enables automatically snapping the character to the ground if the distance between\n * the ground and its feet are smaller than the specified threshold.\n */\n public enableSnapToGround(distance: number) {\n this.raw.enableSnapToGround(distance);\n }\n\n /**\n * Disables automatically snapping the character to the ground.\n */\n public disableSnapToGround() {\n this.raw.disableSnapToGround();\n }\n\n /**\n * Is automatically snapping the character to the ground enabled?\n */\n public snapToGroundEnabled(): boolean {\n return this.raw.snapToGroundEnabled();\n }\n\n /**\n * Computes the movement the given collider is able to execute after hitting and sliding on obstacles.\n *\n * @param collider - The collider to move.\n * @param desiredTranslationDelta - The desired collider movement.\n * @param filterFlags - Flags for excluding whole subsets of colliders from the obstacles taken into account.\n * @param filterGroups - Groups for excluding colliders with incompatible collision groups from the obstacles\n * taken into account.\n * @param filterPredicate - Any collider for which this closure returns `false` will be excluded from the\n * obstacles taken into account.\n */\n public computeColliderMovement(\n collider: Collider,\n desiredTranslationDelta: Vector,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterPredicate?: (collider: Collider) => boolean,\n ) {\n let rawTranslationDelta = VectorOps.intoRaw(desiredTranslationDelta);\n this.raw.computeColliderMovement(\n this.params.dt,\n this.bodies.raw,\n this.colliders.raw,\n this.queries.raw,\n collider.handle,\n rawTranslationDelta,\n this._applyImpulsesToDynamicBodies,\n this._characterMass,\n filterFlags,\n filterGroups,\n this.colliders.castClosure(filterPredicate),\n );\n rawTranslationDelta.free();\n }\n\n /**\n * The movement computed by the last call to `this.computeColliderMovement`.\n */\n public computedMovement(): Vector {\n return VectorOps.fromRaw(this.raw.computedMovement());\n }\n\n /**\n * The result of ground detection computed by the last call to `this.computeColliderMovement`.\n */\n public computedGrounded(): boolean {\n return this.raw.computedGrounded();\n }\n\n /**\n * The number of collisions against obstacles detected along the path of the last call\n * to `this.computeColliderMovement`.\n */\n public numComputedCollisions(): number {\n return this.raw.numComputedCollisions();\n }\n\n /**\n * Returns the collision against one of the obstacles detected along the path of the last\n * call to `this.computeColliderMovement`.\n *\n * @param i - The i-th collision will be returned.\n * @param out - If this argument is set, it will be filled with the collision information.\n */\n public computedCollision(\n i: number,\n out?: CharacterCollision,\n ): CharacterCollision | null {\n if (!this.raw.computedCollision(i, this.rawCharacterCollision)) {\n return null;\n } else {\n let c = this.rawCharacterCollision;\n out = out ?? new CharacterCollision();\n out.translationDeltaApplied = VectorOps.fromRaw(\n c.translationDeltaApplied(),\n );\n out.translationDeltaRemaining = VectorOps.fromRaw(\n c.translationDeltaRemaining(),\n );\n out.toi = c.toi();\n out.witness1 = VectorOps.fromRaw(c.worldWitness1());\n out.witness2 = VectorOps.fromRaw(c.worldWitness2());\n out.normal1 = VectorOps.fromRaw(c.worldNormal1());\n out.normal2 = VectorOps.fromRaw(c.worldNormal2());\n out.collider = this.colliders.get(c.handle());\n return out;\n }\n }\n}\n", "import {\n RawBroadPhase,\n RawCCDSolver,\n RawColliderSet,\n RawDeserializedWorld,\n RawIntegrationParameters,\n RawIslandManager,\n RawImpulseJointSet,\n RawMultibodyJointSet,\n RawNarrowPhase,\n RawPhysicsPipeline,\n RawQueryPipeline,\n RawRigidBodySet,\n RawSerializationPipeline,\n RawDebugRenderPipeline,\n} from \"../raw\";\n\nimport {\n BroadPhase,\n Collider,\n ColliderDesc,\n ColliderHandle,\n ColliderSet,\n InteractionGroups,\n NarrowPhase,\n PointColliderProjection,\n Ray,\n RayColliderIntersection,\n RayColliderHit,\n Shape,\n ColliderShapeCastHit,\n TempContactManifold,\n} from \"../geometry\";\nimport {\n CCDSolver,\n IntegrationParameters,\n IslandManager,\n ImpulseJoint,\n ImpulseJointHandle,\n MultibodyJoint,\n MultibodyJointHandle,\n JointData,\n ImpulseJointSet,\n MultibodyJointSet,\n RigidBody,\n RigidBodyDesc,\n RigidBodyHandle,\n RigidBodySet,\n} from \"../dynamics\";\nimport {Rotation, Vector, VectorOps} from \"../math\";\nimport {PhysicsPipeline} from \"./physics_pipeline\";\nimport {QueryFilterFlags, QueryPipeline} from \"./query_pipeline\";\nimport {SerializationPipeline} from \"./serialization_pipeline\";\nimport {EventQueue} from \"./event_queue\";\nimport {PhysicsHooks} from \"./physics_hooks\";\nimport {DebugRenderBuffers, DebugRenderPipeline} from \"./debug_render_pipeline\";\nimport {KinematicCharacterController} from \"../control\";\nimport {Coarena} from \"../coarena\";\n\n\n/**\n * The physics world.\n *\n * This contains all the data-structures necessary for creating and simulating\n * bodies with contacts, joints, and external forces.\n */\nexport class World {\n public gravity: Vector;\n integrationParameters: IntegrationParameters;\n islands: IslandManager;\n broadPhase: BroadPhase;\n narrowPhase: NarrowPhase;\n bodies: RigidBodySet;\n colliders: ColliderSet;\n impulseJoints: ImpulseJointSet;\n multibodyJoints: MultibodyJointSet;\n ccdSolver: CCDSolver;\n queryPipeline: QueryPipeline;\n physicsPipeline: PhysicsPipeline;\n serializationPipeline: SerializationPipeline;\n debugRenderPipeline: DebugRenderPipeline;\n characterControllers: Set<KinematicCharacterController>;\n\n\n /**\n * Release the WASM memory occupied by this physics world.\n *\n * All the fields of this physics world will be freed as well,\n * so there is no need to call their `.free()` methods individually.\n */\n public free() {\n this.integrationParameters.free();\n this.islands.free();\n this.broadPhase.free();\n this.narrowPhase.free();\n this.bodies.free();\n this.colliders.free();\n this.impulseJoints.free();\n this.multibodyJoints.free();\n this.ccdSolver.free();\n this.queryPipeline.free();\n this.physicsPipeline.free();\n this.serializationPipeline.free();\n this.debugRenderPipeline.free();\n this.characterControllers.forEach((controller) => controller.free());\n\n\n this.integrationParameters = undefined;\n this.islands = undefined;\n this.broadPhase = undefined;\n this.narrowPhase = undefined;\n this.bodies = undefined;\n this.colliders = undefined;\n this.ccdSolver = undefined;\n this.impulseJoints = undefined;\n this.multibodyJoints = undefined;\n this.queryPipeline = undefined;\n this.physicsPipeline = undefined;\n this.serializationPipeline = undefined;\n this.debugRenderPipeline = undefined;\n this.characterControllers = undefined;\n\n }\n\n constructor(\n gravity: Vector,\n rawIntegrationParameters?: RawIntegrationParameters,\n rawIslands?: RawIslandManager,\n rawBroadPhase?: RawBroadPhase,\n rawNarrowPhase?: RawNarrowPhase,\n rawBodies?: RawRigidBodySet,\n rawColliders?: RawColliderSet,\n rawImpulseJoints?: RawImpulseJointSet,\n rawMultibodyJoints?: RawMultibodyJointSet,\n rawCCDSolver?: RawCCDSolver,\n rawQueryPipeline?: RawQueryPipeline,\n rawPhysicsPipeline?: RawPhysicsPipeline,\n rawSerializationPipeline?: RawSerializationPipeline,\n rawDebugRenderPipeline?: RawDebugRenderPipeline,\n ) {\n this.gravity = gravity;\n this.integrationParameters = new IntegrationParameters(\n rawIntegrationParameters,\n );\n this.islands = new IslandManager(rawIslands);\n this.broadPhase = new BroadPhase(rawBroadPhase);\n this.narrowPhase = new NarrowPhase(rawNarrowPhase);\n this.bodies = new RigidBodySet(rawBodies);\n this.colliders = new ColliderSet(rawColliders);\n this.impulseJoints = new ImpulseJointSet(rawImpulseJoints);\n this.multibodyJoints = new MultibodyJointSet(rawMultibodyJoints);\n this.ccdSolver = new CCDSolver(rawCCDSolver);\n this.queryPipeline = new QueryPipeline(rawQueryPipeline);\n this.physicsPipeline = new PhysicsPipeline(rawPhysicsPipeline);\n this.serializationPipeline = new SerializationPipeline(\n rawSerializationPipeline,\n );\n this.debugRenderPipeline = new DebugRenderPipeline(\n rawDebugRenderPipeline,\n );\n this.characterControllers = new Set<KinematicCharacterController>();\n\n\n this.impulseJoints.finalizeDeserialization(this.bodies);\n this.bodies.finalizeDeserialization(this.colliders);\n this.colliders.finalizeDeserialization(this.bodies);\n }\n\n public static fromRaw(raw: RawDeserializedWorld): World {\n if (!raw) return null;\n\n return new World(\n VectorOps.fromRaw(raw.takeGravity()),\n raw.takeIntegrationParameters(),\n raw.takeIslandManager(),\n raw.takeBroadPhase(),\n raw.takeNarrowPhase(),\n raw.takeBodies(),\n raw.takeColliders(),\n raw.takeImpulseJoints(),\n raw.takeMultibodyJoints(),\n );\n }\n\n /**\n * Takes a snapshot of this world.\n *\n * Use `World.restoreSnapshot` to create a new physics world with a state identical to\n * the state when `.takeSnapshot()` is called.\n */\n public takeSnapshot(): Uint8Array {\n return this.serializationPipeline.serializeAll(\n this.gravity,\n this.integrationParameters,\n this.islands,\n this.broadPhase,\n this.narrowPhase,\n this.bodies,\n this.colliders,\n this.impulseJoints,\n this.multibodyJoints,\n );\n }\n\n /**\n * Creates a new physics world from a snapshot.\n *\n * This new physics world will be an identical copy of the snapshoted physics world.\n */\n public static restoreSnapshot(data: Uint8Array): World {\n let deser = new SerializationPipeline();\n return deser.deserializeAll(data);\n }\n\n /**\n * Computes all the lines (and their colors) needed to render the scene.\n */\n public debugRender(): DebugRenderBuffers {\n this.debugRenderPipeline.render(\n this.bodies,\n this.colliders,\n this.impulseJoints,\n this.multibodyJoints,\n this.narrowPhase,\n );\n return new DebugRenderBuffers(\n this.debugRenderPipeline.vertices,\n this.debugRenderPipeline.colors,\n );\n }\n\n /**\n * Advance the simulation by one time step.\n *\n * All events generated by the physics engine are ignored.\n *\n * @param EventQueue - (optional) structure responsible for collecting\n * events generated by the physics engine.\n */\n public step(eventQueue?: EventQueue, hooks?: PhysicsHooks) {\n this.physicsPipeline.step(\n this.gravity,\n this.integrationParameters,\n this.islands,\n this.broadPhase,\n this.narrowPhase,\n this.bodies,\n this.colliders,\n this.impulseJoints,\n this.multibodyJoints,\n this.ccdSolver,\n eventQueue,\n hooks,\n );\n this.queryPipeline.update(this.bodies, this.colliders);\n }\n\n /**\n * Update colliders positions after rigid-bodies moved.\n *\n * When a rigid-body moves, the positions of the colliders attached to it need to be updated. This update is\n * generally automatically done at the beginning and the end of each simulation step with World.step.\n * If the positions need to be updated without running a simulation step this method can be called manually.\n */\n public propagateModifiedBodyPositionsToColliders() {\n this.bodies.raw.propagateModifiedBodyPositionsToColliders(\n this.colliders.raw,\n );\n }\n\n /**\n * Ensure subsequent scene queries take into account the collider positions set before this method is called.\n *\n * This does not step the physics simulation forward.\n */\n public updateSceneQueries() {\n this.propagateModifiedBodyPositionsToColliders();\n this.queryPipeline.update(this.bodies, this.colliders);\n }\n\n /**\n * The current simulation timestep.\n */\n get timestep(): number {\n return this.integrationParameters.dt;\n }\n\n /**\n * Sets the new simulation timestep.\n *\n * The simulation timestep governs by how much the physics state of the world will\n * be integrated. A simulation timestep should:\n * - be as small as possible. Typical values evolve around 0.016 (assuming the chosen unit is milliseconds,\n * corresponds to the time between two frames of a game running at 60FPS).\n * - not vary too much during the course of the simulation. A timestep with large variations may\n * cause instabilities in the simulation.\n *\n * @param dt - The timestep length, in seconds.\n */\n set timestep(dt: number) {\n this.integrationParameters.dt = dt;\n }\n\n /**\n * The approximate size of most dynamic objects in the scene.\n *\n * See the documentation of the `World.lengthUnit` setter for further details.\n */\n get lengthUnit(): number {\n return this.integrationParameters.lengthUnit;\n }\n\n /**\n * The approximate size of most dynamic objects in the scene.\n *\n * This value is used internally to estimate some length-based tolerance. In particular, the\n * values `IntegrationParameters.allowedLinearError`,\n * `IntegrationParameters.maxPenetrationCorrection`,\n * `IntegrationParameters.predictionDistance`, `RigidBodyActivation.linearThreshold`\n * are scaled by this value implicitly.\n *\n * This value can be understood as the number of units-per-meter in your physical world compared\n * to a human-sized world in meter. For example, in a 2d game, if your typical object size is 100\n * pixels, set the `[`Self::length_unit`]` parameter to 100.0. The physics engine will interpret\n * it as if 100 pixels is equivalent to 1 meter in its various internal threshold.\n * (default `1.0`).\n */\n set lengthUnit(unitsPerMeter: number) {\n this.integrationParameters.lengthUnit = unitsPerMeter;\n }\n\n /**\n * The number of solver iterations run by the constraints solver for calculating forces (default: `4`).\n */\n get numSolverIterations(): number {\n return this.integrationParameters.numSolverIterations;\n }\n\n /**\n * Sets the number of solver iterations run by the constraints solver for calculating forces (default: `4`).\n *\n * The greater this value is, the most rigid and realistic the physics simulation will be.\n * However a greater number of iterations is more computationally intensive.\n *\n * @param niter - The new number of solver iterations.\n */\n set numSolverIterations(niter: number) {\n this.integrationParameters.numSolverIterations = niter;\n }\n\n /**\n * Number of addition friction resolution iteration run during the last solver sub-step (default: `4`).\n */\n get numAdditionalFrictionIterations(): number {\n return this.integrationParameters.numAdditionalFrictionIterations;\n }\n\n /**\n * Sets the number of addition friction resolution iteration run during the last solver sub-step (default: `4`).\n *\n * The greater this value is, the most realistic friction will be.\n * However a greater number of iterations is more computationally intensive.\n *\n * @param niter - The new number of additional friction iterations.\n */\n set numAdditionalFrictionIterations(niter: number) {\n this.integrationParameters.numAdditionalFrictionIterations = niter;\n }\n\n /**\n * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).\n */\n get numInternalPgsIterations(): number {\n return this.integrationParameters.numInternalPgsIterations;\n }\n\n /**\n * Sets the Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).\n *\n * Increasing this parameter will improve stability of the simulation. It will have a lesser effect than\n * increasing `numSolverIterations` but is also less computationally expensive.\n *\n * @param niter - The new number of internal PGS iterations.\n */\n set numInternalPgsIterations(niter: number) {\n this.integrationParameters.numInternalPgsIterations = niter;\n }\n\n /// Configures the integration parameters to match the old PGS solver\n /// from Rapier JS version <= 0.11.\n ///\n /// This solver was slightly faster than the new one but resulted\n /// in less stable joints and worse convergence rates.\n ///\n /// This should only be used for comparison purpose or if you are\n /// experiencing problems with the new solver.\n ///\n /// NOTE: this does not affect any `RigidBody.additional_solver_iterations` that will\n /// still create solver iterations based on the new \"small-steps\" PGS solver.\n public switchToStandardPgsSolver() {\n this.integrationParameters.switchToStandardPgsSolver();\n }\n\n /// Configures the integration parameters to match the new \"small-steps\" PGS solver\n /// from Rapier version >= 0.12.\n ///\n /// The \"small-steps\" PGS solver is the default one when creating the physics world. So\n /// calling this function is generally not needed unless `World.switch_to_standard_pgs_solver`\n /// was called.\n ///\n /// This solver results in more stable joints and significantly better convergence\n /// rates but is slightly slower in its default settings.\n public switchToSmallStepsPgsSolver() {\n this.integrationParameters.switchToSmallStepsPgsSolver();\n }\n\n /// Configures the integration parameters to match the new \"small-steps\" PGS solver\n /// from Rapier version >= 0.12. Warmstarting is disabled.\n ///\n /// The \"small-steps\" PGS solver is the default one when creating the physics world. So\n /// calling this function is generally not needed unless `World.switch_to_standard_pgs_solver`\n /// was called.\n ///\n /// This solver results in more stable joints and significantly better convergence\n /// rates but is slightly slower in its default settings.\n public switchToSmallStepsPgsSolverWithoutWarmstart() {\n this.integrationParameters.switchToSmallStepsPgsSolverWithoutWarmstart();\n }\n\n /**\n * Creates a new rigid-body from the given rigid-body descriptor.\n *\n * @param body - The description of the rigid-body to create.\n */\n public createRigidBody(body: RigidBodyDesc): RigidBody {\n return this.bodies.createRigidBody(this.colliders, body);\n }\n\n /**\n * Creates a new character controller.\n *\n * @param offset - The artificial gap added between the character’s chape and its environment.\n */\n public createCharacterController(\n offset: number,\n ): KinematicCharacterController {\n let controller = new KinematicCharacterController(\n offset,\n this.integrationParameters,\n this.bodies,\n this.colliders,\n this.queryPipeline,\n );\n this.characterControllers.add(controller);\n return controller;\n }\n\n /**\n * Removes a character controller from this world.\n *\n * @param controller - The character controller to remove.\n */\n public removeCharacterController(controller: KinematicCharacterController) {\n this.characterControllers.delete(controller);\n controller.free();\n }\n\n\n /**\n * Creates a new collider.\n *\n * @param desc - The description of the collider.\n * @param parent - The rigid-body this collider is attached to.\n */\n public createCollider(desc: ColliderDesc, parent?: RigidBody): Collider {\n let parentHandle = parent ? parent.handle : undefined;\n return this.colliders.createCollider(this.bodies, desc, parentHandle);\n }\n\n /**\n * Creates a new impulse joint from the given joint descriptor.\n *\n * @param params - The description of the joint to create.\n * @param parent1 - The first rigid-body attached to this joint.\n * @param parent2 - The second rigid-body attached to this joint.\n * @param wakeUp - Should the attached rigid-bodies be awakened?\n */\n public createImpulseJoint(\n params: JointData,\n parent1: RigidBody,\n parent2: RigidBody,\n wakeUp: boolean,\n ): ImpulseJoint {\n return this.impulseJoints.createJoint(\n this.bodies,\n params,\n parent1.handle,\n parent2.handle,\n wakeUp,\n );\n }\n\n /**\n * Creates a new multibody joint from the given joint descriptor.\n *\n * @param params - The description of the joint to create.\n * @param parent1 - The first rigid-body attached to this joint.\n * @param parent2 - The second rigid-body attached to this joint.\n * @param wakeUp - Should the attached rigid-bodies be awakened?\n */\n public createMultibodyJoint(\n params: JointData,\n parent1: RigidBody,\n parent2: RigidBody,\n wakeUp: boolean,\n ): MultibodyJoint {\n return this.multibodyJoints.createJoint(\n params,\n parent1.handle,\n parent2.handle,\n wakeUp,\n );\n }\n\n /**\n * Retrieves a rigid-body from its handle.\n *\n * @param handle - The integer handle of the rigid-body to retrieve.\n */\n public getRigidBody(handle: RigidBodyHandle): RigidBody {\n return this.bodies.get(handle);\n }\n\n /**\n * Retrieves a collider from its handle.\n *\n * @param handle - The integer handle of the collider to retrieve.\n */\n public getCollider(handle: ColliderHandle): Collider {\n return this.colliders.get(handle);\n }\n\n /**\n * Retrieves an impulse joint from its handle.\n *\n * @param handle - The integer handle of the impulse joint to retrieve.\n */\n public getImpulseJoint(handle: ImpulseJointHandle): ImpulseJoint {\n return this.impulseJoints.get(handle);\n }\n\n /**\n * Retrieves an multibody joint from its handle.\n *\n * @param handle - The integer handle of the multibody joint to retrieve.\n */\n public getMultibodyJoint(handle: MultibodyJointHandle): MultibodyJoint {\n return this.multibodyJoints.get(handle);\n }\n\n /**\n * Removes the given rigid-body from this physics world.\n *\n * This will remove this rigid-body as well as all its attached colliders and joints.\n * Every other bodies touching or attached by joints to this rigid-body will be woken-up.\n *\n * @param body - The rigid-body to remove.\n */\n public removeRigidBody(body: RigidBody) {\n if (this.bodies) {\n this.bodies.remove(\n body.handle,\n this.islands,\n this.colliders,\n this.impulseJoints,\n this.multibodyJoints,\n );\n }\n }\n\n /**\n * Removes the given collider from this physics world.\n *\n * @param collider - The collider to remove.\n * @param wakeUp - If set to `true`, the rigid-body this collider is attached to will be awaken.\n */\n public removeCollider(collider: Collider, wakeUp: boolean) {\n if (this.colliders) {\n this.colliders.remove(\n collider.handle,\n this.islands,\n this.bodies,\n wakeUp,\n );\n }\n }\n\n /**\n * Removes the given impulse joint from this physics world.\n *\n * @param joint - The impulse joint to remove.\n * @param wakeUp - If set to `true`, the rigid-bodies attached by this joint will be awaken.\n */\n public removeImpulseJoint(joint: ImpulseJoint, wakeUp: boolean) {\n if (this.impulseJoints) {\n this.impulseJoints.remove(joint.handle, wakeUp);\n }\n }\n\n /**\n * Removes the given multibody joint from this physics world.\n *\n * @param joint - The multibody joint to remove.\n * @param wakeUp - If set to `true`, the rigid-bodies attached by this joint will be awaken.\n */\n public removeMultibodyJoint(joint: MultibodyJoint, wakeUp: boolean) {\n if (this.impulseJoints) {\n this.multibodyJoints.remove(joint.handle, wakeUp);\n }\n }\n\n /**\n * Applies the given closure to each collider managed by this physics world.\n *\n * @param f(collider) - The function to apply to each collider managed by this physics world. Called as `f(collider)`.\n */\n public forEachCollider(f: (collider: Collider) => void) {\n this.colliders.forEach(f);\n }\n\n /**\n * Applies the given closure to each rigid-body managed by this physics world.\n *\n * @param f(body) - The function to apply to each rigid-body managed by this physics world. Called as `f(collider)`.\n */\n public forEachRigidBody(f: (body: RigidBody) => void) {\n this.bodies.forEach(f);\n }\n\n /**\n * Applies the given closure to each active rigid-body managed by this physics world.\n *\n * After a short time of inactivity, a rigid-body is automatically deactivated (\"asleep\") by\n * the physics engine in order to save computational power. A sleeping rigid-body never moves\n * unless it is moved manually by the user.\n *\n * @param f - The function to apply to each active rigid-body managed by this physics world. Called as `f(collider)`.\n */\n public forEachActiveRigidBody(f: (body: RigidBody) => void) {\n this.bodies.forEachActiveRigidBody(this.islands, f);\n }\n\n /**\n * Find the closest intersection between a ray and the physics world.\n *\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @param groups - Used to filter the colliders that can or cannot be hit by the ray.\n * @param filter - The callback to filter out which collider will be hit.\n */\n public castRay(\n ray: Ray,\n maxToi: number,\n solid: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ): RayColliderHit | null {\n return this.queryPipeline.castRay(\n this.bodies,\n this.colliders,\n ray,\n maxToi,\n solid,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Find the closest intersection between a ray and the physics world.\n *\n * This also computes the normal at the hit point.\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @param groups - Used to filter the colliders that can or cannot be hit by the ray.\n */\n public castRayAndGetNormal(\n ray: Ray,\n maxToi: number,\n solid: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ): RayColliderIntersection | null {\n return this.queryPipeline.castRayAndGetNormal(\n this.bodies,\n this.colliders,\n ray,\n maxToi,\n solid,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Cast a ray and collects all the intersections between a ray and the scene.\n *\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @param groups - Used to filter the colliders that can or cannot be hit by the ray.\n * @param callback - The callback called once per hit (in no particular order) between a ray and a collider.\n * If this callback returns `false`, then the cast will stop and no further hits will be detected/reported.\n */\n public intersectionsWithRay(\n ray: Ray,\n maxToi: number,\n solid: boolean,\n callback: (intersect: RayColliderIntersection) => boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ) {\n this.queryPipeline.intersectionsWithRay(\n this.bodies,\n this.colliders,\n ray,\n maxToi,\n solid,\n callback,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Gets the handle of up to one collider intersecting the given shape.\n *\n * @param shapePos - The position of the shape used for the intersection test.\n * @param shapeRot - The orientation of the shape used for the intersection test.\n * @param shape - The shape used for the intersection test.\n * @param groups - The bit groups and filter associated to the ray, in order to only\n * hit the colliders with collision groups compatible with the ray's group.\n */\n public intersectionWithShape(\n shapePos: Vector,\n shapeRot: Rotation,\n shape: Shape,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ): Collider | null {\n let handle = this.queryPipeline.intersectionWithShape(\n this.bodies,\n this.colliders,\n shapePos,\n shapeRot,\n shape,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n return handle != null ? this.colliders.get(handle) : null;\n }\n\n /**\n * Find the projection of a point on the closest collider.\n *\n * @param point - The point to project.\n * @param solid - If this is set to `true` then the collider shapes are considered to\n * be plain (if the point is located inside of a plain shape, its projection is the point\n * itself). If it is set to `false` the collider shapes are considered to be hollow\n * (if the point is located inside of an hollow shape, it is projected on the shape's\n * boundary).\n * @param groups - The bit groups and filter associated to the point to project, in order to only\n * project on colliders with collision groups compatible with the ray's group.\n */\n public projectPoint(\n point: Vector,\n solid: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ): PointColliderProjection | null {\n return this.queryPipeline.projectPoint(\n this.bodies,\n this.colliders,\n point,\n solid,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Find the projection of a point on the closest collider.\n *\n * @param point - The point to project.\n * @param groups - The bit groups and filter associated to the point to project, in order to only\n * project on colliders with collision groups compatible with the ray's group.\n */\n public projectPointAndGetFeature(\n point: Vector,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ): PointColliderProjection | null {\n return this.queryPipeline.projectPointAndGetFeature(\n this.bodies,\n this.colliders,\n point,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Find all the colliders containing the given point.\n *\n * @param point - The point used for the containment test.\n * @param groups - The bit groups and filter associated to the point to test, in order to only\n * test on colliders with collision groups compatible with the ray's group.\n * @param callback - A function called with the handles of each collider with a shape\n * containing the `point`.\n */\n public intersectionsWithPoint(\n point: Vector,\n callback: (handle: Collider) => boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ) {\n this.queryPipeline.intersectionsWithPoint(\n this.bodies,\n this.colliders,\n point,\n this.colliders.castClosure(callback),\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Casts a shape at a constant linear velocity and retrieve the first collider it hits.\n * This is similar to ray-casting except that we are casting a whole shape instead of\n * just a point (the ray origin).\n *\n * @param shapePos - The initial position of the shape to cast.\n * @param shapeRot - The initial rotation of the shape to cast.\n * @param shapeVel - The constant velocity of the shape to cast (i.e. the cast direction).\n * @param shape - The shape to cast.\n * @param targetDistance − If the shape moves closer to this distance from a collider, a hit\n * will be returned.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.\n * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if\n * the shape is penetrating another shape at its starting point **and** its trajectory is such\n * that it’s on a path to exist that penetration state.\n * @param groups - The bit groups and filter associated to the shape to cast, in order to only\n * test on colliders with collision groups compatible with this group.\n */\n public castShape(\n shapePos: Vector,\n shapeRot: Rotation,\n shapeVel: Vector,\n shape: Shape,\n targetDistance: number,\n maxToi: number,\n stopAtPenetration: boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ): ColliderShapeCastHit | null {\n return this.queryPipeline.castShape(\n this.bodies,\n this.colliders,\n shapePos,\n shapeRot,\n shapeVel,\n shape,\n targetDistance,\n maxToi,\n stopAtPenetration,\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Retrieve all the colliders intersecting the given shape.\n *\n * @param shapePos - The position of the shape to test.\n * @param shapeRot - The orientation of the shape to test.\n * @param shape - The shape to test.\n * @param groups - The bit groups and filter associated to the shape to test, in order to only\n * test on colliders with collision groups compatible with this group.\n * @param callback - A function called with the handles of each collider intersecting the `shape`.\n */\n public intersectionsWithShape(\n shapePos: Vector,\n shapeRot: Rotation,\n shape: Shape,\n callback: (collider: Collider) => boolean,\n filterFlags?: QueryFilterFlags,\n filterGroups?: InteractionGroups,\n filterExcludeCollider?: Collider,\n filterExcludeRigidBody?: RigidBody,\n filterPredicate?: (collider: Collider) => boolean,\n ) {\n this.queryPipeline.intersectionsWithShape(\n this.bodies,\n this.colliders,\n shapePos,\n shapeRot,\n shape,\n this.colliders.castClosure(callback),\n filterFlags,\n filterGroups,\n filterExcludeCollider ? filterExcludeCollider.handle : null,\n filterExcludeRigidBody ? filterExcludeRigidBody.handle : null,\n this.colliders.castClosure(filterPredicate),\n );\n }\n\n /**\n * Finds the handles of all the colliders with an AABB intersecting the given AABB.\n *\n * @param aabbCenter - The center of the AABB to test.\n * @param aabbHalfExtents - The half-extents of the AABB to test.\n * @param callback - The callback that will be called with the handles of all the colliders\n * currently intersecting the given AABB.\n */\n public collidersWithAabbIntersectingAabb(\n aabbCenter: Vector,\n aabbHalfExtents: Vector,\n callback: (handle: Collider) => boolean,\n ) {\n this.queryPipeline.collidersWithAabbIntersectingAabb(\n aabbCenter,\n aabbHalfExtents,\n this.colliders.castClosure(callback),\n );\n }\n\n /**\n * Enumerates all the colliders potentially in contact with the given collider.\n *\n * @param collider1 - The second collider involved in the contact.\n * @param f - Closure that will be called on each collider that is in contact with `collider1`.\n */\n public contactPairsWith(\n collider1: Collider,\n f: (collider2: Collider) => void,\n ) {\n this.narrowPhase.contactPairsWith(\n collider1.handle,\n this.colliders.castClosure(f),\n );\n }\n\n /**\n * Enumerates all the colliders intersecting the given colliders, assuming one of them\n * is a sensor.\n */\n public intersectionPairsWith(\n collider1: Collider,\n f: (collider2: Collider) => void,\n ) {\n this.narrowPhase.intersectionPairsWith(\n collider1.handle,\n this.colliders.castClosure(f),\n );\n }\n\n /**\n * Iterates through all the contact manifolds between the given pair of colliders.\n *\n * @param collider1 - The first collider involved in the contact.\n * @param collider2 - The second collider involved in the contact.\n * @param f - Closure that will be called on each contact manifold between the two colliders. If the second argument\n * passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1`\n * actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`.\n */\n public contactPair(\n collider1: Collider,\n collider2: Collider,\n f: (manifold: TempContactManifold, flipped: boolean) => void,\n ) {\n this.narrowPhase.contactPair(collider1.handle, collider2.handle, f);\n }\n\n /**\n * Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor.\n * @param collider1 − The first collider involved in the intersection.\n * @param collider2 − The second collider involved in the intersection.\n */\n public intersectionPair(collider1: Collider, collider2: Collider): boolean {\n return this.narrowPhase.intersectionPair(\n collider1.handle,\n collider2.handle,\n );\n }\n}\n", "import {RawContactForceEvent, RawEventQueue} from \"../raw\";\nimport {RigidBodyHandle} from \"../dynamics\";\nimport {Collider, ColliderHandle} from \"../geometry\";\nimport {Vector, VectorOps} from \"../math\";\n\n/**\n * Flags indicating what events are enabled for colliders.\n */\nexport enum ActiveEvents {\n NONE = 0,\n /**\n * Enable collision events.\n */\n COLLISION_EVENTS = 0b0001,\n /**\n * Enable contact force events.\n */\n CONTACT_FORCE_EVENTS = 0b0010,\n}\n\n/**\n * Event occurring when the sum of the magnitudes of the\n * contact forces between two colliders exceed a threshold.\n *\n * This object should **not** be stored anywhere. Its properties can only be\n * read from within the closure given to `EventHandler.drainContactForceEvents`.\n */\nexport class TempContactForceEvent {\n raw: RawContactForceEvent;\n\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n /**\n * The first collider involved in the contact.\n */\n public collider1(): ColliderHandle {\n return this.raw.collider1();\n }\n\n /**\n * The second collider involved in the contact.\n */\n public collider2(): ColliderHandle {\n return this.raw.collider2();\n }\n\n /**\n * The sum of all the forces between the two colliders.\n */\n public totalForce(): Vector {\n return VectorOps.fromRaw(this.raw.total_force());\n }\n\n /**\n * The sum of the magnitudes of each force between the two colliders.\n *\n * Note that this is **not** the same as the magnitude of `self.total_force`.\n * Here we are summing the magnitude of all the forces, instead of taking\n * the magnitude of their sum.\n */\n public totalForceMagnitude(): number {\n return this.raw.total_force_magnitude();\n }\n\n /**\n * The world-space (unit) direction of the force with strongest magnitude.\n */\n public maxForceDirection(): Vector {\n return VectorOps.fromRaw(this.raw.max_force_direction());\n }\n\n /**\n * The magnitude of the largest force at a contact point of this contact pair.\n */\n public maxForceMagnitude(): number {\n return this.raw.max_force_magnitude();\n }\n}\n\n/**\n * A structure responsible for collecting events generated\n * by the physics engine.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `eventQueue.free()`\n * once you are done using it.\n */\nexport class EventQueue {\n raw: RawEventQueue;\n\n /**\n * Creates a new event collector.\n *\n * @param autoDrain -setting this to `true` is strongly recommended. If true, the collector will\n * be automatically drained before each `world.step(collector)`. If false, the collector will\n * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of\n * RAM if no drain is performed.\n */\n constructor(autoDrain: boolean, raw?: RawEventQueue) {\n this.raw = raw || new RawEventQueue(autoDrain);\n }\n\n /**\n * Release the WASM memory occupied by this event-queue.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n }\n\n /**\n * Applies the given javascript closure on each collision event of this collector, then clear\n * the internal collision event buffer.\n *\n * @param f - JavaScript closure applied to each collision event. The\n * closure must take three arguments: two integers representing the handles of the colliders\n * involved in the collision, and a boolean indicating if the collision started (true) or stopped\n * (false).\n */\n public drainCollisionEvents(\n f: (\n handle1: ColliderHandle,\n handle2: ColliderHandle,\n started: boolean,\n ) => void,\n ) {\n this.raw.drainCollisionEvents(f);\n }\n\n /**\n * Applies the given javascript closure on each contact force event of this collector, then clear\n * the internal collision event buffer.\n *\n * @param f - JavaScript closure applied to each collision event. The\n * closure must take one `TempContactForceEvent` argument.\n */\n public drainContactForceEvents(f: (event: TempContactForceEvent) => void) {\n let event = new TempContactForceEvent();\n this.raw.drainContactForceEvents((raw: RawContactForceEvent) => {\n event.raw = raw;\n f(event);\n event.free();\n });\n }\n\n /**\n * Removes all events contained by this collector\n */\n public clear() {\n this.raw.clear();\n }\n}\n", "import {RigidBodyHandle} from \"../dynamics\";\nimport {ColliderHandle} from \"../geometry\";\n\nexport enum ActiveHooks {\n NONE = 0,\n FILTER_CONTACT_PAIRS = 0b0001,\n FILTER_INTERSECTION_PAIRS = 0b0010,\n // MODIFY_SOLVER_CONTACTS = 0b0100, /* Not supported yet in JS. */\n}\n\nexport enum SolverFlags {\n EMPTY = 0b000,\n COMPUTE_IMPULSE = 0b001,\n}\n\nexport interface PhysicsHooks {\n /**\n * Function that determines if contacts computation should happen between two colliders, and how the\n * constraints solver should behave for these contacts.\n *\n * This will only be executed and taken into account if at least one of the involved colliders contains the\n * `ActiveHooks.FILTER_CONTACT_PAIR` flag in its active hooks.\n *\n * @param collider1 − Handle of the first collider involved in the potential contact.\n * @param collider2 − Handle of the second collider involved in the potential contact.\n * @param body1 − Handle of the first body involved in the potential contact.\n * @param body2 − Handle of the second body involved in the potential contact.\n */\n filterContactPair(\n collider1: ColliderHandle,\n collider2: ColliderHandle,\n body1: RigidBodyHandle,\n body2: RigidBodyHandle,\n ): SolverFlags | null;\n\n /**\n * Function that determines if intersection computation should happen between two colliders (where at least\n * one is a sensor).\n *\n * This will only be executed and taken into account if `one of the involved colliders contains the\n * `ActiveHooks.FILTER_INTERSECTION_PAIR` flag in its active hooks.\n *\n * @param collider1 − Handle of the first collider involved in the potential contact.\n * @param collider2 − Handle of the second collider involved in the potential contact.\n * @param body1 − Handle of the first body involved in the potential contact.\n * @param body2 − Handle of the second body involved in the potential contact.\n */\n filterIntersectionPair(\n collider1: ColliderHandle,\n collider2: ColliderHandle,\n body1: RigidBodyHandle,\n body2: RigidBodyHandle,\n ): boolean;\n}\n", "import {RawColliderSet} from \"../raw\";\nimport {Rotation, RotationOps, Vector, VectorOps} from \"../math\";\nimport {\n CoefficientCombineRule,\n RigidBody,\n RigidBodyHandle,\n RigidBodySet,\n} from \"../dynamics\";\nimport {ActiveHooks, ActiveEvents} from \"../pipeline\";\nimport {InteractionGroups} from \"./interaction_groups\";\nimport {\n Shape,\n Cuboid,\n Ball,\n ShapeType,\n Capsule,\n TriMesh,\n Polyline,\n Heightfield,\n Segment,\n Triangle,\n RoundTriangle,\n RoundCuboid,\n HalfSpace,\n TriMeshFlags,\n // #if DIM2\n ConvexPolygon,\n RoundConvexPolygon,\n // #endif\n} from \"./shape\";\nimport {Ray, RayIntersection} from \"./ray\";\nimport {PointProjection} from \"./point\";\nimport {ColliderShapeCastHit, ShapeCastHit} from \"./toi\";\nimport {ShapeContact} from \"./contact\";\nimport {ColliderSet} from \"./collider_set\";\n\n/**\n * Flags affecting whether collision-detection happens between two colliders\n * depending on the type of rigid-bodies they are attached to.\n */\nexport enum ActiveCollisionTypes {\n /**\n * Enable collision-detection between a collider attached to a dynamic body\n * and another collider attached to a dynamic body.\n */\n DYNAMIC_DYNAMIC = 0b0000_0000_0000_0001,\n /**\n * Enable collision-detection between a collider attached to a dynamic body\n * and another collider attached to a kinematic body.\n */\n DYNAMIC_KINEMATIC = 0b0000_0000_0000_1100,\n /**\n * Enable collision-detection between a collider attached to a dynamic body\n * and another collider attached to a fixed body (or not attached to any body).\n */\n DYNAMIC_FIXED = 0b0000_0000_0000_0010,\n /**\n * Enable collision-detection between a collider attached to a kinematic body\n * and another collider attached to a kinematic body.\n */\n KINEMATIC_KINEMATIC = 0b1100_1100_0000_0000,\n\n /**\n * Enable collision-detection between a collider attached to a kinematic body\n * and another collider attached to a fixed body (or not attached to any body).\n */\n KINEMATIC_FIXED = 0b0010_0010_0000_0000,\n\n /**\n * Enable collision-detection between a collider attached to a fixed body (or\n * not attached to any body) and another collider attached to a fixed body (or\n * not attached to any body).\n */\n FIXED_FIXED = 0b0000_0000_0010_0000,\n /**\n * The default active collision types, enabling collisions between a dynamic body\n * and another body of any type, but not enabling collisions between two non-dynamic bodies.\n */\n DEFAULT = DYNAMIC_KINEMATIC | DYNAMIC_DYNAMIC | DYNAMIC_FIXED,\n /**\n * Enable collisions between any kind of rigid-bodies (including between two non-dynamic bodies).\n */\n ALL = DYNAMIC_KINEMATIC |\n DYNAMIC_DYNAMIC |\n DYNAMIC_FIXED |\n KINEMATIC_KINEMATIC |\n KINEMATIC_FIXED |\n KINEMATIC_KINEMATIC,\n}\n\n/**\n * The integer identifier of a collider added to a `ColliderSet`.\n */\nexport type ColliderHandle = number;\n\n/**\n * A geometric entity that can be attached to a body so it can be affected\n * by contacts and proximity queries.\n */\nexport class Collider {\n private colliderSet: ColliderSet; // The Collider won't need to free this.\n readonly handle: ColliderHandle;\n private _shape: Shape;\n private _parent: RigidBody | null;\n\n constructor(\n colliderSet: ColliderSet,\n handle: ColliderHandle,\n parent: RigidBody | null,\n shape?: Shape,\n ) {\n this.colliderSet = colliderSet;\n this.handle = handle;\n this._parent = parent;\n this._shape = shape;\n }\n\n /** @internal */\n public finalizeDeserialization(bodies: RigidBodySet) {\n if (this.handle != null) {\n this._parent = bodies.get(\n this.colliderSet.raw.coParent(this.handle),\n );\n }\n }\n\n private ensureShapeIsCached() {\n if (!this._shape)\n this._shape = Shape.fromRaw(this.colliderSet.raw, this.handle);\n }\n\n /**\n * The shape of this collider.\n */\n public get shape(): Shape {\n this.ensureShapeIsCached();\n return this._shape;\n }\n\n /**\n * Checks if this collider is still valid (i.e. that it has\n * not been deleted from the collider set yet).\n */\n public isValid(): boolean {\n return this.colliderSet.raw.contains(this.handle);\n }\n\n /**\n * The world-space translation of this rigid-body.\n */\n public translation(): Vector {\n return VectorOps.fromRaw(\n this.colliderSet.raw.coTranslation(this.handle),\n );\n }\n\n /**\n * The world-space orientation of this rigid-body.\n */\n public rotation(): Rotation {\n return RotationOps.fromRaw(\n this.colliderSet.raw.coRotation(this.handle),\n );\n }\n\n /**\n * Is this collider a sensor?\n */\n public isSensor(): boolean {\n return this.colliderSet.raw.coIsSensor(this.handle);\n }\n\n /**\n * Sets whether or not this collider is a sensor.\n * @param isSensor - If `true`, the collider will be a sensor.\n */\n public setSensor(isSensor: boolean) {\n this.colliderSet.raw.coSetSensor(this.handle, isSensor);\n }\n\n /**\n * Sets the new shape of the collider.\n * @param shape - The collider’s new shape.\n */\n public setShape(shape: Shape) {\n let rawShape = shape.intoRaw();\n this.colliderSet.raw.coSetShape(this.handle, rawShape);\n rawShape.free();\n this._shape = shape;\n }\n\n /**\n * Sets whether this collider is enabled or not.\n *\n * @param enabled - Set to `false` to disable this collider (its parent rigid-body won’t be disabled automatically by this).\n */\n public setEnabled(enabled: boolean) {\n this.colliderSet.raw.coSetEnabled(this.handle, enabled);\n }\n\n /**\n * Is this collider enabled?\n */\n public isEnabled(): boolean {\n return this.colliderSet.raw.coIsEnabled(this.handle);\n }\n\n /**\n * Sets the restitution coefficient of the collider to be created.\n *\n * @param restitution - The restitution coefficient in `[0, 1]`. A value of 0 (the default) means no bouncing behavior\n * while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the\n * constraints solver).\n */\n public setRestitution(restitution: number) {\n this.colliderSet.raw.coSetRestitution(this.handle, restitution);\n }\n\n /**\n * Sets the friction coefficient of the collider to be created.\n *\n * @param friction - The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The\n * higher the coefficient, the stronger friction forces will be for contacts with the collider\n * being built.\n */\n public setFriction(friction: number) {\n this.colliderSet.raw.coSetFriction(this.handle, friction);\n }\n\n /**\n * Gets the rule used to combine the friction coefficients of two colliders\n * colliders involved in a contact.\n */\n public frictionCombineRule(): CoefficientCombineRule {\n return this.colliderSet.raw.coFrictionCombineRule(this.handle);\n }\n\n /**\n * Sets the rule used to combine the friction coefficients of two colliders\n * colliders involved in a contact.\n *\n * @param rule − The combine rule to apply.\n */\n public setFrictionCombineRule(rule: CoefficientCombineRule) {\n this.colliderSet.raw.coSetFrictionCombineRule(this.handle, rule);\n }\n\n /**\n * Gets the rule used to combine the restitution coefficients of two colliders\n * colliders involved in a contact.\n */\n public restitutionCombineRule(): CoefficientCombineRule {\n return this.colliderSet.raw.coRestitutionCombineRule(this.handle);\n }\n\n /**\n * Sets the rule used to combine the restitution coefficients of two colliders\n * colliders involved in a contact.\n *\n * @param rule − The combine rule to apply.\n */\n public setRestitutionCombineRule(rule: CoefficientCombineRule) {\n this.colliderSet.raw.coSetRestitutionCombineRule(this.handle, rule);\n }\n\n /**\n * Sets the collision groups used by this collider.\n *\n * Two colliders will interact iff. their collision groups are compatible.\n * See the documentation of `InteractionGroups` for details on teh used bit pattern.\n *\n * @param groups - The collision groups used for the collider being built.\n */\n public setCollisionGroups(groups: InteractionGroups) {\n this.colliderSet.raw.coSetCollisionGroups(this.handle, groups);\n }\n\n /**\n * Sets the solver groups used by this collider.\n *\n * Forces between two colliders in contact will be computed iff their solver\n * groups are compatible.\n * See the documentation of `InteractionGroups` for details on the used bit pattern.\n *\n * @param groups - The solver groups used for the collider being built.\n */\n public setSolverGroups(groups: InteractionGroups) {\n this.colliderSet.raw.coSetSolverGroups(this.handle, groups);\n }\n\n /**\n * Sets the contact skin for this collider.\n *\n * See the documentation of `ColliderDesc.setContactSkin` for additional details.\n */\n public contactSkin(): number {\n return this.colliderSet.raw.coContactSkin(this.handle);\n }\n\n /**\n * Sets the contact skin for this collider.\n *\n * See the documentation of `ColliderDesc.setContactSkin` for additional details.\n *\n * @param thickness - The contact skin thickness.\n */\n public setContactSkin(thickness: number) {\n return this.colliderSet.raw.coSetContactSkin(this.handle, thickness);\n }\n\n /**\n * Get the physics hooks active for this collider.\n */\n public activeHooks(): ActiveHooks {\n return this.colliderSet.raw.coActiveHooks(this.handle);\n }\n\n /**\n * Set the physics hooks active for this collider.\n *\n * Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider.\n *\n * @param activeHooks - The hooks active for contact/intersection pairs involving this collider.\n */\n public setActiveHooks(activeHooks: ActiveHooks) {\n this.colliderSet.raw.coSetActiveHooks(this.handle, activeHooks);\n }\n\n /**\n * The events active for this collider.\n */\n public activeEvents(): ActiveEvents {\n return this.colliderSet.raw.coActiveEvents(this.handle);\n }\n\n /**\n * Set the events active for this collider.\n *\n * Use this to enable contact and/or intersection event reporting for this collider.\n *\n * @param activeEvents - The events active for contact/intersection pairs involving this collider.\n */\n public setActiveEvents(activeEvents: ActiveEvents) {\n this.colliderSet.raw.coSetActiveEvents(this.handle, activeEvents);\n }\n\n /**\n * Gets the collision types active for this collider.\n */\n public activeCollisionTypes(): ActiveCollisionTypes {\n return this.colliderSet.raw.coActiveCollisionTypes(this.handle);\n }\n\n /**\n * Sets the total force magnitude beyond which a contact force event can be emitted.\n *\n * @param threshold - The new force threshold.\n */\n public setContactForceEventThreshold(threshold: number) {\n return this.colliderSet.raw.coSetContactForceEventThreshold(\n this.handle,\n threshold,\n );\n }\n\n /**\n * The total force magnitude beyond which a contact force event can be emitted.\n */\n public contactForceEventThreshold(): number {\n return this.colliderSet.raw.coContactForceEventThreshold(this.handle);\n }\n\n /**\n * Set the collision types active for this collider.\n *\n * @param activeCollisionTypes - The hooks active for contact/intersection pairs involving this collider.\n */\n public setActiveCollisionTypes(activeCollisionTypes: ActiveCollisionTypes) {\n this.colliderSet.raw.coSetActiveCollisionTypes(\n this.handle,\n activeCollisionTypes,\n );\n }\n\n /**\n * Sets the uniform density of this collider.\n *\n * This will override any previous mass-properties set by `this.setDensity`,\n * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`,\n * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider.\n *\n * The mass and angular inertia of this collider will be computed automatically based on its\n * shape.\n */\n public setDensity(density: number) {\n this.colliderSet.raw.coSetDensity(this.handle, density);\n }\n\n /**\n * Sets the mass of this collider.\n *\n * This will override any previous mass-properties set by `this.setDensity`,\n * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`,\n * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider.\n *\n * The angular inertia of this collider will be computed automatically based on its shape\n * and this mass value.\n */\n public setMass(mass: number) {\n this.colliderSet.raw.coSetMass(this.handle, mass);\n }\n\n\n // #if DIM2\n /**\n * Sets the mass of this collider.\n *\n * This will override any previous mass-properties set by `this.setDensity`,\n * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`,\n * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider.\n */\n public setMassProperties(\n mass: number,\n centerOfMass: Vector,\n principalAngularInertia: number,\n ) {\n let rawCom = VectorOps.intoRaw(centerOfMass);\n this.colliderSet.raw.coSetMassProperties(\n this.handle,\n mass,\n rawCom,\n principalAngularInertia,\n );\n rawCom.free();\n }\n\n // #endif\n\n /**\n * Sets the translation of this collider.\n *\n * @param tra - The world-space position of the collider.\n */\n public setTranslation(tra: Vector) {\n // #if DIM2\n this.colliderSet.raw.coSetTranslation(this.handle, tra.x, tra.y);\n // #endif\n }\n\n /**\n * Sets the translation of this collider relative to its parent rigid-body.\n *\n * Does nothing if this collider isn't attached to a rigid-body.\n *\n * @param tra - The new translation of the collider relative to its parent.\n */\n public setTranslationWrtParent(tra: Vector) {\n // #if DIM2\n this.colliderSet.raw.coSetTranslationWrtParent(\n this.handle,\n tra.x,\n tra.y,\n );\n // #endif\n }\n\n // #if DIM2\n /**\n * Sets the rotation angle of this collider.\n *\n * @param angle - The rotation angle, in radians.\n */\n public setRotation(angle: number) {\n this.colliderSet.raw.coSetRotation(this.handle, angle);\n }\n\n /**\n * Sets the rotation angle of this collider relative to its parent rigid-body.\n *\n * Does nothing if this collider isn't attached to a rigid-body.\n *\n * @param angle - The rotation angle, in radians.\n */\n public setRotationWrtParent(angle: number) {\n this.colliderSet.raw.coSetRotationWrtParent(this.handle, angle);\n }\n\n // #endif\n\n /**\n * The type of the shape of this collider.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public shapeType(): ShapeType {\n return this.colliderSet.raw.coShapeType(\n this.handle,\n ) as number as ShapeType;\n }\n\n /**\n * The half-extents of this collider if it is a cuboid shape.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public halfExtents(): Vector {\n return VectorOps.fromRaw(\n this.colliderSet.raw.coHalfExtents(this.handle),\n );\n }\n\n /**\n * Sets the half-extents of this collider if it is a cuboid shape.\n *\n * @param newHalfExtents - desired half extents.\n */\n public setHalfExtents(newHalfExtents: Vector) {\n const rawPoint = VectorOps.intoRaw(newHalfExtents);\n this.colliderSet.raw.coSetHalfExtents(this.handle, rawPoint);\n }\n\n /**\n * The radius of this collider if it is a ball, cylinder, capsule, or cone shape.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public radius(): number {\n return this.colliderSet.raw.coRadius(this.handle);\n }\n\n /**\n * Sets the radius of this collider if it is a ball, cylinder, capsule, or cone shape.\n *\n * @param newRadius - desired radius.\n */\n public setRadius(newRadius: number): void {\n this.colliderSet.raw.coSetRadius(this.handle, newRadius);\n }\n\n /**\n * The radius of the round edges of this collider if it is a round cylinder.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public roundRadius(): number {\n return this.colliderSet.raw.coRoundRadius(this.handle);\n }\n\n /**\n * Sets the radius of the round edges of this collider if it has round edges.\n *\n * @param newBorderRadius - desired round edge radius.\n */\n public setRoundRadius(newBorderRadius: number) {\n this.colliderSet.raw.coSetRoundRadius(this.handle, newBorderRadius);\n }\n\n /**\n * The half height of this collider if it is a cylinder, capsule, or cone shape.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public halfHeight(): number {\n return this.colliderSet.raw.coHalfHeight(this.handle);\n }\n\n /**\n * Sets the half height of this collider if it is a cylinder, capsule, or cone shape.\n *\n * @param newHalfheight - desired half height.\n */\n public setHalfHeight(newHalfheight: number) {\n this.colliderSet.raw.coSetHalfHeight(this.handle, newHalfheight);\n }\n\n /**\n * If this collider has a triangle mesh, polyline, convex polygon, or convex polyhedron shape,\n * this returns the vertex buffer of said shape.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public vertices(): Float32Array {\n return this.colliderSet.raw.coVertices(this.handle);\n }\n\n /**\n * If this collider has a triangle mesh, polyline, or convex polyhedron shape,\n * this returns the index buffer of said shape.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public indices(): Uint32Array | undefined {\n return this.colliderSet.raw.coIndices(this.handle);\n }\n\n /**\n * If this collider has a heightfield shape, this returns the heights buffer of\n * the heightfield.\n * In 3D, the returned height matrix is provided in column-major order.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public heightfieldHeights(): Float32Array {\n return this.colliderSet.raw.coHeightfieldHeights(this.handle);\n }\n\n /**\n * If this collider has a heightfield shape, this returns the scale\n * applied to it.\n * @deprecated this field will be removed in the future, please access this field on `shape` member instead.\n */\n public heightfieldScale(): Vector {\n let scale = this.colliderSet.raw.coHeightfieldScale(this.handle);\n return VectorOps.fromRaw(scale);\n }\n\n\n /**\n * The rigid-body this collider is attached to.\n */\n public parent(): RigidBody | null {\n return this._parent;\n }\n\n /**\n * The friction coefficient of this collider.\n */\n public friction(): number {\n return this.colliderSet.raw.coFriction(this.handle);\n }\n\n /**\n * The restitution coefficient of this collider.\n */\n public restitution(): number {\n return this.colliderSet.raw.coRestitution(this.handle);\n }\n\n /**\n * The density of this collider.\n */\n public density(): number {\n return this.colliderSet.raw.coDensity(this.handle);\n }\n\n /**\n * The mass of this collider.\n */\n public mass(): number {\n return this.colliderSet.raw.coMass(this.handle);\n }\n\n /**\n * The volume of this collider.\n */\n public volume(): number {\n return this.colliderSet.raw.coVolume(this.handle);\n }\n\n /**\n * The collision groups of this collider.\n */\n public collisionGroups(): InteractionGroups {\n return this.colliderSet.raw.coCollisionGroups(this.handle);\n }\n\n /**\n * The solver groups of this collider.\n */\n public solverGroups(): InteractionGroups {\n return this.colliderSet.raw.coSolverGroups(this.handle);\n }\n\n /**\n * Tests if this collider contains a point.\n *\n * @param point - The point to test.\n */\n public containsPoint(point: Vector): boolean {\n let rawPoint = VectorOps.intoRaw(point);\n let result = this.colliderSet.raw.coContainsPoint(\n this.handle,\n rawPoint,\n );\n\n rawPoint.free();\n\n return result;\n }\n\n /**\n * Find the projection of a point on this collider.\n *\n * @param point - The point to project.\n * @param solid - If this is set to `true` then the collider shapes are considered to\n * be plain (if the point is located inside of a plain shape, its projection is the point\n * itself). If it is set to `false` the collider shapes are considered to be hollow\n * (if the point is located inside of an hollow shape, it is projected on the shape's\n * boundary).\n */\n public projectPoint(point: Vector, solid: boolean): PointProjection | null {\n let rawPoint = VectorOps.intoRaw(point);\n let result = PointProjection.fromRaw(\n this.colliderSet.raw.coProjectPoint(this.handle, rawPoint, solid),\n );\n\n rawPoint.free();\n\n return result;\n }\n\n /**\n * Tests if this collider intersects the given ray.\n *\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n */\n public intersectsRay(ray: Ray, maxToi: number): boolean {\n let rawOrig = VectorOps.intoRaw(ray.origin);\n let rawDir = VectorOps.intoRaw(ray.dir);\n let result = this.colliderSet.raw.coIntersectsRay(\n this.handle,\n rawOrig,\n rawDir,\n maxToi,\n );\n\n rawOrig.free();\n rawDir.free();\n\n return result;\n }\n\n /*\n * Computes the smallest time between this and the given shape under translational movement are separated by a distance smaller or equal to distance.\n *\n * @param collider1Vel - The constant velocity of the current shape to cast (i.e. the cast direction).\n * @param shape2 - The shape to cast against.\n * @param shape2Pos - The position of the second shape.\n * @param shape2Rot - The rotation of the second shape.\n * @param shape2Vel - The constant velocity of the second shape.\n * @param targetDistance − If the shape moves closer to this distance from a collider, a hit\n * will be returned.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the distance traveled by the shape to `collider1Vel.norm() * maxToi`.\n * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if\n * the shape is penetrating another shape at its starting point **and** its trajectory is such\n * that it’s on a path to exist that penetration state.\n */\n public castShape(\n collider1Vel: Vector,\n shape2: Shape,\n shape2Pos: Vector,\n shape2Rot: Rotation,\n shape2Vel: Vector,\n targetDistance: number,\n maxToi: number,\n stopAtPenetration: boolean,\n ): ShapeCastHit | null {\n let rawCollider1Vel = VectorOps.intoRaw(collider1Vel);\n let rawShape2Pos = VectorOps.intoRaw(shape2Pos);\n let rawShape2Rot = RotationOps.intoRaw(shape2Rot);\n let rawShape2Vel = VectorOps.intoRaw(shape2Vel);\n let rawShape2 = shape2.intoRaw();\n\n let result = ShapeCastHit.fromRaw(\n this.colliderSet,\n this.colliderSet.raw.coCastShape(\n this.handle,\n rawCollider1Vel,\n rawShape2,\n rawShape2Pos,\n rawShape2Rot,\n rawShape2Vel,\n targetDistance,\n maxToi,\n stopAtPenetration,\n ),\n );\n\n rawCollider1Vel.free();\n rawShape2Pos.free();\n rawShape2Rot.free();\n rawShape2Vel.free();\n rawShape2.free();\n\n return result;\n }\n\n /*\n * Computes the smallest time between this and the given collider under translational movement are separated by a distance smaller or equal to distance.\n *\n * @param collider1Vel - The constant velocity of the current collider to cast (i.e. the cast direction).\n * @param collider2 - The collider to cast against.\n * @param collider2Vel - The constant velocity of the second collider.\n * @param targetDistance − If the shape moves closer to this distance from a collider, a hit\n * will be returned.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.\n * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if\n * the shape is penetrating another shape at its starting point **and** its trajectory is such\n * that it’s on a path to exist that penetration state.\n */\n public castCollider(\n collider1Vel: Vector,\n collider2: Collider,\n collider2Vel: Vector,\n targetDistance: number,\n maxToi: number,\n stopAtPenetration: boolean,\n ): ColliderShapeCastHit | null {\n let rawCollider1Vel = VectorOps.intoRaw(collider1Vel);\n let rawCollider2Vel = VectorOps.intoRaw(collider2Vel);\n\n let result = ColliderShapeCastHit.fromRaw(\n this.colliderSet,\n this.colliderSet.raw.coCastCollider(\n this.handle,\n rawCollider1Vel,\n collider2.handle,\n rawCollider2Vel,\n targetDistance,\n maxToi,\n stopAtPenetration,\n ),\n );\n\n rawCollider1Vel.free();\n rawCollider2Vel.free();\n\n return result;\n }\n\n public intersectsShape(\n shape2: Shape,\n shapePos2: Vector,\n shapeRot2: Rotation,\n ): boolean {\n let rawPos2 = VectorOps.intoRaw(shapePos2);\n let rawRot2 = RotationOps.intoRaw(shapeRot2);\n let rawShape2 = shape2.intoRaw();\n\n let result = this.colliderSet.raw.coIntersectsShape(\n this.handle,\n rawShape2,\n rawPos2,\n rawRot2,\n );\n\n rawPos2.free();\n rawRot2.free();\n rawShape2.free();\n\n return result;\n }\n\n /**\n * Computes one pair of contact points between the shape owned by this collider and the given shape.\n *\n * @param shape2 - The second shape.\n * @param shape2Pos - The initial position of the second shape.\n * @param shape2Rot - The rotation of the second shape.\n * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail.\n * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space.\n */\n contactShape(\n shape2: Shape,\n shape2Pos: Vector,\n shape2Rot: Rotation,\n prediction: number,\n ): ShapeContact | null {\n let rawPos2 = VectorOps.intoRaw(shape2Pos);\n let rawRot2 = RotationOps.intoRaw(shape2Rot);\n let rawShape2 = shape2.intoRaw();\n\n let result = ShapeContact.fromRaw(\n this.colliderSet.raw.coContactShape(\n this.handle,\n rawShape2,\n rawPos2,\n rawRot2,\n prediction,\n ),\n );\n\n rawPos2.free();\n rawRot2.free();\n rawShape2.free();\n\n return result;\n }\n\n /**\n * Computes one pair of contact points between the collider and the given collider.\n *\n * @param collider2 - The second collider.\n * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail.\n * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space.\n */\n contactCollider(\n collider2: Collider,\n prediction: number,\n ): ShapeContact | null {\n let result = ShapeContact.fromRaw(\n this.colliderSet.raw.coContactCollider(\n this.handle,\n collider2.handle,\n prediction,\n ),\n );\n\n return result;\n }\n\n /**\n * Find the closest intersection between a ray and this collider.\n *\n * This also computes the normal at the hit point.\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n * @returns The time-of-impact between this collider and the ray, or `-1` if there is no intersection.\n */\n public castRay(ray: Ray, maxToi: number, solid: boolean): number {\n let rawOrig = VectorOps.intoRaw(ray.origin);\n let rawDir = VectorOps.intoRaw(ray.dir);\n let result = this.colliderSet.raw.coCastRay(\n this.handle,\n rawOrig,\n rawDir,\n maxToi,\n solid,\n );\n\n rawOrig.free();\n rawDir.free();\n\n return result;\n }\n\n /**\n * Find the closest intersection between a ray and this collider.\n *\n * This also computes the normal at the hit point.\n * @param ray - The ray to cast.\n * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively\n * limits the length of the ray to `ray.dir.norm() * maxToi`.\n * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its\n * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain,\n * whereas `false` implies that all shapes are hollow for this ray-cast.\n */\n public castRayAndGetNormal(\n ray: Ray,\n maxToi: number,\n solid: boolean,\n ): RayIntersection | null {\n let rawOrig = VectorOps.intoRaw(ray.origin);\n let rawDir = VectorOps.intoRaw(ray.dir);\n let result = RayIntersection.fromRaw(\n this.colliderSet.raw.coCastRayAndGetNormal(\n this.handle,\n rawOrig,\n rawDir,\n maxToi,\n solid,\n ),\n );\n\n rawOrig.free();\n rawDir.free();\n\n return result;\n }\n}\n\nexport enum MassPropsMode {\n Density,\n Mass,\n MassProps,\n}\n\nexport class ColliderDesc {\n enabled: boolean;\n shape: Shape;\n massPropsMode: MassPropsMode;\n mass: number;\n centerOfMass: Vector;\n // #if DIM2\n principalAngularInertia: number;\n rotationsEnabled: boolean;\n // #endif\n density: number;\n friction: number;\n restitution: number;\n rotation: Rotation;\n translation: Vector;\n isSensor: boolean;\n collisionGroups: InteractionGroups;\n solverGroups: InteractionGroups;\n frictionCombineRule: CoefficientCombineRule;\n restitutionCombineRule: CoefficientCombineRule;\n activeEvents: ActiveEvents;\n activeHooks: ActiveHooks;\n activeCollisionTypes: ActiveCollisionTypes;\n contactForceEventThreshold: number;\n contactSkin: number;\n\n /**\n * Initializes a collider descriptor from the collision shape.\n *\n * @param shape - The shape of the collider being built.\n */\n constructor(shape: Shape) {\n this.enabled = true;\n this.shape = shape;\n this.massPropsMode = MassPropsMode.Density;\n this.density = 1.0;\n this.friction = 0.5;\n this.restitution = 0.0;\n this.rotation = RotationOps.identity();\n this.translation = VectorOps.zeros();\n this.isSensor = false;\n this.collisionGroups = 0xffff_ffff;\n this.solverGroups = 0xffff_ffff;\n this.frictionCombineRule = CoefficientCombineRule.Average;\n this.restitutionCombineRule = CoefficientCombineRule.Average;\n this.activeCollisionTypes = ActiveCollisionTypes.DEFAULT;\n this.activeEvents = ActiveEvents.NONE;\n this.activeHooks = ActiveHooks.NONE;\n this.mass = 0.0;\n this.centerOfMass = VectorOps.zeros();\n this.contactForceEventThreshold = 0.0;\n this.contactSkin = 0.0;\n\n // #if DIM2\n this.principalAngularInertia = 0.0;\n this.rotationsEnabled = true;\n // #endif\n }\n\n /**\n * Create a new collider descriptor with a ball shape.\n *\n * @param radius - The radius of the ball.\n */\n public static ball(radius: number): ColliderDesc {\n const shape = new Ball(radius);\n return new ColliderDesc(shape);\n }\n\n /**\n * Create a new collider descriptor with a capsule shape.\n *\n * @param halfHeight - The half-height of the capsule, along the `y` axis.\n * @param radius - The radius of the capsule basis.\n */\n public static capsule(halfHeight: number, radius: number): ColliderDesc {\n const shape = new Capsule(halfHeight, radius);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new segment shape.\n *\n * @param a - The first point of the segment.\n * @param b - The second point of the segment.\n */\n public static segment(a: Vector, b: Vector): ColliderDesc {\n const shape = new Segment(a, b);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new triangle shape.\n *\n * @param a - The first point of the triangle.\n * @param b - The second point of the triangle.\n * @param c - The third point of the triangle.\n */\n public static triangle(a: Vector, b: Vector, c: Vector): ColliderDesc {\n const shape = new Triangle(a, b, c);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new triangle shape with round corners.\n *\n * @param a - The first point of the triangle.\n * @param b - The second point of the triangle.\n * @param c - The third point of the triangle.\n * @param borderRadius - The radius of the borders of this triangle. In 3D,\n * this is also equal to half the thickness of the triangle.\n */\n public static roundTriangle(\n a: Vector,\n b: Vector,\n c: Vector,\n borderRadius: number,\n ): ColliderDesc {\n const shape = new RoundTriangle(a, b, c, borderRadius);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider descriptor with a polyline shape.\n *\n * @param vertices - The coordinates of the polyline's vertices.\n * @param indices - The indices of the polyline's segments. If this is `undefined` or `null`,\n * the vertices are assumed to describe a line strip.\n */\n public static polyline(\n vertices: Float32Array,\n indices?: Uint32Array | null,\n ): ColliderDesc {\n const shape = new Polyline(vertices, indices);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider descriptor with a triangle mesh shape.\n *\n * @param vertices - The coordinates of the triangle mesh's vertices.\n * @param indices - The indices of the triangle mesh's triangles.\n */\n public static trimesh(\n vertices: Float32Array,\n indices: Uint32Array,\n flags?: TriMeshFlags,\n ): ColliderDesc {\n const shape = new TriMesh(vertices, indices, flags);\n return new ColliderDesc(shape);\n }\n\n // #if DIM2\n /**\n * Creates a new collider descriptor with a rectangular shape.\n *\n * @param hx - The half-width of the rectangle along its local `x` axis.\n * @param hy - The half-width of the rectangle along its local `y` axis.\n */\n public static cuboid(hx: number, hy: number): ColliderDesc {\n const shape = new Cuboid(hx, hy);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider descriptor with a rectangular shape with round borders.\n *\n * @param hx - The half-width of the rectangle along its local `x` axis.\n * @param hy - The half-width of the rectangle along its local `y` axis.\n * @param borderRadius - The radius of the cuboid's borders.\n */\n public static roundCuboid(\n hx: number,\n hy: number,\n borderRadius: number,\n ): ColliderDesc {\n const shape = new RoundCuboid(hx, hy, borderRadius);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider description with a halfspace (infinite plane) shape.\n *\n * @param normal - The outward normal of the plane.\n */\n public static halfspace(normal: Vector): ColliderDesc {\n const shape = new HalfSpace(normal);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider descriptor with a heightfield shape.\n *\n * @param heights - The heights of the heightfield, along its local `y` axis.\n * @param scale - The scale factor applied to the heightfield.\n */\n public static heightfield(\n heights: Float32Array,\n scale: Vector,\n ): ColliderDesc {\n const shape = new Heightfield(heights, scale);\n return new ColliderDesc(shape);\n }\n\n /**\n * Computes the convex-hull of the given points and use the resulting\n * convex polygon as the shape for this new collider descriptor.\n *\n * @param points - The point that will be used to compute the convex-hull.\n */\n public static convexHull(points: Float32Array): ColliderDesc | null {\n const shape = new ConvexPolygon(points, false);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider descriptor that uses the given set of points assumed\n * to form a convex polyline (no convex-hull computation will be done).\n *\n * @param vertices - The vertices of the convex polyline.\n */\n public static convexPolyline(vertices: Float32Array): ColliderDesc | null {\n const shape = new ConvexPolygon(vertices, true);\n return new ColliderDesc(shape);\n }\n\n /**\n * Computes the convex-hull of the given points and use the resulting\n * convex polygon as the shape for this new collider descriptor. A\n * border is added to that convex polygon to give it round corners.\n *\n * @param points - The point that will be used to compute the convex-hull.\n * @param borderRadius - The radius of the round border added to the convex polygon.\n */\n public static roundConvexHull(\n points: Float32Array,\n borderRadius: number,\n ): ColliderDesc | null {\n const shape = new RoundConvexPolygon(points, borderRadius, false);\n return new ColliderDesc(shape);\n }\n\n /**\n * Creates a new collider descriptor that uses the given set of points assumed\n * to form a round convex polyline (no convex-hull computation will be done).\n *\n * @param vertices - The vertices of the convex polyline.\n * @param borderRadius - The radius of the round border added to the convex polyline.\n */\n public static roundConvexPolyline(\n vertices: Float32Array,\n borderRadius: number,\n ): ColliderDesc | null {\n const shape = new RoundConvexPolygon(vertices, borderRadius, true);\n return new ColliderDesc(shape);\n }\n\n // #endif\n\n\n // #if DIM2\n /**\n * Sets the position of the collider to be created relative to the rigid-body it is attached to.\n */\n public setTranslation(x: number, y: number): ColliderDesc {\n if (typeof x != \"number\" || typeof y != \"number\")\n throw TypeError(\"The translation components must be numbers.\");\n\n this.translation = {x: x, y: y};\n return this;\n }\n\n // #endif\n\n\n /**\n * Sets the rotation of the collider to be created relative to the rigid-body it is attached to.\n *\n * @param rot - The rotation of the collider to be created relative to the rigid-body it is attached to.\n */\n public setRotation(rot: Rotation): ColliderDesc {\n // #if DIM2\n this.rotation = rot;\n // #endif\n return this;\n }\n\n /**\n * Sets whether or not the collider being created is a sensor.\n *\n * A sensor collider does not take part of the physics simulation, but generates\n * proximity events.\n *\n * @param sensor - Set to `true` of the collider built is to be a sensor.\n */\n public setSensor(sensor: boolean): ColliderDesc {\n this.isSensor = sensor;\n return this;\n }\n\n /**\n * Sets whether the created collider will be enabled or disabled.\n * @param enabled − If set to `false` the collider will be disabled at creation.\n */\n public setEnabled(enabled: boolean): ColliderDesc {\n this.enabled = enabled;\n return this;\n }\n\n /**\n * Sets the contact skin of the collider.\n *\n * The contact skin acts as if the collider was enlarged with a skin of width `skin_thickness`\n * around it, keeping objects further apart when colliding.\n *\n * A non-zero contact skin can increase performance, and in some cases, stability. However\n * it creates a small gap between colliding object (equal to the sum of their skin). If the\n * skin is sufficiently small, this might not be visually significant or can be hidden by the\n * rendering assets.\n */\n public setContactSkin(thickness: number): ColliderDesc {\n this.contactSkin = thickness;\n return this;\n }\n\n /**\n * Sets the density of the collider being built.\n *\n * The mass and angular inertia tensor will be computed automatically based on this density and the collider’s shape.\n *\n * @param density - The density to set, must be greater or equal to 0. A density of 0 means that this collider\n * will not affect the mass or angular inertia of the rigid-body it is attached to.\n */\n public setDensity(density: number): ColliderDesc {\n this.massPropsMode = MassPropsMode.Density;\n this.density = density;\n return this;\n }\n\n /**\n * Sets the mass of the collider being built.\n *\n * The angular inertia tensor will be computed automatically based on this mass and the collider’s shape.\n *\n * @param mass - The mass to set, must be greater or equal to 0.\n */\n public setMass(mass: number): ColliderDesc {\n this.massPropsMode = MassPropsMode.Mass;\n this.mass = mass;\n return this;\n }\n\n // #if DIM2\n /**\n * Sets the mass properties of the collider being built.\n *\n * This replaces the mass-properties automatically computed from the collider's density and shape.\n * These mass-properties will be added to the mass-properties of the rigid-body this collider will be attached to.\n *\n * @param mass − The mass of the collider to create.\n * @param centerOfMass − The center-of-mass of the collider to create.\n * @param principalAngularInertia − The principal angular inertia of the collider to create.\n */\n public setMassProperties(\n mass: number,\n centerOfMass: Vector,\n principalAngularInertia: number,\n ): ColliderDesc {\n this.massPropsMode = MassPropsMode.MassProps;\n this.mass = mass;\n VectorOps.copy(this.centerOfMass, centerOfMass);\n this.principalAngularInertia = principalAngularInertia;\n return this;\n }\n\n // #endif\n\n\n /**\n * Sets the restitution coefficient of the collider to be created.\n *\n * @param restitution - The restitution coefficient in `[0, 1]`. A value of 0 (the default) means no bouncing behavior\n * while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the\n * constraints solver).\n */\n public setRestitution(restitution: number): ColliderDesc {\n this.restitution = restitution;\n return this;\n }\n\n /**\n * Sets the friction coefficient of the collider to be created.\n *\n * @param friction - The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The\n * higher the coefficient, the stronger friction forces will be for contacts with the collider\n * being built.\n */\n public setFriction(friction: number): ColliderDesc {\n this.friction = friction;\n return this;\n }\n\n /**\n * Sets the rule used to combine the friction coefficients of two colliders\n * colliders involved in a contact.\n *\n * @param rule − The combine rule to apply.\n */\n public setFrictionCombineRule(rule: CoefficientCombineRule): ColliderDesc {\n this.frictionCombineRule = rule;\n return this;\n }\n\n /**\n * Sets the rule used to combine the restitution coefficients of two colliders\n * colliders involved in a contact.\n *\n * @param rule − The combine rule to apply.\n */\n public setRestitutionCombineRule(\n rule: CoefficientCombineRule,\n ): ColliderDesc {\n this.restitutionCombineRule = rule;\n return this;\n }\n\n /**\n * Sets the collision groups used by this collider.\n *\n * Two colliders will interact iff. their collision groups are compatible.\n * See the documentation of `InteractionGroups` for details on teh used bit pattern.\n *\n * @param groups - The collision groups used for the collider being built.\n */\n public setCollisionGroups(groups: InteractionGroups): ColliderDesc {\n this.collisionGroups = groups;\n return this;\n }\n\n /**\n * Sets the solver groups used by this collider.\n *\n * Forces between two colliders in contact will be computed iff their solver\n * groups are compatible.\n * See the documentation of `InteractionGroups` for details on the used bit pattern.\n *\n * @param groups - The solver groups used for the collider being built.\n */\n public setSolverGroups(groups: InteractionGroups): ColliderDesc {\n this.solverGroups = groups;\n return this;\n }\n\n /**\n * Set the physics hooks active for this collider.\n *\n * Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider.\n *\n * @param activeHooks - The hooks active for contact/intersection pairs involving this collider.\n */\n public setActiveHooks(activeHooks: ActiveHooks): ColliderDesc {\n this.activeHooks = activeHooks;\n return this;\n }\n\n /**\n * Set the events active for this collider.\n *\n * Use this to enable contact and/or intersection event reporting for this collider.\n *\n * @param activeEvents - The events active for contact/intersection pairs involving this collider.\n */\n public setActiveEvents(activeEvents: ActiveEvents): ColliderDesc {\n this.activeEvents = activeEvents;\n return this;\n }\n\n /**\n * Set the collision types active for this collider.\n *\n * @param activeCollisionTypes - The hooks active for contact/intersection pairs involving this collider.\n */\n public setActiveCollisionTypes(\n activeCollisionTypes: ActiveCollisionTypes,\n ): ColliderDesc {\n this.activeCollisionTypes = activeCollisionTypes;\n return this;\n }\n\n /**\n * Sets the total force magnitude beyond which a contact force event can be emitted.\n *\n * @param threshold - The force threshold to set.\n */\n public setContactForceEventThreshold(threshold: number): ColliderDesc {\n this.contactForceEventThreshold = threshold;\n return this;\n }\n}\n", "import {RawColliderSet} from \"../raw\";\nimport {Coarena} from \"../coarena\";\nimport {RotationOps, VectorOps} from \"../math\";\nimport {Collider, ColliderDesc, ColliderHandle} from \"./collider\";\nimport {ImpulseJointHandle, IslandManager, RigidBodyHandle} from \"../dynamics\";\nimport {RigidBodySet} from \"../dynamics\";\n\n/**\n * A set of rigid bodies that can be handled by a physics pipeline.\n *\n * To avoid leaking WASM resources, this MUST be freed manually with `colliderSet.free()`\n * once you are done using it (and all the rigid-bodies it created).\n */\nexport class ColliderSet {\n raw: RawColliderSet;\n private map: Coarena<Collider>;\n\n /**\n * Release the WASM memory occupied by this collider set.\n */\n public free() {\n if (!!this.raw) {\n this.raw.free();\n }\n this.raw = undefined;\n\n if (!!this.map) {\n this.map.clear();\n }\n this.map = undefined;\n }\n\n constructor(raw?: RawColliderSet) {\n this.raw = raw || new RawColliderSet();\n this.map = new Coarena<Collider>();\n // Initialize the map with the existing elements, if any.\n if (raw) {\n raw.forEachColliderHandle((handle: ColliderHandle) => {\n this.map.set(handle, new Collider(this, handle, null));\n });\n }\n }\n\n /** @internal */\n public castClosure<Res>(\n f?: (collider: Collider) => Res,\n ): (handle: ColliderHandle) => Res | undefined {\n return (handle) => {\n if (!!f) {\n return f(this.get(handle));\n } else {\n return undefined;\n }\n };\n }\n\n /** @internal */\n public finalizeDeserialization(bodies: RigidBodySet) {\n this.map.forEach((collider) =>\n collider.finalizeDeserialization(bodies),\n );\n }\n\n /**\n * Creates a new collider and return its integer handle.\n *\n * @param bodies - The set of bodies where the collider's parent can be found.\n * @param desc - The collider's description.\n * @param parentHandle - The integer handle of the rigid-body this collider is attached to.\n */\n public createCollider(\n bodies: RigidBodySet,\n desc: ColliderDesc,\n parentHandle: RigidBodyHandle,\n ): Collider {\n let hasParent = parentHandle != undefined && parentHandle != null;\n\n if (hasParent && isNaN(parentHandle))\n throw Error(\n \"Cannot create a collider with a parent rigid-body handle that is not a number.\",\n );\n\n let rawShape = desc.shape.intoRaw();\n let rawTra = VectorOps.intoRaw(desc.translation);\n let rawRot = RotationOps.intoRaw(desc.rotation);\n let rawCom = VectorOps.intoRaw(desc.centerOfMass);\n\n\n let handle = this.raw.createCollider(\n desc.enabled,\n rawShape,\n rawTra,\n rawRot,\n desc.massPropsMode,\n desc.mass,\n rawCom,\n // #if DIM2\n desc.principalAngularInertia,\n // #endif\n desc.density,\n desc.friction,\n desc.restitution,\n desc.frictionCombineRule,\n desc.restitutionCombineRule,\n desc.isSensor,\n desc.collisionGroups,\n desc.solverGroups,\n desc.activeCollisionTypes,\n desc.activeHooks,\n desc.activeEvents,\n desc.contactForceEventThreshold,\n desc.contactSkin,\n hasParent,\n hasParent ? parentHandle : 0,\n bodies.raw,\n );\n\n rawShape.free();\n rawTra.free();\n rawRot.free();\n rawCom.free();\n\n\n let parent = hasParent ? bodies.get(parentHandle) : null;\n let collider = new Collider(this, handle, parent, desc.shape);\n this.map.set(handle, collider);\n return collider;\n }\n\n /**\n * Remove a collider from this set.\n *\n * @param handle - The integer handle of the collider to remove.\n * @param bodies - The set of rigid-body containing the rigid-body the collider is attached to.\n * @param wakeUp - If `true`, the rigid-body the removed collider is attached to will be woken-up automatically.\n */\n public remove(\n handle: ColliderHandle,\n islands: IslandManager,\n bodies: RigidBodySet,\n wakeUp: boolean,\n ) {\n this.raw.remove(handle, islands.raw, bodies.raw, wakeUp);\n this.unmap(handle);\n }\n\n /**\n * Internal function, do not call directly.\n * @param handle\n */\n public unmap(handle: ImpulseJointHandle) {\n this.map.delete(handle);\n }\n\n /**\n * Gets the rigid-body with the given handle.\n *\n * @param handle - The handle of the rigid-body to retrieve.\n */\n public get(handle: ColliderHandle): Collider | null {\n return this.map.get(handle);\n }\n\n /**\n * The number of colliders on this set.\n */\n public len(): number {\n return this.map.len();\n }\n\n /**\n * Does this set contain a collider with the given handle?\n *\n * @param handle - The collider handle to check.\n */\n public contains(handle: ColliderHandle): boolean {\n return this.get(handle) != null;\n }\n\n /**\n * Applies the given closure to each collider contained by this set.\n *\n * @param f - The closure to apply.\n */\n public forEach(f: (collider: Collider) => void) {\n this.map.forEach(f);\n }\n\n /**\n * Gets all colliders in the list.\n *\n * @returns collider list.\n */\n public getAll(): Collider[] {\n return this.map.getAll();\n }\n}\n", "import * as RAPIER from \"./exports\";\nexport * from \"./exports\";\nexport default RAPIER;\n"],
55- "mappings": ";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAAA;;;;ACAA,YAAYC,WAAU;;;ACAtB,IAAI;AACG,SAAS,eAAe,KAAK;AAChC,SAAO;AACX;AAGA,IAAM,OAAO,IAAI,MAAM,GAAG,EAAE,KAAK,MAAS;AAE1C,KAAK,KAAK,QAAW,MAAM,MAAM,KAAK;AAEtC,IAAI,YAAY,KAAK;AAErB,SAAS,cAAc,KA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,WAAO,KAAK,IAAI,IAAG;EACvB;;;;;;EAOO,SAAS,QAAsB;AAClC,WAAO,KAAK,IAAI,MAAM,KAAK;EAC/B;;;;;;EAOO,QAAQ,GAA+B;AAC1C,SAAK,IAAI,QAAQ,CAAC;EACtB;;;;;;EAOO,SAAM;AACT,WAAO,KAAK,IAAI,OAAM;EAC1B;;;;AhCjME,SAAUC,WAAO;AACnB,SAAO,QAAI;AACf;;;AiCFA,IAAA,iBAAe;",
66- "names": ["version", "wasm", "wasm", "RigidBodyType", "handle", "JointType", "MotorModel", "JointAxesMask", "CoefficientCombineRule", "FeatureType", "ShapeType", "TriMeshFlags", "QueryFilterFlags", "ActiveEvents", "ActiveHooks", "SolverFlags", "ActiveCollisionTypes", "MassPropsMode", "version"]
77-}