[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/
browsergame pixijs rapier2d roguelike shoot-em-up typescript webgame
0

Configure Feed

Select the types of activity you want to include in your feed.

some cleanup

Florian (Jul 22, 2024, 4:22 AM +0200) cf0b2924 012fed02

+49 -10032
+3 -1
.gitignore
··· 1 - node_modules 1 + node_modules 2 + .vite 3 + dist
-9978
.vite/deps/@dimforge_rapier2d.js
··· 1 - var __defProp = Object.defineProperty; 2 - var __export = (target, all) => { 3 - for (var name in all) 4 - __defProp(target, name, { get: all[name], enumerable: true }); 5 - }; 6 - 7 - // ../node_modules/@dimforge/rapier2d/exports.js 8 - var exports_exports = {}; 9 - __export(exports_exports, { 10 - ActiveCollisionTypes: () => ActiveCollisionTypes, 11 - ActiveEvents: () => ActiveEvents, 12 - ActiveHooks: () => ActiveHooks, 13 - Ball: () => Ball, 14 - BroadPhase: () => BroadPhase, 15 - CCDSolver: () => CCDSolver, 16 - Capsule: () => Capsule, 17 - CharacterCollision: () => CharacterCollision, 18 - CoefficientCombineRule: () => CoefficientCombineRule, 19 - Collider: () => Collider, 20 - ColliderDesc: () => ColliderDesc, 21 - ColliderSet: () => ColliderSet, 22 - ColliderShapeCastHit: () => ColliderShapeCastHit, 23 - ConvexPolygon: () => ConvexPolygon, 24 - Cuboid: () => Cuboid, 25 - DebugRenderBuffers: () => DebugRenderBuffers, 26 - DebugRenderPipeline: () => DebugRenderPipeline, 27 - EventQueue: () => EventQueue, 28 - FeatureType: () => FeatureType, 29 - FixedImpulseJoint: () => FixedImpulseJoint, 30 - FixedMultibodyJoint: () => FixedMultibodyJoint, 31 - HalfSpace: () => HalfSpace, 32 - Heightfield: () => Heightfield, 33 - ImpulseJoint: () => ImpulseJoint, 34 - ImpulseJointSet: () => ImpulseJointSet, 35 - IntegrationParameters: () => IntegrationParameters, 36 - IslandManager: () => IslandManager, 37 - JointAxesMask: () => JointAxesMask, 38 - JointData: () => JointData, 39 - JointType: () => JointType, 40 - KinematicCharacterController: () => KinematicCharacterController, 41 - MassPropsMode: () => MassPropsMode, 42 - MotorModel: () => MotorModel, 43 - MultibodyJoint: () => MultibodyJoint, 44 - MultibodyJointSet: () => MultibodyJointSet, 45 - NarrowPhase: () => NarrowPhase, 46 - PhysicsPipeline: () => PhysicsPipeline, 47 - PointColliderProjection: () => PointColliderProjection, 48 - PointProjection: () => PointProjection, 49 - Polyline: () => Polyline, 50 - PrismaticImpulseJoint: () => PrismaticImpulseJoint, 51 - PrismaticMultibodyJoint: () => PrismaticMultibodyJoint, 52 - QueryFilterFlags: () => QueryFilterFlags, 53 - QueryPipeline: () => QueryPipeline, 54 - Ray: () => Ray, 55 - RayColliderHit: () => RayColliderHit, 56 - RayColliderIntersection: () => RayColliderIntersection, 57 - RayIntersection: () => RayIntersection, 58 - RevoluteImpulseJoint: () => RevoluteImpulseJoint, 59 - RevoluteMultibodyJoint: () => RevoluteMultibodyJoint, 60 - RigidBody: () => RigidBody, 61 - RigidBodyDesc: () => RigidBodyDesc, 62 - RigidBodySet: () => RigidBodySet, 63 - RigidBodyType: () => RigidBodyType, 64 - RopeImpulseJoint: () => RopeImpulseJoint, 65 - RotationOps: () => RotationOps, 66 - RoundConvexPolygon: () => RoundConvexPolygon, 67 - RoundCuboid: () => RoundCuboid, 68 - RoundTriangle: () => RoundTriangle, 69 - Segment: () => Segment, 70 - SerializationPipeline: () => SerializationPipeline, 71 - Shape: () => Shape, 72 - ShapeCastHit: () => ShapeCastHit, 73 - ShapeContact: () => ShapeContact, 74 - ShapeType: () => ShapeType, 75 - SolverFlags: () => SolverFlags, 76 - SpringImpulseJoint: () => SpringImpulseJoint, 77 - TempContactForceEvent: () => TempContactForceEvent, 78 - TempContactManifold: () => TempContactManifold, 79 - TriMesh: () => TriMesh, 80 - TriMeshFlags: () => TriMeshFlags, 81 - Triangle: () => Triangle, 82 - UnitImpulseJoint: () => UnitImpulseJoint, 83 - UnitMultibodyJoint: () => UnitMultibodyJoint, 84 - Vector2: () => Vector2, 85 - VectorOps: () => VectorOps, 86 - World: () => World, 87 - version: () => version2 88 - }); 89 - 90 - // ../node_modules/@dimforge/rapier2d/rapier_wasm2d.js 91 - import * as wasm2 from "/Users/florian/Code/Square-Survivor/node_modules/@dimforge/rapier2d/rapier_wasm2d_bg.wasm"; 92 - 93 - // ../node_modules/@dimforge/rapier2d/rapier_wasm2d_bg.js 94 - var wasm; 95 - function __wbg_set_wasm(val) { 96 - wasm = val; 97 - } 98 - var heap = new Array(128).fill(void 0); 99 - heap.push(void 0, null, true, false); 100 - var heap_next = heap.length; 101 - function addHeapObject(obj) { 102 - if (heap_next === heap.length) heap.push(heap.length + 1); 103 - const idx = heap_next; 104 - heap_next = heap[idx]; 105 - heap[idx] = obj; 106 - return idx; 107 - } 108 - function getObject(idx) { 109 - return heap[idx]; 110 - } 111 - function dropObject(idx) { 112 - if (idx < 132) return; 113 - heap[idx] = heap_next; 114 - heap_next = idx; 115 - } 116 - function takeObject(idx) { 117 - const ret = getObject(idx); 118 - dropObject(idx); 119 - return ret; 120 - } 121 - function isLikeNone(x) { 122 - return x === void 0 || x === null; 123 - } 124 - var cachedFloat64Memory0 = null; 125 - function getFloat64Memory0() { 126 - if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { 127 - cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); 128 - } 129 - return cachedFloat64Memory0; 130 - } 131 - var cachedInt32Memory0 = null; 132 - function getInt32Memory0() { 133 - if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { 134 - cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); 135 - } 136 - return cachedInt32Memory0; 137 - } 138 - var lTextDecoder = typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder; 139 - var cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true }); 140 - cachedTextDecoder.decode(); 141 - var cachedUint8Memory0 = null; 142 - function getUint8Memory0() { 143 - if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { 144 - cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); 145 - } 146 - return cachedUint8Memory0; 147 - } 148 - function getStringFromWasm0(ptr, len) { 149 - ptr = ptr >>> 0; 150 - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); 151 - } 152 - function version() { 153 - let deferred1_0; 154 - let deferred1_1; 155 - try { 156 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 157 - wasm.version(retptr); 158 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 159 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 160 - deferred1_0 = r0; 161 - deferred1_1 = r1; 162 - return getStringFromWasm0(r0, r1); 163 - } finally { 164 - wasm.__wbindgen_add_to_stack_pointer(16); 165 - wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); 166 - } 167 - } 168 - function _assertClass(instance, klass) { 169 - if (!(instance instanceof klass)) { 170 - throw new Error(`expected instance of ${klass.name}`); 171 - } 172 - return instance.ptr; 173 - } 174 - var cachedFloat32Memory0 = null; 175 - function getFloat32Memory0() { 176 - if (cachedFloat32Memory0 === null || cachedFloat32Memory0.byteLength === 0) { 177 - cachedFloat32Memory0 = new Float32Array(wasm.memory.buffer); 178 - } 179 - return cachedFloat32Memory0; 180 - } 181 - var stack_pointer = 128; 182 - function addBorrowedObject(obj) { 183 - if (stack_pointer == 1) throw new Error("out of js stack"); 184 - heap[--stack_pointer] = obj; 185 - return stack_pointer; 186 - } 187 - function getArrayF32FromWasm0(ptr, len) { 188 - ptr = ptr >>> 0; 189 - return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len); 190 - } 191 - var cachedUint32Memory0 = null; 192 - function getUint32Memory0() { 193 - if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) { 194 - cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer); 195 - } 196 - return cachedUint32Memory0; 197 - } 198 - function getArrayU32FromWasm0(ptr, len) { 199 - ptr = ptr >>> 0; 200 - return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len); 201 - } 202 - var WASM_VECTOR_LEN = 0; 203 - function passArrayF32ToWasm0(arg, malloc) { 204 - const ptr = malloc(arg.length * 4, 4) >>> 0; 205 - getFloat32Memory0().set(arg, ptr / 4); 206 - WASM_VECTOR_LEN = arg.length; 207 - return ptr; 208 - } 209 - function passArray32ToWasm0(arg, malloc) { 210 - const ptr = malloc(arg.length * 4, 4) >>> 0; 211 - getUint32Memory0().set(arg, ptr / 4); 212 - WASM_VECTOR_LEN = arg.length; 213 - return ptr; 214 - } 215 - 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" }); 216 - var RawFeatureType = Object.freeze({ Vertex: 0, "0": "Vertex", Face: 1, "1": "Face", Unknown: 2, "2": "Unknown" }); 217 - var RawRigidBodyType = Object.freeze({ Dynamic: 0, "0": "Dynamic", Fixed: 1, "1": "Fixed", KinematicPositionBased: 2, "2": "KinematicPositionBased", KinematicVelocityBased: 3, "3": "KinematicVelocityBased" }); 218 - 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" }); 219 - var RawJointAxis = Object.freeze({ X: 0, "0": "X", Y: 1, "1": "Y", AngX: 2, "2": "AngX" }); 220 - var RawMotorModel = Object.freeze({ AccelerationBased: 0, "0": "AccelerationBased", ForceBased: 1, "1": "ForceBased" }); 221 - var RawBroadPhase = class _RawBroadPhase { 222 - static __wrap(ptr) { 223 - ptr = ptr >>> 0; 224 - const obj = Object.create(_RawBroadPhase.prototype); 225 - obj.__wbg_ptr = ptr; 226 - return obj; 227 - } 228 - __destroy_into_raw() { 229 - const ptr = this.__wbg_ptr; 230 - this.__wbg_ptr = 0; 231 - return ptr; 232 - } 233 - free() { 234 - const ptr = this.__destroy_into_raw(); 235 - wasm.__wbg_rawbroadphase_free(ptr); 236 - } 237 - /** 238 - */ 239 - constructor() { 240 - const ret = wasm.rawbroadphase_new(); 241 - this.__wbg_ptr = ret >>> 0; 242 - return this; 243 - } 244 - }; 245 - var RawCCDSolver = class { 246 - __destroy_into_raw() { 247 - const ptr = this.__wbg_ptr; 248 - this.__wbg_ptr = 0; 249 - return ptr; 250 - } 251 - free() { 252 - const ptr = this.__destroy_into_raw(); 253 - wasm.__wbg_rawccdsolver_free(ptr); 254 - } 255 - /** 256 - */ 257 - constructor() { 258 - const ret = wasm.rawccdsolver_new(); 259 - this.__wbg_ptr = ret >>> 0; 260 - return this; 261 - } 262 - }; 263 - var RawCharacterCollision = class { 264 - __destroy_into_raw() { 265 - const ptr = this.__wbg_ptr; 266 - this.__wbg_ptr = 0; 267 - return ptr; 268 - } 269 - free() { 270 - const ptr = this.__destroy_into_raw(); 271 - wasm.__wbg_rawcharactercollision_free(ptr); 272 - } 273 - /** 274 - */ 275 - constructor() { 276 - const ret = wasm.rawcharactercollision_new(); 277 - this.__wbg_ptr = ret >>> 0; 278 - return this; 279 - } 280 - /** 281 - * @returns {number} 282 - */ 283 - handle() { 284 - const ret = wasm.rawcharactercollision_handle(this.__wbg_ptr); 285 - return ret; 286 - } 287 - /** 288 - * @returns {RawVector} 289 - */ 290 - translationDeltaApplied() { 291 - const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr); 292 - return RawVector.__wrap(ret); 293 - } 294 - /** 295 - * @returns {RawVector} 296 - */ 297 - translationDeltaRemaining() { 298 - const ret = wasm.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr); 299 - return RawVector.__wrap(ret); 300 - } 301 - /** 302 - * @returns {number} 303 - */ 304 - toi() { 305 - const ret = wasm.rawcharactercollision_toi(this.__wbg_ptr); 306 - return ret; 307 - } 308 - /** 309 - * @returns {RawVector} 310 - */ 311 - worldWitness1() { 312 - const ret = wasm.rawcharactercollision_worldWitness1(this.__wbg_ptr); 313 - return RawVector.__wrap(ret); 314 - } 315 - /** 316 - * @returns {RawVector} 317 - */ 318 - worldWitness2() { 319 - const ret = wasm.rawcharactercollision_worldWitness2(this.__wbg_ptr); 320 - return RawVector.__wrap(ret); 321 - } 322 - /** 323 - * @returns {RawVector} 324 - */ 325 - worldNormal1() { 326 - const ret = wasm.rawcharactercollision_worldNormal1(this.__wbg_ptr); 327 - return RawVector.__wrap(ret); 328 - } 329 - /** 330 - * @returns {RawVector} 331 - */ 332 - worldNormal2() { 333 - const ret = wasm.rawcharactercollision_worldNormal2(this.__wbg_ptr); 334 - return RawVector.__wrap(ret); 335 - } 336 - }; 337 - var RawColliderSet = class _RawColliderSet { 338 - static __wrap(ptr) { 339 - ptr = ptr >>> 0; 340 - const obj = Object.create(_RawColliderSet.prototype); 341 - obj.__wbg_ptr = ptr; 342 - return obj; 343 - } 344 - __destroy_into_raw() { 345 - const ptr = this.__wbg_ptr; 346 - this.__wbg_ptr = 0; 347 - return ptr; 348 - } 349 - free() { 350 - const ptr = this.__destroy_into_raw(); 351 - wasm.__wbg_rawcolliderset_free(ptr); 352 - } 353 - /** 354 - * The world-space translation of this collider. 355 - * @param {number} handle 356 - * @returns {RawVector} 357 - */ 358 - coTranslation(handle) { 359 - const ret = wasm.rawcolliderset_coTranslation(this.__wbg_ptr, handle); 360 - return RawVector.__wrap(ret); 361 - } 362 - /** 363 - * The world-space orientation of this collider. 364 - * @param {number} handle 365 - * @returns {RawRotation} 366 - */ 367 - coRotation(handle) { 368 - const ret = wasm.rawcolliderset_coRotation(this.__wbg_ptr, handle); 369 - return RawRotation.__wrap(ret); 370 - } 371 - /** 372 - * Sets the translation of this collider. 373 - * 374 - * # Parameters 375 - * - `x`: the world-space position of the collider along the `x` axis. 376 - * - `y`: the world-space position of the collider along the `y` axis. 377 - * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it 378 - * wasn't moving before modifying its position. 379 - * @param {number} handle 380 - * @param {number} x 381 - * @param {number} y 382 - */ 383 - coSetTranslation(handle, x, y) { 384 - wasm.rawcolliderset_coSetTranslation(this.__wbg_ptr, handle, x, y); 385 - } 386 - /** 387 - * @param {number} handle 388 - * @param {number} x 389 - * @param {number} y 390 - */ 391 - coSetTranslationWrtParent(handle, x, y) { 392 - wasm.rawcolliderset_coSetTranslationWrtParent(this.__wbg_ptr, handle, x, y); 393 - } 394 - /** 395 - * Sets the rotation angle of this collider. 396 - * 397 - * # Parameters 398 - * - `angle`: the rotation angle, in radians. 399 - * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it 400 - * wasn't moving before modifying its position. 401 - * @param {number} handle 402 - * @param {number} angle 403 - */ 404 - coSetRotation(handle, angle) { 405 - wasm.rawcolliderset_coSetRotation(this.__wbg_ptr, handle, angle); 406 - } 407 - /** 408 - * @param {number} handle 409 - * @param {number} angle 410 - */ 411 - coSetRotationWrtParent(handle, angle) { 412 - wasm.rawcolliderset_coSetRotationWrtParent(this.__wbg_ptr, handle, angle); 413 - } 414 - /** 415 - * Is this collider a sensor? 416 - * @param {number} handle 417 - * @returns {boolean} 418 - */ 419 - coIsSensor(handle) { 420 - const ret = wasm.rawcolliderset_coIsSensor(this.__wbg_ptr, handle); 421 - return ret !== 0; 422 - } 423 - /** 424 - * The type of the shape of this collider. 425 - * @param {number} handle 426 - * @returns {RawShapeType} 427 - */ 428 - coShapeType(handle) { 429 - const ret = wasm.rawcolliderset_coShapeType(this.__wbg_ptr, handle); 430 - return ret; 431 - } 432 - /** 433 - * @param {number} handle 434 - * @returns {RawVector | undefined} 435 - */ 436 - coHalfspaceNormal(handle) { 437 - const ret = wasm.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, handle); 438 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 439 - } 440 - /** 441 - * The half-extents of this collider if it is has a cuboid shape. 442 - * @param {number} handle 443 - * @returns {RawVector | undefined} 444 - */ 445 - coHalfExtents(handle) { 446 - const ret = wasm.rawcolliderset_coHalfExtents(this.__wbg_ptr, handle); 447 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 448 - } 449 - /** 450 - * Set the half-extents of this collider if it has a cuboid shape. 451 - * @param {number} handle 452 - * @param {RawVector} newHalfExtents 453 - */ 454 - coSetHalfExtents(handle, newHalfExtents) { 455 - _assertClass(newHalfExtents, RawVector); 456 - wasm.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, handle, newHalfExtents.__wbg_ptr); 457 - } 458 - /** 459 - * The radius of this collider if it is a ball, capsule, cylinder, or cone shape. 460 - * @param {number} handle 461 - * @returns {number | undefined} 462 - */ 463 - coRadius(handle) { 464 - try { 465 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 466 - wasm.rawcolliderset_coRadius(retptr, this.__wbg_ptr, handle); 467 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 468 - var r1 = getFloat32Memory0()[retptr / 4 + 1]; 469 - return r0 === 0 ? void 0 : r1; 470 - } finally { 471 - wasm.__wbindgen_add_to_stack_pointer(16); 472 - } 473 - } 474 - /** 475 - * Set the radius of this collider if it is a ball, capsule, cylinder, or cone shape. 476 - * @param {number} handle 477 - * @param {number} newRadius 478 - */ 479 - coSetRadius(handle, newRadius) { 480 - wasm.rawcolliderset_coSetRadius(this.__wbg_ptr, handle, newRadius); 481 - } 482 - /** 483 - * The half height of this collider if it is a capsule, cylinder, or cone shape. 484 - * @param {number} handle 485 - * @returns {number | undefined} 486 - */ 487 - coHalfHeight(handle) { 488 - try { 489 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 490 - wasm.rawcolliderset_coHalfHeight(retptr, this.__wbg_ptr, handle); 491 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 492 - var r1 = getFloat32Memory0()[retptr / 4 + 1]; 493 - return r0 === 0 ? void 0 : r1; 494 - } finally { 495 - wasm.__wbindgen_add_to_stack_pointer(16); 496 - } 497 - } 498 - /** 499 - * Set the half height of this collider if it is a capsule, cylinder, or cone shape. 500 - * @param {number} handle 501 - * @param {number} newHalfheight 502 - */ 503 - coSetHalfHeight(handle, newHalfheight) { 504 - wasm.rawcolliderset_coSetHalfHeight(this.__wbg_ptr, handle, newHalfheight); 505 - } 506 - /** 507 - * The radius of the round edges of this collider. 508 - * @param {number} handle 509 - * @returns {number | undefined} 510 - */ 511 - coRoundRadius(handle) { 512 - try { 513 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 514 - wasm.rawcolliderset_coRoundRadius(retptr, this.__wbg_ptr, handle); 515 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 516 - var r1 = getFloat32Memory0()[retptr / 4 + 1]; 517 - return r0 === 0 ? void 0 : r1; 518 - } finally { 519 - wasm.__wbindgen_add_to_stack_pointer(16); 520 - } 521 - } 522 - /** 523 - * Set the radius of the round edges of this collider. 524 - * @param {number} handle 525 - * @param {number} newBorderRadius 526 - */ 527 - coSetRoundRadius(handle, newBorderRadius) { 528 - wasm.rawcolliderset_coSetRoundRadius(this.__wbg_ptr, handle, newBorderRadius); 529 - } 530 - /** 531 - * The vertices of this triangle mesh, polyline, convex polyhedron, segment, triangle or convex polyhedron, if it is one. 532 - * @param {number} handle 533 - * @returns {Float32Array | undefined} 534 - */ 535 - coVertices(handle) { 536 - try { 537 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 538 - wasm.rawcolliderset_coVertices(retptr, this.__wbg_ptr, handle); 539 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 540 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 541 - let v1; 542 - if (r0 !== 0) { 543 - v1 = getArrayF32FromWasm0(r0, r1).slice(); 544 - wasm.__wbindgen_free(r0, r1 * 4, 4); 545 - } 546 - return v1; 547 - } finally { 548 - wasm.__wbindgen_add_to_stack_pointer(16); 549 - } 550 - } 551 - /** 552 - * The indices of this triangle mesh, polyline, or convex polyhedron, if it is one. 553 - * @param {number} handle 554 - * @returns {Uint32Array | undefined} 555 - */ 556 - coIndices(handle) { 557 - try { 558 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 559 - wasm.rawcolliderset_coIndices(retptr, this.__wbg_ptr, handle); 560 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 561 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 562 - let v1; 563 - if (r0 !== 0) { 564 - v1 = getArrayU32FromWasm0(r0, r1).slice(); 565 - wasm.__wbindgen_free(r0, r1 * 4, 4); 566 - } 567 - return v1; 568 - } finally { 569 - wasm.__wbindgen_add_to_stack_pointer(16); 570 - } 571 - } 572 - /** 573 - * @param {number} handle 574 - * @returns {number | undefined} 575 - */ 576 - coTriMeshFlags(handle) { 577 - try { 578 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 579 - wasm.rawcolliderset_coTriMeshFlags(retptr, this.__wbg_ptr, handle); 580 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 581 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 582 - return r0 === 0 ? void 0 : r1 >>> 0; 583 - } finally { 584 - wasm.__wbindgen_add_to_stack_pointer(16); 585 - } 586 - } 587 - /** 588 - * The height of this heightfield if it is one. 589 - * @param {number} handle 590 - * @returns {Float32Array | undefined} 591 - */ 592 - coHeightfieldHeights(handle) { 593 - try { 594 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 595 - wasm.rawcolliderset_coHeightfieldHeights(retptr, this.__wbg_ptr, handle); 596 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 597 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 598 - let v1; 599 - if (r0 !== 0) { 600 - v1 = getArrayF32FromWasm0(r0, r1).slice(); 601 - wasm.__wbindgen_free(r0, r1 * 4, 4); 602 - } 603 - return v1; 604 - } finally { 605 - wasm.__wbindgen_add_to_stack_pointer(16); 606 - } 607 - } 608 - /** 609 - * The scaling factor applied of this heightfield if it is one. 610 - * @param {number} handle 611 - * @returns {RawVector | undefined} 612 - */ 613 - coHeightfieldScale(handle) { 614 - const ret = wasm.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, handle); 615 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 616 - } 617 - /** 618 - * The unique integer identifier of the collider this collider is attached to. 619 - * @param {number} handle 620 - * @returns {number | undefined} 621 - */ 622 - coParent(handle) { 623 - try { 624 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 625 - wasm.rawcolliderset_coParent(retptr, this.__wbg_ptr, handle); 626 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 627 - var r2 = getFloat64Memory0()[retptr / 8 + 1]; 628 - return r0 === 0 ? void 0 : r2; 629 - } finally { 630 - wasm.__wbindgen_add_to_stack_pointer(16); 631 - } 632 - } 633 - /** 634 - * @param {number} handle 635 - * @param {boolean} enabled 636 - */ 637 - coSetEnabled(handle, enabled) { 638 - wasm.rawcolliderset_coSetEnabled(this.__wbg_ptr, handle, enabled); 639 - } 640 - /** 641 - * @param {number} handle 642 - * @returns {boolean} 643 - */ 644 - coIsEnabled(handle) { 645 - const ret = wasm.rawcolliderset_coIsEnabled(this.__wbg_ptr, handle); 646 - return ret !== 0; 647 - } 648 - /** 649 - * @param {number} handle 650 - * @param {number} contact_skin 651 - */ 652 - coSetContactSkin(handle, contact_skin) { 653 - wasm.rawcolliderset_coSetContactSkin(this.__wbg_ptr, handle, contact_skin); 654 - } 655 - /** 656 - * @param {number} handle 657 - * @returns {number} 658 - */ 659 - coContactSkin(handle) { 660 - const ret = wasm.rawcolliderset_coContactSkin(this.__wbg_ptr, handle); 661 - return ret; 662 - } 663 - /** 664 - * The friction coefficient of this collider. 665 - * @param {number} handle 666 - * @returns {number} 667 - */ 668 - coFriction(handle) { 669 - const ret = wasm.rawcolliderset_coFriction(this.__wbg_ptr, handle); 670 - return ret; 671 - } 672 - /** 673 - * The restitution coefficient of this collider. 674 - * @param {number} handle 675 - * @returns {number} 676 - */ 677 - coRestitution(handle) { 678 - const ret = wasm.rawcolliderset_coRestitution(this.__wbg_ptr, handle); 679 - return ret; 680 - } 681 - /** 682 - * The density of this collider. 683 - * @param {number} handle 684 - * @returns {number} 685 - */ 686 - coDensity(handle) { 687 - const ret = wasm.rawcolliderset_coDensity(this.__wbg_ptr, handle); 688 - return ret; 689 - } 690 - /** 691 - * The mass of this collider. 692 - * @param {number} handle 693 - * @returns {number} 694 - */ 695 - coMass(handle) { 696 - const ret = wasm.rawcolliderset_coMass(this.__wbg_ptr, handle); 697 - return ret; 698 - } 699 - /** 700 - * The volume of this collider. 701 - * @param {number} handle 702 - * @returns {number} 703 - */ 704 - coVolume(handle) { 705 - const ret = wasm.rawcolliderset_coVolume(this.__wbg_ptr, handle); 706 - return ret; 707 - } 708 - /** 709 - * The collision groups of this collider. 710 - * @param {number} handle 711 - * @returns {number} 712 - */ 713 - coCollisionGroups(handle) { 714 - const ret = wasm.rawcolliderset_coCollisionGroups(this.__wbg_ptr, handle); 715 - return ret >>> 0; 716 - } 717 - /** 718 - * The solver groups of this collider. 719 - * @param {number} handle 720 - * @returns {number} 721 - */ 722 - coSolverGroups(handle) { 723 - const ret = wasm.rawcolliderset_coSolverGroups(this.__wbg_ptr, handle); 724 - return ret >>> 0; 725 - } 726 - /** 727 - * The physics hooks enabled for this collider. 728 - * @param {number} handle 729 - * @returns {number} 730 - */ 731 - coActiveHooks(handle) { 732 - const ret = wasm.rawcolliderset_coActiveHooks(this.__wbg_ptr, handle); 733 - return ret >>> 0; 734 - } 735 - /** 736 - * The collision types enabled for this collider. 737 - * @param {number} handle 738 - * @returns {number} 739 - */ 740 - coActiveCollisionTypes(handle) { 741 - const ret = wasm.rawcolliderset_coActiveCollisionTypes(this.__wbg_ptr, handle); 742 - return ret; 743 - } 744 - /** 745 - * The events enabled for this collider. 746 - * @param {number} handle 747 - * @returns {number} 748 - */ 749 - coActiveEvents(handle) { 750 - const ret = wasm.rawcolliderset_coActiveEvents(this.__wbg_ptr, handle); 751 - return ret >>> 0; 752 - } 753 - /** 754 - * The total force magnitude beyond which a contact force event can be emitted. 755 - * @param {number} handle 756 - * @returns {number} 757 - */ 758 - coContactForceEventThreshold(handle) { 759 - const ret = wasm.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, handle); 760 - return ret; 761 - } 762 - /** 763 - * @param {number} handle 764 - * @param {RawVector} point 765 - * @returns {boolean} 766 - */ 767 - coContainsPoint(handle, point) { 768 - _assertClass(point, RawVector); 769 - const ret = wasm.rawcolliderset_coContainsPoint(this.__wbg_ptr, handle, point.__wbg_ptr); 770 - return ret !== 0; 771 - } 772 - /** 773 - * @param {number} handle 774 - * @param {RawVector} colliderVel 775 - * @param {RawShape} shape2 776 - * @param {RawVector} shape2Pos 777 - * @param {RawRotation} shape2Rot 778 - * @param {RawVector} shape2Vel 779 - * @param {number} target_distance 780 - * @param {number} maxToi 781 - * @param {boolean} stop_at_penetration 782 - * @returns {RawShapeCastHit | undefined} 783 - */ 784 - coCastShape(handle, colliderVel, shape2, shape2Pos, shape2Rot, shape2Vel, target_distance, maxToi, stop_at_penetration) { 785 - _assertClass(colliderVel, RawVector); 786 - _assertClass(shape2, RawShape); 787 - _assertClass(shape2Pos, RawVector); 788 - _assertClass(shape2Rot, RawRotation); 789 - _assertClass(shape2Vel, RawVector); 790 - 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); 791 - return ret === 0 ? void 0 : RawShapeCastHit.__wrap(ret); 792 - } 793 - /** 794 - * @param {number} handle 795 - * @param {RawVector} collider1Vel 796 - * @param {number} collider2handle 797 - * @param {RawVector} collider2Vel 798 - * @param {number} target_distance 799 - * @param {number} max_toi 800 - * @param {boolean} stop_at_penetration 801 - * @returns {RawColliderShapeCastHit | undefined} 802 - */ 803 - coCastCollider(handle, collider1Vel, collider2handle, collider2Vel, target_distance, max_toi, stop_at_penetration) { 804 - _assertClass(collider1Vel, RawVector); 805 - _assertClass(collider2Vel, RawVector); 806 - const ret = wasm.rawcolliderset_coCastCollider(this.__wbg_ptr, handle, collider1Vel.__wbg_ptr, collider2handle, collider2Vel.__wbg_ptr, target_distance, max_toi, stop_at_penetration); 807 - return ret === 0 ? void 0 : RawColliderShapeCastHit.__wrap(ret); 808 - } 809 - /** 810 - * @param {number} handle 811 - * @param {RawShape} shape2 812 - * @param {RawVector} shapePos2 813 - * @param {RawRotation} shapeRot2 814 - * @returns {boolean} 815 - */ 816 - coIntersectsShape(handle, shape2, shapePos2, shapeRot2) { 817 - _assertClass(shape2, RawShape); 818 - _assertClass(shapePos2, RawVector); 819 - _assertClass(shapeRot2, RawRotation); 820 - const ret = wasm.rawcolliderset_coIntersectsShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr); 821 - return ret !== 0; 822 - } 823 - /** 824 - * @param {number} handle 825 - * @param {RawShape} shape2 826 - * @param {RawVector} shapePos2 827 - * @param {RawRotation} shapeRot2 828 - * @param {number} prediction 829 - * @returns {RawShapeContact | undefined} 830 - */ 831 - coContactShape(handle, shape2, shapePos2, shapeRot2, prediction) { 832 - _assertClass(shape2, RawShape); 833 - _assertClass(shapePos2, RawVector); 834 - _assertClass(shapeRot2, RawRotation); 835 - const ret = wasm.rawcolliderset_coContactShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction); 836 - return ret === 0 ? void 0 : RawShapeContact.__wrap(ret); 837 - } 838 - /** 839 - * @param {number} handle 840 - * @param {number} collider2handle 841 - * @param {number} prediction 842 - * @returns {RawShapeContact | undefined} 843 - */ 844 - coContactCollider(handle, collider2handle, prediction) { 845 - const ret = wasm.rawcolliderset_coContactCollider(this.__wbg_ptr, handle, collider2handle, prediction); 846 - return ret === 0 ? void 0 : RawShapeContact.__wrap(ret); 847 - } 848 - /** 849 - * @param {number} handle 850 - * @param {RawVector} point 851 - * @param {boolean} solid 852 - * @returns {RawPointProjection} 853 - */ 854 - coProjectPoint(handle, point, solid) { 855 - _assertClass(point, RawVector); 856 - const ret = wasm.rawcolliderset_coProjectPoint(this.__wbg_ptr, handle, point.__wbg_ptr, solid); 857 - return RawPointProjection.__wrap(ret); 858 - } 859 - /** 860 - * @param {number} handle 861 - * @param {RawVector} rayOrig 862 - * @param {RawVector} rayDir 863 - * @param {number} maxToi 864 - * @returns {boolean} 865 - */ 866 - coIntersectsRay(handle, rayOrig, rayDir, maxToi) { 867 - _assertClass(rayOrig, RawVector); 868 - _assertClass(rayDir, RawVector); 869 - const ret = wasm.rawcolliderset_coIntersectsRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi); 870 - return ret !== 0; 871 - } 872 - /** 873 - * @param {number} handle 874 - * @param {RawVector} rayOrig 875 - * @param {RawVector} rayDir 876 - * @param {number} maxToi 877 - * @param {boolean} solid 878 - * @returns {number} 879 - */ 880 - coCastRay(handle, rayOrig, rayDir, maxToi, solid) { 881 - _assertClass(rayOrig, RawVector); 882 - _assertClass(rayDir, RawVector); 883 - const ret = wasm.rawcolliderset_coCastRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); 884 - return ret; 885 - } 886 - /** 887 - * @param {number} handle 888 - * @param {RawVector} rayOrig 889 - * @param {RawVector} rayDir 890 - * @param {number} maxToi 891 - * @param {boolean} solid 892 - * @returns {RawRayIntersection | undefined} 893 - */ 894 - coCastRayAndGetNormal(handle, rayOrig, rayDir, maxToi, solid) { 895 - _assertClass(rayOrig, RawVector); 896 - _assertClass(rayDir, RawVector); 897 - const ret = wasm.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); 898 - return ret === 0 ? void 0 : RawRayIntersection.__wrap(ret); 899 - } 900 - /** 901 - * @param {number} handle 902 - * @param {boolean} is_sensor 903 - */ 904 - coSetSensor(handle, is_sensor) { 905 - wasm.rawcolliderset_coSetSensor(this.__wbg_ptr, handle, is_sensor); 906 - } 907 - /** 908 - * @param {number} handle 909 - * @param {number} restitution 910 - */ 911 - coSetRestitution(handle, restitution) { 912 - wasm.rawcolliderset_coSetRestitution(this.__wbg_ptr, handle, restitution); 913 - } 914 - /** 915 - * @param {number} handle 916 - * @param {number} friction 917 - */ 918 - coSetFriction(handle, friction) { 919 - wasm.rawcolliderset_coSetFriction(this.__wbg_ptr, handle, friction); 920 - } 921 - /** 922 - * @param {number} handle 923 - * @returns {number} 924 - */ 925 - coFrictionCombineRule(handle) { 926 - const ret = wasm.rawcolliderset_coFrictionCombineRule(this.__wbg_ptr, handle); 927 - return ret >>> 0; 928 - } 929 - /** 930 - * @param {number} handle 931 - * @param {number} rule 932 - */ 933 - coSetFrictionCombineRule(handle, rule) { 934 - wasm.rawcolliderset_coSetFrictionCombineRule(this.__wbg_ptr, handle, rule); 935 - } 936 - /** 937 - * @param {number} handle 938 - * @returns {number} 939 - */ 940 - coRestitutionCombineRule(handle) { 941 - const ret = wasm.rawcolliderset_coRestitutionCombineRule(this.__wbg_ptr, handle); 942 - return ret >>> 0; 943 - } 944 - /** 945 - * @param {number} handle 946 - * @param {number} rule 947 - */ 948 - coSetRestitutionCombineRule(handle, rule) { 949 - wasm.rawcolliderset_coSetRestitutionCombineRule(this.__wbg_ptr, handle, rule); 950 - } 951 - /** 952 - * @param {number} handle 953 - * @param {number} groups 954 - */ 955 - coSetCollisionGroups(handle, groups) { 956 - wasm.rawcolliderset_coSetCollisionGroups(this.__wbg_ptr, handle, groups); 957 - } 958 - /** 959 - * @param {number} handle 960 - * @param {number} groups 961 - */ 962 - coSetSolverGroups(handle, groups) { 963 - wasm.rawcolliderset_coSetSolverGroups(this.__wbg_ptr, handle, groups); 964 - } 965 - /** 966 - * @param {number} handle 967 - * @param {number} hooks 968 - */ 969 - coSetActiveHooks(handle, hooks) { 970 - wasm.rawcolliderset_coSetActiveHooks(this.__wbg_ptr, handle, hooks); 971 - } 972 - /** 973 - * @param {number} handle 974 - * @param {number} events 975 - */ 976 - coSetActiveEvents(handle, events) { 977 - wasm.rawcolliderset_coSetActiveEvents(this.__wbg_ptr, handle, events); 978 - } 979 - /** 980 - * @param {number} handle 981 - * @param {number} types 982 - */ 983 - coSetActiveCollisionTypes(handle, types) { 984 - wasm.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, handle, types); 985 - } 986 - /** 987 - * @param {number} handle 988 - * @param {RawShape} shape 989 - */ 990 - coSetShape(handle, shape) { 991 - _assertClass(shape, RawShape); 992 - wasm.rawcolliderset_coSetShape(this.__wbg_ptr, handle, shape.__wbg_ptr); 993 - } 994 - /** 995 - * @param {number} handle 996 - * @param {number} threshold 997 - */ 998 - coSetContactForceEventThreshold(handle, threshold) { 999 - wasm.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, handle, threshold); 1000 - } 1001 - /** 1002 - * @param {number} handle 1003 - * @param {number} density 1004 - */ 1005 - coSetDensity(handle, density) { 1006 - wasm.rawcolliderset_coSetDensity(this.__wbg_ptr, handle, density); 1007 - } 1008 - /** 1009 - * @param {number} handle 1010 - * @param {number} mass 1011 - */ 1012 - coSetMass(handle, mass) { 1013 - wasm.rawcolliderset_coSetMass(this.__wbg_ptr, handle, mass); 1014 - } 1015 - /** 1016 - * @param {number} handle 1017 - * @param {number} mass 1018 - * @param {RawVector} centerOfMass 1019 - * @param {number} principalAngularInertia 1020 - */ 1021 - coSetMassProperties(handle, mass, centerOfMass, principalAngularInertia) { 1022 - _assertClass(centerOfMass, RawVector); 1023 - wasm.rawcolliderset_coSetMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia); 1024 - } 1025 - /** 1026 - */ 1027 - constructor() { 1028 - const ret = wasm.rawcolliderset_new(); 1029 - this.__wbg_ptr = ret >>> 0; 1030 - return this; 1031 - } 1032 - /** 1033 - * @returns {number} 1034 - */ 1035 - len() { 1036 - const ret = wasm.rawcolliderset_len(this.__wbg_ptr); 1037 - return ret >>> 0; 1038 - } 1039 - /** 1040 - * @param {number} handle 1041 - * @returns {boolean} 1042 - */ 1043 - contains(handle) { 1044 - const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle); 1045 - return ret !== 0; 1046 - } 1047 - /** 1048 - * @param {boolean} enabled 1049 - * @param {RawShape} shape 1050 - * @param {RawVector} translation 1051 - * @param {RawRotation} rotation 1052 - * @param {number} massPropsMode 1053 - * @param {number} mass 1054 - * @param {RawVector} centerOfMass 1055 - * @param {number} principalAngularInertia 1056 - * @param {number} density 1057 - * @param {number} friction 1058 - * @param {number} restitution 1059 - * @param {number} frictionCombineRule 1060 - * @param {number} restitutionCombineRule 1061 - * @param {boolean} isSensor 1062 - * @param {number} collisionGroups 1063 - * @param {number} solverGroups 1064 - * @param {number} activeCollisionTypes 1065 - * @param {number} activeHooks 1066 - * @param {number} activeEvents 1067 - * @param {number} contactForceEventThreshold 1068 - * @param {number} contactSkin 1069 - * @param {boolean} hasParent 1070 - * @param {number} parent 1071 - * @param {RawRigidBodySet} bodies 1072 - * @returns {number | undefined} 1073 - */ 1074 - 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) { 1075 - try { 1076 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 1077 - _assertClass(shape, RawShape); 1078 - _assertClass(translation, RawVector); 1079 - _assertClass(rotation, RawRotation); 1080 - _assertClass(centerOfMass, RawVector); 1081 - _assertClass(bodies, RawRigidBodySet); 1082 - 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); 1083 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 1084 - var r2 = getFloat64Memory0()[retptr / 8 + 1]; 1085 - return r0 === 0 ? void 0 : r2; 1086 - } finally { 1087 - wasm.__wbindgen_add_to_stack_pointer(16); 1088 - } 1089 - } 1090 - /** 1091 - * Removes a collider from this set and wake-up the rigid-body it is attached to. 1092 - * @param {number} handle 1093 - * @param {RawIslandManager} islands 1094 - * @param {RawRigidBodySet} bodies 1095 - * @param {boolean} wakeUp 1096 - */ 1097 - remove(handle, islands, bodies, wakeUp) { 1098 - _assertClass(islands, RawIslandManager); 1099 - _assertClass(bodies, RawRigidBodySet); 1100 - wasm.rawcolliderset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, bodies.__wbg_ptr, wakeUp); 1101 - } 1102 - /** 1103 - * Checks if a collider with the given integer handle exists. 1104 - * @param {number} handle 1105 - * @returns {boolean} 1106 - */ 1107 - isHandleValid(handle) { 1108 - const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle); 1109 - return ret !== 0; 1110 - } 1111 - /** 1112 - * Applies the given JavaScript function to the integer handle of each collider managed by this collider set. 1113 - * 1114 - * # Parameters 1115 - * - `f(handle)`: the function to apply to the integer handle of each collider managed by this collider set. Called as `f(handle)`. 1116 - * @param {Function} f 1117 - */ 1118 - forEachColliderHandle(f) { 1119 - try { 1120 - wasm.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, addBorrowedObject(f)); 1121 - } finally { 1122 - heap[stack_pointer++] = void 0; 1123 - } 1124 - } 1125 - }; 1126 - var RawColliderShapeCastHit = class _RawColliderShapeCastHit { 1127 - static __wrap(ptr) { 1128 - ptr = ptr >>> 0; 1129 - const obj = Object.create(_RawColliderShapeCastHit.prototype); 1130 - obj.__wbg_ptr = ptr; 1131 - return obj; 1132 - } 1133 - __destroy_into_raw() { 1134 - const ptr = this.__wbg_ptr; 1135 - this.__wbg_ptr = 0; 1136 - return ptr; 1137 - } 1138 - free() { 1139 - const ptr = this.__destroy_into_raw(); 1140 - wasm.__wbg_rawcollidershapecasthit_free(ptr); 1141 - } 1142 - /** 1143 - * @returns {number} 1144 - */ 1145 - colliderHandle() { 1146 - const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr); 1147 - return ret; 1148 - } 1149 - /** 1150 - * @returns {number} 1151 - */ 1152 - time_of_impact() { 1153 - const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); 1154 - return ret; 1155 - } 1156 - /** 1157 - * @returns {RawVector} 1158 - */ 1159 - witness1() { 1160 - const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); 1161 - return RawVector.__wrap(ret); 1162 - } 1163 - /** 1164 - * @returns {RawVector} 1165 - */ 1166 - witness2() { 1167 - const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr); 1168 - return RawVector.__wrap(ret); 1169 - } 1170 - /** 1171 - * @returns {RawVector} 1172 - */ 1173 - normal1() { 1174 - const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr); 1175 - return RawVector.__wrap(ret); 1176 - } 1177 - /** 1178 - * @returns {RawVector} 1179 - */ 1180 - normal2() { 1181 - const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr); 1182 - return RawVector.__wrap(ret); 1183 - } 1184 - }; 1185 - var RawContactManifold = class _RawContactManifold { 1186 - static __wrap(ptr) { 1187 - ptr = ptr >>> 0; 1188 - const obj = Object.create(_RawContactManifold.prototype); 1189 - obj.__wbg_ptr = ptr; 1190 - return obj; 1191 - } 1192 - __destroy_into_raw() { 1193 - const ptr = this.__wbg_ptr; 1194 - this.__wbg_ptr = 0; 1195 - return ptr; 1196 - } 1197 - free() { 1198 - const ptr = this.__destroy_into_raw(); 1199 - wasm.__wbg_rawcontactmanifold_free(ptr); 1200 - } 1201 - /** 1202 - * @returns {RawVector} 1203 - */ 1204 - normal() { 1205 - const ret = wasm.rawcontactmanifold_normal(this.__wbg_ptr); 1206 - return RawVector.__wrap(ret); 1207 - } 1208 - /** 1209 - * @returns {RawVector} 1210 - */ 1211 - local_n1() { 1212 - const ret = wasm.rawcontactmanifold_local_n1(this.__wbg_ptr); 1213 - return RawVector.__wrap(ret); 1214 - } 1215 - /** 1216 - * @returns {RawVector} 1217 - */ 1218 - local_n2() { 1219 - const ret = wasm.rawcontactmanifold_local_n2(this.__wbg_ptr); 1220 - return RawVector.__wrap(ret); 1221 - } 1222 - /** 1223 - * @returns {number} 1224 - */ 1225 - subshape1() { 1226 - const ret = wasm.rawcontactmanifold_subshape1(this.__wbg_ptr); 1227 - return ret >>> 0; 1228 - } 1229 - /** 1230 - * @returns {number} 1231 - */ 1232 - subshape2() { 1233 - const ret = wasm.rawcontactmanifold_subshape2(this.__wbg_ptr); 1234 - return ret >>> 0; 1235 - } 1236 - /** 1237 - * @returns {number} 1238 - */ 1239 - num_contacts() { 1240 - const ret = wasm.rawcontactmanifold_num_contacts(this.__wbg_ptr); 1241 - return ret >>> 0; 1242 - } 1243 - /** 1244 - * @param {number} i 1245 - * @returns {RawVector | undefined} 1246 - */ 1247 - contact_local_p1(i) { 1248 - const ret = wasm.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, i); 1249 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 1250 - } 1251 - /** 1252 - * @param {number} i 1253 - * @returns {RawVector | undefined} 1254 - */ 1255 - contact_local_p2(i) { 1256 - const ret = wasm.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, i); 1257 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 1258 - } 1259 - /** 1260 - * @param {number} i 1261 - * @returns {number} 1262 - */ 1263 - contact_dist(i) { 1264 - const ret = wasm.rawcontactmanifold_contact_dist(this.__wbg_ptr, i); 1265 - return ret; 1266 - } 1267 - /** 1268 - * @param {number} i 1269 - * @returns {number} 1270 - */ 1271 - contact_fid1(i) { 1272 - const ret = wasm.rawcontactmanifold_contact_fid1(this.__wbg_ptr, i); 1273 - return ret >>> 0; 1274 - } 1275 - /** 1276 - * @param {number} i 1277 - * @returns {number} 1278 - */ 1279 - contact_fid2(i) { 1280 - const ret = wasm.rawcontactmanifold_contact_fid2(this.__wbg_ptr, i); 1281 - return ret >>> 0; 1282 - } 1283 - /** 1284 - * @param {number} i 1285 - * @returns {number} 1286 - */ 1287 - contact_impulse(i) { 1288 - const ret = wasm.rawcontactmanifold_contact_impulse(this.__wbg_ptr, i); 1289 - return ret; 1290 - } 1291 - /** 1292 - * @param {number} i 1293 - * @returns {number} 1294 - */ 1295 - contact_tangent_impulse(i) { 1296 - const ret = wasm.rawcontactmanifold_contact_tangent_impulse(this.__wbg_ptr, i); 1297 - return ret; 1298 - } 1299 - /** 1300 - * @returns {number} 1301 - */ 1302 - num_solver_contacts() { 1303 - const ret = wasm.rawcontactmanifold_num_solver_contacts(this.__wbg_ptr); 1304 - return ret >>> 0; 1305 - } 1306 - /** 1307 - * @param {number} i 1308 - * @returns {RawVector | undefined} 1309 - */ 1310 - solver_contact_point(i) { 1311 - const ret = wasm.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, i); 1312 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 1313 - } 1314 - /** 1315 - * @param {number} i 1316 - * @returns {number} 1317 - */ 1318 - solver_contact_dist(i) { 1319 - const ret = wasm.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, i); 1320 - return ret; 1321 - } 1322 - /** 1323 - * @param {number} i 1324 - * @returns {number} 1325 - */ 1326 - solver_contact_friction(i) { 1327 - const ret = wasm.rawcontactmanifold_solver_contact_friction(this.__wbg_ptr, i); 1328 - return ret; 1329 - } 1330 - /** 1331 - * @param {number} i 1332 - * @returns {number} 1333 - */ 1334 - solver_contact_restitution(i) { 1335 - const ret = wasm.rawcontactmanifold_solver_contact_restitution(this.__wbg_ptr, i); 1336 - return ret; 1337 - } 1338 - /** 1339 - * @param {number} i 1340 - * @returns {RawVector} 1341 - */ 1342 - solver_contact_tangent_velocity(i) { 1343 - const ret = wasm.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, i); 1344 - return RawVector.__wrap(ret); 1345 - } 1346 - }; 1347 - var RawContactPair = class _RawContactPair { 1348 - static __wrap(ptr) { 1349 - ptr = ptr >>> 0; 1350 - const obj = Object.create(_RawContactPair.prototype); 1351 - obj.__wbg_ptr = ptr; 1352 - return obj; 1353 - } 1354 - __destroy_into_raw() { 1355 - const ptr = this.__wbg_ptr; 1356 - this.__wbg_ptr = 0; 1357 - return ptr; 1358 - } 1359 - free() { 1360 - const ptr = this.__destroy_into_raw(); 1361 - wasm.__wbg_rawcontactpair_free(ptr); 1362 - } 1363 - /** 1364 - * @returns {number} 1365 - */ 1366 - collider1() { 1367 - const ret = wasm.rawcontactpair_collider1(this.__wbg_ptr); 1368 - return ret; 1369 - } 1370 - /** 1371 - * @returns {number} 1372 - */ 1373 - collider2() { 1374 - const ret = wasm.rawcontactpair_collider2(this.__wbg_ptr); 1375 - return ret; 1376 - } 1377 - /** 1378 - * @returns {number} 1379 - */ 1380 - numContactManifolds() { 1381 - const ret = wasm.rawcontactpair_numContactManifolds(this.__wbg_ptr); 1382 - return ret >>> 0; 1383 - } 1384 - /** 1385 - * @param {number} i 1386 - * @returns {RawContactManifold | undefined} 1387 - */ 1388 - contactManifold(i) { 1389 - const ret = wasm.rawcontactpair_contactManifold(this.__wbg_ptr, i); 1390 - return ret === 0 ? void 0 : RawContactManifold.__wrap(ret); 1391 - } 1392 - }; 1393 - var RawDebugRenderPipeline = class { 1394 - __destroy_into_raw() { 1395 - const ptr = this.__wbg_ptr; 1396 - this.__wbg_ptr = 0; 1397 - return ptr; 1398 - } 1399 - free() { 1400 - const ptr = this.__destroy_into_raw(); 1401 - wasm.__wbg_rawdebugrenderpipeline_free(ptr); 1402 - } 1403 - /** 1404 - */ 1405 - constructor() { 1406 - const ret = wasm.rawdebugrenderpipeline_new(); 1407 - this.__wbg_ptr = ret >>> 0; 1408 - return this; 1409 - } 1410 - /** 1411 - * @returns {Float32Array} 1412 - */ 1413 - vertices() { 1414 - const ret = wasm.rawdebugrenderpipeline_vertices(this.__wbg_ptr); 1415 - return takeObject(ret); 1416 - } 1417 - /** 1418 - * @returns {Float32Array} 1419 - */ 1420 - colors() { 1421 - const ret = wasm.rawdebugrenderpipeline_colors(this.__wbg_ptr); 1422 - return takeObject(ret); 1423 - } 1424 - /** 1425 - * @param {RawRigidBodySet} bodies 1426 - * @param {RawColliderSet} colliders 1427 - * @param {RawImpulseJointSet} impulse_joints 1428 - * @param {RawMultibodyJointSet} multibody_joints 1429 - * @param {RawNarrowPhase} narrow_phase 1430 - */ 1431 - render(bodies, colliders, impulse_joints, multibody_joints, narrow_phase) { 1432 - _assertClass(bodies, RawRigidBodySet); 1433 - _assertClass(colliders, RawColliderSet); 1434 - _assertClass(impulse_joints, RawImpulseJointSet); 1435 - _assertClass(multibody_joints, RawMultibodyJointSet); 1436 - _assertClass(narrow_phase, RawNarrowPhase); 1437 - wasm.rawdebugrenderpipeline_render(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, impulse_joints.__wbg_ptr, multibody_joints.__wbg_ptr, narrow_phase.__wbg_ptr); 1438 - } 1439 - }; 1440 - var RawDeserializedWorld = class _RawDeserializedWorld { 1441 - static __wrap(ptr) { 1442 - ptr = ptr >>> 0; 1443 - const obj = Object.create(_RawDeserializedWorld.prototype); 1444 - obj.__wbg_ptr = ptr; 1445 - return obj; 1446 - } 1447 - __destroy_into_raw() { 1448 - const ptr = this.__wbg_ptr; 1449 - this.__wbg_ptr = 0; 1450 - return ptr; 1451 - } 1452 - free() { 1453 - const ptr = this.__destroy_into_raw(); 1454 - wasm.__wbg_rawdeserializedworld_free(ptr); 1455 - } 1456 - /** 1457 - * @returns {RawVector | undefined} 1458 - */ 1459 - takeGravity() { 1460 - const ret = wasm.rawdeserializedworld_takeGravity(this.__wbg_ptr); 1461 - return ret === 0 ? void 0 : RawVector.__wrap(ret); 1462 - } 1463 - /** 1464 - * @returns {RawIntegrationParameters | undefined} 1465 - */ 1466 - takeIntegrationParameters() { 1467 - const ret = wasm.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr); 1468 - return ret === 0 ? void 0 : RawIntegrationParameters.__wrap(ret); 1469 - } 1470 - /** 1471 - * @returns {RawIslandManager | undefined} 1472 - */ 1473 - takeIslandManager() { 1474 - const ret = wasm.rawdeserializedworld_takeIslandManager(this.__wbg_ptr); 1475 - return ret === 0 ? void 0 : RawIslandManager.__wrap(ret); 1476 - } 1477 - /** 1478 - * @returns {RawBroadPhase | undefined} 1479 - */ 1480 - takeBroadPhase() { 1481 - const ret = wasm.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr); 1482 - return ret === 0 ? void 0 : RawBroadPhase.__wrap(ret); 1483 - } 1484 - /** 1485 - * @returns {RawNarrowPhase | undefined} 1486 - */ 1487 - takeNarrowPhase() { 1488 - const ret = wasm.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr); 1489 - return ret === 0 ? void 0 : RawNarrowPhase.__wrap(ret); 1490 - } 1491 - /** 1492 - * @returns {RawRigidBodySet | undefined} 1493 - */ 1494 - takeBodies() { 1495 - const ret = wasm.rawdeserializedworld_takeBodies(this.__wbg_ptr); 1496 - return ret === 0 ? void 0 : RawRigidBodySet.__wrap(ret); 1497 - } 1498 - /** 1499 - * @returns {RawColliderSet | undefined} 1500 - */ 1501 - takeColliders() { 1502 - const ret = wasm.rawdeserializedworld_takeColliders(this.__wbg_ptr); 1503 - return ret === 0 ? void 0 : RawColliderSet.__wrap(ret); 1504 - } 1505 - /** 1506 - * @returns {RawImpulseJointSet | undefined} 1507 - */ 1508 - takeImpulseJoints() { 1509 - const ret = wasm.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr); 1510 - return ret === 0 ? void 0 : RawImpulseJointSet.__wrap(ret); 1511 - } 1512 - /** 1513 - * @returns {RawMultibodyJointSet | undefined} 1514 - */ 1515 - takeMultibodyJoints() { 1516 - const ret = wasm.rawdeserializedworld_takeMultibodyJoints(this.__wbg_ptr); 1517 - return ret === 0 ? void 0 : RawMultibodyJointSet.__wrap(ret); 1518 - } 1519 - }; 1520 - var RawEventQueue = class { 1521 - __destroy_into_raw() { 1522 - const ptr = this.__wbg_ptr; 1523 - this.__wbg_ptr = 0; 1524 - return ptr; 1525 - } 1526 - free() { 1527 - const ptr = this.__destroy_into_raw(); 1528 - wasm.__wbg_raweventqueue_free(ptr); 1529 - } 1530 - /** 1531 - * Creates a new event collector. 1532 - * 1533 - * # Parameters 1534 - * - `autoDrain`: setting this to `true` is strongly recommended. If true, the collector will 1535 - * be automatically drained before each `world.step(collector)`. If false, the collector will 1536 - * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of 1537 - * RAM if no drain is performed. 1538 - * @param {boolean} autoDrain 1539 - */ 1540 - constructor(autoDrain) { 1541 - const ret = wasm.raweventqueue_new(autoDrain); 1542 - this.__wbg_ptr = ret >>> 0; 1543 - return this; 1544 - } 1545 - /** 1546 - * Applies the given javascript closure on each collision event of this collector, then clear 1547 - * the internal collision event buffer. 1548 - * 1549 - * # Parameters 1550 - * - `f(handle1, handle2, started)`: JavaScript closure applied to each collision event. The 1551 - * closure should take three arguments: two integers representing the handles of the colliders 1552 - * involved in the collision, and a boolean indicating if the collision started (true) or stopped 1553 - * (false). 1554 - * @param {Function} f 1555 - */ 1556 - drainCollisionEvents(f) { 1557 - try { 1558 - wasm.raweventqueue_drainCollisionEvents(this.__wbg_ptr, addBorrowedObject(f)); 1559 - } finally { 1560 - heap[stack_pointer++] = void 0; 1561 - } 1562 - } 1563 - /** 1564 - * @param {Function} f 1565 - */ 1566 - drainContactForceEvents(f) { 1567 - try { 1568 - wasm.raweventqueue_drainContactForceEvents(this.__wbg_ptr, addBorrowedObject(f)); 1569 - } finally { 1570 - heap[stack_pointer++] = void 0; 1571 - } 1572 - } 1573 - /** 1574 - * Removes all events contained by this collector. 1575 - */ 1576 - clear() { 1577 - wasm.raweventqueue_clear(this.__wbg_ptr); 1578 - } 1579 - }; 1580 - var RawGenericJoint = class _RawGenericJoint { 1581 - static __wrap(ptr) { 1582 - ptr = ptr >>> 0; 1583 - const obj = Object.create(_RawGenericJoint.prototype); 1584 - obj.__wbg_ptr = ptr; 1585 - return obj; 1586 - } 1587 - __destroy_into_raw() { 1588 - const ptr = this.__wbg_ptr; 1589 - this.__wbg_ptr = 0; 1590 - return ptr; 1591 - } 1592 - free() { 1593 - const ptr = this.__destroy_into_raw(); 1594 - wasm.__wbg_rawgenericjoint_free(ptr); 1595 - } 1596 - /** 1597 - * @param {number} rest_length 1598 - * @param {number} stiffness 1599 - * @param {number} damping 1600 - * @param {RawVector} anchor1 1601 - * @param {RawVector} anchor2 1602 - * @returns {RawGenericJoint} 1603 - */ 1604 - static spring(rest_length, stiffness, damping, anchor1, anchor2) { 1605 - _assertClass(anchor1, RawVector); 1606 - _assertClass(anchor2, RawVector); 1607 - const ret = wasm.rawgenericjoint_spring(rest_length, stiffness, damping, anchor1.__wbg_ptr, anchor2.__wbg_ptr); 1608 - return _RawGenericJoint.__wrap(ret); 1609 - } 1610 - /** 1611 - * @param {number} length 1612 - * @param {RawVector} anchor1 1613 - * @param {RawVector} anchor2 1614 - * @returns {RawGenericJoint} 1615 - */ 1616 - static rope(length, anchor1, anchor2) { 1617 - _assertClass(anchor1, RawVector); 1618 - _assertClass(anchor2, RawVector); 1619 - const ret = wasm.rawgenericjoint_rope(length, anchor1.__wbg_ptr, anchor2.__wbg_ptr); 1620 - return _RawGenericJoint.__wrap(ret); 1621 - } 1622 - /** 1623 - * Creates a new joint descriptor that builds a Prismatic joint. 1624 - * 1625 - * A prismatic joint removes all the degrees of freedom between the 1626 - * affected bodies, except for the translation along one axis. 1627 - * 1628 - * Returns `None` if any of the provided axes cannot be normalized. 1629 - * @param {RawVector} anchor1 1630 - * @param {RawVector} anchor2 1631 - * @param {RawVector} axis 1632 - * @param {boolean} limitsEnabled 1633 - * @param {number} limitsMin 1634 - * @param {number} limitsMax 1635 - * @returns {RawGenericJoint | undefined} 1636 - */ 1637 - static prismatic(anchor1, anchor2, axis, limitsEnabled, limitsMin, limitsMax) { 1638 - _assertClass(anchor1, RawVector); 1639 - _assertClass(anchor2, RawVector); 1640 - _assertClass(axis, RawVector); 1641 - const ret = wasm.rawgenericjoint_prismatic(anchor1.__wbg_ptr, anchor2.__wbg_ptr, axis.__wbg_ptr, limitsEnabled, limitsMin, limitsMax); 1642 - return ret === 0 ? void 0 : _RawGenericJoint.__wrap(ret); 1643 - } 1644 - /** 1645 - * Creates a new joint descriptor that builds a Fixed joint. 1646 - * 1647 - * A fixed joint removes all the degrees of freedom between the affected bodies. 1648 - * @param {RawVector} anchor1 1649 - * @param {RawRotation} axes1 1650 - * @param {RawVector} anchor2 1651 - * @param {RawRotation} axes2 1652 - * @returns {RawGenericJoint} 1653 - */ 1654 - static fixed(anchor1, axes1, anchor2, axes2) { 1655 - _assertClass(anchor1, RawVector); 1656 - _assertClass(axes1, RawRotation); 1657 - _assertClass(anchor2, RawVector); 1658 - _assertClass(axes2, RawRotation); 1659 - const ret = wasm.rawgenericjoint_fixed(anchor1.__wbg_ptr, axes1.__wbg_ptr, anchor2.__wbg_ptr, axes2.__wbg_ptr); 1660 - return _RawGenericJoint.__wrap(ret); 1661 - } 1662 - /** 1663 - * Create a new joint descriptor that builds Revolute joints. 1664 - * 1665 - * A revolute joint removes all degrees of freedom between the affected 1666 - * bodies except for the rotation. 1667 - * @param {RawVector} anchor1 1668 - * @param {RawVector} anchor2 1669 - * @returns {RawGenericJoint | undefined} 1670 - */ 1671 - static revolute(anchor1, anchor2) { 1672 - _assertClass(anchor1, RawVector); 1673 - _assertClass(anchor2, RawVector); 1674 - const ret = wasm.rawgenericjoint_revolute(anchor1.__wbg_ptr, anchor2.__wbg_ptr); 1675 - return ret === 0 ? void 0 : _RawGenericJoint.__wrap(ret); 1676 - } 1677 - }; 1678 - var RawImpulseJointSet = class _RawImpulseJointSet { 1679 - static __wrap(ptr) { 1680 - ptr = ptr >>> 0; 1681 - const obj = Object.create(_RawImpulseJointSet.prototype); 1682 - obj.__wbg_ptr = ptr; 1683 - return obj; 1684 - } 1685 - __destroy_into_raw() { 1686 - const ptr = this.__wbg_ptr; 1687 - this.__wbg_ptr = 0; 1688 - return ptr; 1689 - } 1690 - free() { 1691 - const ptr = this.__destroy_into_raw(); 1692 - wasm.__wbg_rawimpulsejointset_free(ptr); 1693 - } 1694 - /** 1695 - * The type of this joint. 1696 - * @param {number} handle 1697 - * @returns {RawJointType} 1698 - */ 1699 - jointType(handle) { 1700 - const ret = wasm.rawimpulsejointset_jointType(this.__wbg_ptr, handle); 1701 - return ret; 1702 - } 1703 - /** 1704 - * The unique integer identifier of the first rigid-body this joint it attached to. 1705 - * @param {number} handle 1706 - * @returns {number} 1707 - */ 1708 - jointBodyHandle1(handle) { 1709 - const ret = wasm.rawimpulsejointset_jointBodyHandle1(this.__wbg_ptr, handle); 1710 - return ret; 1711 - } 1712 - /** 1713 - * The unique integer identifier of the second rigid-body this joint is attached to. 1714 - * @param {number} handle 1715 - * @returns {number} 1716 - */ 1717 - jointBodyHandle2(handle) { 1718 - const ret = wasm.rawimpulsejointset_jointBodyHandle2(this.__wbg_ptr, handle); 1719 - return ret; 1720 - } 1721 - /** 1722 - * The angular part of the joint’s local frame relative to the first rigid-body it is attached to. 1723 - * @param {number} handle 1724 - * @returns {RawRotation} 1725 - */ 1726 - jointFrameX1(handle) { 1727 - const ret = wasm.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, handle); 1728 - return RawRotation.__wrap(ret); 1729 - } 1730 - /** 1731 - * The angular part of the joint’s local frame relative to the second rigid-body it is attached to. 1732 - * @param {number} handle 1733 - * @returns {RawRotation} 1734 - */ 1735 - jointFrameX2(handle) { 1736 - const ret = wasm.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, handle); 1737 - return RawRotation.__wrap(ret); 1738 - } 1739 - /** 1740 - * The position of the first anchor of this joint. 1741 - * 1742 - * The first anchor gives the position of the points application point on the 1743 - * local frame of the first rigid-body it is attached to. 1744 - * @param {number} handle 1745 - * @returns {RawVector} 1746 - */ 1747 - jointAnchor1(handle) { 1748 - const ret = wasm.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, handle); 1749 - return RawVector.__wrap(ret); 1750 - } 1751 - /** 1752 - * The position of the second anchor of this joint. 1753 - * 1754 - * The second anchor gives the position of the points application point on the 1755 - * local frame of the second rigid-body it is attached to. 1756 - * @param {number} handle 1757 - * @returns {RawVector} 1758 - */ 1759 - jointAnchor2(handle) { 1760 - const ret = wasm.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, handle); 1761 - return RawVector.__wrap(ret); 1762 - } 1763 - /** 1764 - * Sets the position of the first local anchor 1765 - * @param {number} handle 1766 - * @param {RawVector} newPos 1767 - */ 1768 - jointSetAnchor1(handle, newPos) { 1769 - _assertClass(newPos, RawVector); 1770 - wasm.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, handle, newPos.__wbg_ptr); 1771 - } 1772 - /** 1773 - * Sets the position of the second local anchor 1774 - * @param {number} handle 1775 - * @param {RawVector} newPos 1776 - */ 1777 - jointSetAnchor2(handle, newPos) { 1778 - _assertClass(newPos, RawVector); 1779 - wasm.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, handle, newPos.__wbg_ptr); 1780 - } 1781 - /** 1782 - * Are contacts between the rigid-bodies attached by this joint enabled? 1783 - * @param {number} handle 1784 - * @returns {boolean} 1785 - */ 1786 - jointContactsEnabled(handle) { 1787 - const ret = wasm.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, handle); 1788 - return ret !== 0; 1789 - } 1790 - /** 1791 - * Sets whether contacts are enabled between the rigid-bodies attached by this joint. 1792 - * @param {number} handle 1793 - * @param {boolean} enabled 1794 - */ 1795 - jointSetContactsEnabled(handle, enabled) { 1796 - wasm.rawimpulsejointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled); 1797 - } 1798 - /** 1799 - * Are the limits for this joint enabled? 1800 - * @param {number} handle 1801 - * @param {RawJointAxis} axis 1802 - * @returns {boolean} 1803 - */ 1804 - jointLimitsEnabled(handle, axis) { 1805 - const ret = wasm.rawimpulsejointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis); 1806 - return ret !== 0; 1807 - } 1808 - /** 1809 - * Return the lower limit along the given joint axis. 1810 - * @param {number} handle 1811 - * @param {RawJointAxis} axis 1812 - * @returns {number} 1813 - */ 1814 - jointLimitsMin(handle, axis) { 1815 - const ret = wasm.rawimpulsejointset_jointLimitsMin(this.__wbg_ptr, handle, axis); 1816 - return ret; 1817 - } 1818 - /** 1819 - * If this is a prismatic joint, returns its upper limit. 1820 - * @param {number} handle 1821 - * @param {RawJointAxis} axis 1822 - * @returns {number} 1823 - */ 1824 - jointLimitsMax(handle, axis) { 1825 - const ret = wasm.rawimpulsejointset_jointLimitsMax(this.__wbg_ptr, handle, axis); 1826 - return ret; 1827 - } 1828 - /** 1829 - * Enables and sets the joint limits 1830 - * @param {number} handle 1831 - * @param {RawJointAxis} axis 1832 - * @param {number} min 1833 - * @param {number} max 1834 - */ 1835 - jointSetLimits(handle, axis, min, max) { 1836 - wasm.rawimpulsejointset_jointSetLimits(this.__wbg_ptr, handle, axis, min, max); 1837 - } 1838 - /** 1839 - * @param {number} handle 1840 - * @param {RawJointAxis} axis 1841 - * @param {RawMotorModel} model 1842 - */ 1843 - jointConfigureMotorModel(handle, axis, model) { 1844 - wasm.rawimpulsejointset_jointConfigureMotorModel(this.__wbg_ptr, handle, axis, model); 1845 - } 1846 - /** 1847 - * @param {number} handle 1848 - * @param {RawJointAxis} axis 1849 - * @param {number} targetVel 1850 - * @param {number} factor 1851 - */ 1852 - jointConfigureMotorVelocity(handle, axis, targetVel, factor) { 1853 - wasm.rawimpulsejointset_jointConfigureMotorVelocity(this.__wbg_ptr, handle, axis, targetVel, factor); 1854 - } 1855 - /** 1856 - * @param {number} handle 1857 - * @param {RawJointAxis} axis 1858 - * @param {number} targetPos 1859 - * @param {number} stiffness 1860 - * @param {number} damping 1861 - */ 1862 - jointConfigureMotorPosition(handle, axis, targetPos, stiffness, damping) { 1863 - wasm.rawimpulsejointset_jointConfigureMotorPosition(this.__wbg_ptr, handle, axis, targetPos, stiffness, damping); 1864 - } 1865 - /** 1866 - * @param {number} handle 1867 - * @param {RawJointAxis} axis 1868 - * @param {number} targetPos 1869 - * @param {number} targetVel 1870 - * @param {number} stiffness 1871 - * @param {number} damping 1872 - */ 1873 - jointConfigureMotor(handle, axis, targetPos, targetVel, stiffness, damping) { 1874 - wasm.rawimpulsejointset_jointConfigureMotor(this.__wbg_ptr, handle, axis, targetPos, targetVel, stiffness, damping); 1875 - } 1876 - /** 1877 - */ 1878 - constructor() { 1879 - const ret = wasm.rawimpulsejointset_new(); 1880 - this.__wbg_ptr = ret >>> 0; 1881 - return this; 1882 - } 1883 - /** 1884 - * @param {RawGenericJoint} params 1885 - * @param {number} parent1 1886 - * @param {number} parent2 1887 - * @param {boolean} wake_up 1888 - * @returns {number} 1889 - */ 1890 - createJoint(params, parent1, parent2, wake_up) { 1891 - _assertClass(params, RawGenericJoint); 1892 - const ret = wasm.rawimpulsejointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wake_up); 1893 - return ret; 1894 - } 1895 - /** 1896 - * @param {number} handle 1897 - * @param {boolean} wakeUp 1898 - */ 1899 - remove(handle, wakeUp) { 1900 - wasm.rawimpulsejointset_remove(this.__wbg_ptr, handle, wakeUp); 1901 - } 1902 - /** 1903 - * @returns {number} 1904 - */ 1905 - len() { 1906 - const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr); 1907 - return ret >>> 0; 1908 - } 1909 - /** 1910 - * @param {number} handle 1911 - * @returns {boolean} 1912 - */ 1913 - contains(handle) { 1914 - const ret = wasm.rawimpulsejointset_contains(this.__wbg_ptr, handle); 1915 - return ret !== 0; 1916 - } 1917 - /** 1918 - * Applies the given JavaScript function to the integer handle of each joint managed by this physics world. 1919 - * 1920 - * # Parameters 1921 - * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`. 1922 - * @param {Function} f 1923 - */ 1924 - forEachJointHandle(f) { 1925 - try { 1926 - wasm.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f)); 1927 - } finally { 1928 - heap[stack_pointer++] = void 0; 1929 - } 1930 - } 1931 - /** 1932 - * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body. 1933 - * 1934 - * # Parameters 1935 - * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`. 1936 - * @param {number} body 1937 - * @param {Function} f 1938 - */ 1939 - forEachJointAttachedToRigidBody(body, f) { 1940 - try { 1941 - wasm.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f)); 1942 - } finally { 1943 - heap[stack_pointer++] = void 0; 1944 - } 1945 - } 1946 - }; 1947 - var RawIntegrationParameters = class _RawIntegrationParameters { 1948 - static __wrap(ptr) { 1949 - ptr = ptr >>> 0; 1950 - const obj = Object.create(_RawIntegrationParameters.prototype); 1951 - obj.__wbg_ptr = ptr; 1952 - return obj; 1953 - } 1954 - __destroy_into_raw() { 1955 - const ptr = this.__wbg_ptr; 1956 - this.__wbg_ptr = 0; 1957 - return ptr; 1958 - } 1959 - free() { 1960 - const ptr = this.__destroy_into_raw(); 1961 - wasm.__wbg_rawintegrationparameters_free(ptr); 1962 - } 1963 - /** 1964 - */ 1965 - constructor() { 1966 - const ret = wasm.rawintegrationparameters_new(); 1967 - this.__wbg_ptr = ret >>> 0; 1968 - return this; 1969 - } 1970 - /** 1971 - * @returns {number} 1972 - */ 1973 - get dt() { 1974 - const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); 1975 - return ret; 1976 - } 1977 - /** 1978 - * @returns {number} 1979 - */ 1980 - get erp() { 1981 - const ret = wasm.rawintegrationparameters_erp(this.__wbg_ptr); 1982 - return ret; 1983 - } 1984 - /** 1985 - * @returns {number} 1986 - */ 1987 - get normalizedAllowedLinearError() { 1988 - const ret = wasm.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr); 1989 - return ret; 1990 - } 1991 - /** 1992 - * @returns {number} 1993 - */ 1994 - get normalizedPredictionDistance() { 1995 - const ret = wasm.rawintegrationparameters_normalizedPredictionDistance(this.__wbg_ptr); 1996 - return ret; 1997 - } 1998 - /** 1999 - * @returns {number} 2000 - */ 2001 - get numSolverIterations() { 2002 - const ret = wasm.rawintegrationparameters_numSolverIterations(this.__wbg_ptr); 2003 - return ret >>> 0; 2004 - } 2005 - /** 2006 - * @returns {number} 2007 - */ 2008 - get numAdditionalFrictionIterations() { 2009 - const ret = wasm.rawintegrationparameters_numAdditionalFrictionIterations(this.__wbg_ptr); 2010 - return ret >>> 0; 2011 - } 2012 - /** 2013 - * @returns {number} 2014 - */ 2015 - get numInternalPgsIterations() { 2016 - const ret = wasm.rawintegrationparameters_numInternalPgsIterations(this.__wbg_ptr); 2017 - return ret >>> 0; 2018 - } 2019 - /** 2020 - * @returns {number} 2021 - */ 2022 - get minIslandSize() { 2023 - const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr); 2024 - return ret >>> 0; 2025 - } 2026 - /** 2027 - * @returns {number} 2028 - */ 2029 - get maxCcdSubsteps() { 2030 - const ret = wasm.rawintegrationparameters_maxCcdSubsteps(this.__wbg_ptr); 2031 - return ret >>> 0; 2032 - } 2033 - /** 2034 - * @returns {number} 2035 - */ 2036 - get lengthUnit() { 2037 - const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr); 2038 - return ret; 2039 - } 2040 - /** 2041 - * @param {number} value 2042 - */ 2043 - set dt(value) { 2044 - wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, value); 2045 - } 2046 - /** 2047 - * @param {number} value 2048 - */ 2049 - set erp(value) { 2050 - wasm.rawintegrationparameters_set_erp(this.__wbg_ptr, value); 2051 - } 2052 - /** 2053 - * @param {number} value 2054 - */ 2055 - set normalizedAllowedLinearError(value) { 2056 - wasm.rawintegrationparameters_set_normalizedAllowedLinearError(this.__wbg_ptr, value); 2057 - } 2058 - /** 2059 - * @param {number} value 2060 - */ 2061 - set normalizedPredictionDistance(value) { 2062 - wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, value); 2063 - } 2064 - /** 2065 - * @param {number} value 2066 - */ 2067 - set numSolverIterations(value) { 2068 - wasm.rawintegrationparameters_set_numSolverIterations(this.__wbg_ptr, value); 2069 - } 2070 - /** 2071 - * @param {number} value 2072 - */ 2073 - set numAdditionalFrictionIterations(value) { 2074 - wasm.rawintegrationparameters_set_numAdditionalFrictionIterations(this.__wbg_ptr, value); 2075 - } 2076 - /** 2077 - * @param {number} value 2078 - */ 2079 - set numInternalPgsIterations(value) { 2080 - wasm.rawintegrationparameters_set_numInternalPgsIterations(this.__wbg_ptr, value); 2081 - } 2082 - /** 2083 - * @param {number} value 2084 - */ 2085 - set minIslandSize(value) { 2086 - wasm.rawintegrationparameters_set_minIslandSize(this.__wbg_ptr, value); 2087 - } 2088 - /** 2089 - * @param {number} value 2090 - */ 2091 - set maxCcdSubsteps(value) { 2092 - wasm.rawintegrationparameters_set_maxCcdSubsteps(this.__wbg_ptr, value); 2093 - } 2094 - /** 2095 - * @param {number} value 2096 - */ 2097 - set lengthUnit(value) { 2098 - wasm.rawintegrationparameters_set_lengthUnit(this.__wbg_ptr, value); 2099 - } 2100 - /** 2101 - */ 2102 - switchToStandardPgsSolver() { 2103 - wasm.rawintegrationparameters_switchToStandardPgsSolver(this.__wbg_ptr); 2104 - } 2105 - /** 2106 - */ 2107 - switchToSmallStepsPgsSolver() { 2108 - wasm.rawintegrationparameters_switchToSmallStepsPgsSolver(this.__wbg_ptr); 2109 - } 2110 - /** 2111 - */ 2112 - switchToSmallStepsPgsSolverWithoutWarmstart() { 2113 - wasm.rawintegrationparameters_switchToSmallStepsPgsSolverWithoutWarmstart(this.__wbg_ptr); 2114 - } 2115 - }; 2116 - var RawIslandManager = class _RawIslandManager { 2117 - static __wrap(ptr) { 2118 - ptr = ptr >>> 0; 2119 - const obj = Object.create(_RawIslandManager.prototype); 2120 - obj.__wbg_ptr = ptr; 2121 - return obj; 2122 - } 2123 - __destroy_into_raw() { 2124 - const ptr = this.__wbg_ptr; 2125 - this.__wbg_ptr = 0; 2126 - return ptr; 2127 - } 2128 - free() { 2129 - const ptr = this.__destroy_into_raw(); 2130 - wasm.__wbg_rawislandmanager_free(ptr); 2131 - } 2132 - /** 2133 - */ 2134 - constructor() { 2135 - const ret = wasm.rawislandmanager_new(); 2136 - this.__wbg_ptr = ret >>> 0; 2137 - return this; 2138 - } 2139 - /** 2140 - * Applies the given JavaScript function to the integer handle of each active rigid-body 2141 - * managed by this island manager. 2142 - * 2143 - * After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by 2144 - * the physics engine in order to save computational power. A sleeping rigid-body never moves 2145 - * unless it is moved manually by the user. 2146 - * 2147 - * # Parameters 2148 - * - `f(handle)`: the function to apply to the integer handle of each active rigid-body managed by this 2149 - * set. Called as `f(collider)`. 2150 - * @param {Function} f 2151 - */ 2152 - forEachActiveRigidBodyHandle(f) { 2153 - try { 2154 - wasm.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f)); 2155 - } finally { 2156 - heap[stack_pointer++] = void 0; 2157 - } 2158 - } 2159 - }; 2160 - var RawKinematicCharacterController = class { 2161 - __destroy_into_raw() { 2162 - const ptr = this.__wbg_ptr; 2163 - this.__wbg_ptr = 0; 2164 - return ptr; 2165 - } 2166 - free() { 2167 - const ptr = this.__destroy_into_raw(); 2168 - wasm.__wbg_rawkinematiccharactercontroller_free(ptr); 2169 - } 2170 - /** 2171 - * @param {number} offset 2172 - */ 2173 - constructor(offset) { 2174 - const ret = wasm.rawkinematiccharactercontroller_new(offset); 2175 - this.__wbg_ptr = ret >>> 0; 2176 - return this; 2177 - } 2178 - /** 2179 - * @returns {RawVector} 2180 - */ 2181 - up() { 2182 - const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr); 2183 - return RawVector.__wrap(ret); 2184 - } 2185 - /** 2186 - * @param {RawVector} vector 2187 - */ 2188 - setUp(vector) { 2189 - _assertClass(vector, RawVector); 2190 - wasm.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, vector.__wbg_ptr); 2191 - } 2192 - /** 2193 - * @returns {number} 2194 - */ 2195 - normalNudgeFactor() { 2196 - const ret = wasm.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr); 2197 - return ret; 2198 - } 2199 - /** 2200 - * @param {number} value 2201 - */ 2202 - setNormalNudgeFactor(value) { 2203 - wasm.rawkinematiccharactercontroller_setNormalNudgeFactor(this.__wbg_ptr, value); 2204 - } 2205 - /** 2206 - * @returns {number} 2207 - */ 2208 - offset() { 2209 - const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); 2210 - return ret; 2211 - } 2212 - /** 2213 - * @param {number} value 2214 - */ 2215 - setOffset(value) { 2216 - wasm.rawkinematiccharactercontroller_setOffset(this.__wbg_ptr, value); 2217 - } 2218 - /** 2219 - * @returns {boolean} 2220 - */ 2221 - slideEnabled() { 2222 - const ret = wasm.rawkinematiccharactercontroller_slideEnabled(this.__wbg_ptr); 2223 - return ret !== 0; 2224 - } 2225 - /** 2226 - * @param {boolean} enabled 2227 - */ 2228 - setSlideEnabled(enabled) { 2229 - wasm.rawkinematiccharactercontroller_setSlideEnabled(this.__wbg_ptr, enabled); 2230 - } 2231 - /** 2232 - * @returns {number | undefined} 2233 - */ 2234 - autostepMaxHeight() { 2235 - try { 2236 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 2237 - wasm.rawkinematiccharactercontroller_autostepMaxHeight(retptr, this.__wbg_ptr); 2238 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 2239 - var r1 = getFloat32Memory0()[retptr / 4 + 1]; 2240 - return r0 === 0 ? void 0 : r1; 2241 - } finally { 2242 - wasm.__wbindgen_add_to_stack_pointer(16); 2243 - } 2244 - } 2245 - /** 2246 - * @returns {number | undefined} 2247 - */ 2248 - autostepMinWidth() { 2249 - try { 2250 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 2251 - wasm.rawkinematiccharactercontroller_autostepMinWidth(retptr, this.__wbg_ptr); 2252 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 2253 - var r1 = getFloat32Memory0()[retptr / 4 + 1]; 2254 - return r0 === 0 ? void 0 : r1; 2255 - } finally { 2256 - wasm.__wbindgen_add_to_stack_pointer(16); 2257 - } 2258 - } 2259 - /** 2260 - * @returns {boolean | undefined} 2261 - */ 2262 - autostepIncludesDynamicBodies() { 2263 - const ret = wasm.rawkinematiccharactercontroller_autostepIncludesDynamicBodies(this.__wbg_ptr); 2264 - return ret === 16777215 ? void 0 : ret !== 0; 2265 - } 2266 - /** 2267 - * @returns {boolean} 2268 - */ 2269 - autostepEnabled() { 2270 - const ret = wasm.rawkinematiccharactercontroller_autostepEnabled(this.__wbg_ptr); 2271 - return ret !== 0; 2272 - } 2273 - /** 2274 - * @param {number} maxHeight 2275 - * @param {number} minWidth 2276 - * @param {boolean} includeDynamicBodies 2277 - */ 2278 - enableAutostep(maxHeight, minWidth, includeDynamicBodies) { 2279 - wasm.rawkinematiccharactercontroller_enableAutostep(this.__wbg_ptr, maxHeight, minWidth, includeDynamicBodies); 2280 - } 2281 - /** 2282 - */ 2283 - disableAutostep() { 2284 - wasm.rawkinematiccharactercontroller_disableAutostep(this.__wbg_ptr); 2285 - } 2286 - /** 2287 - * @returns {number} 2288 - */ 2289 - maxSlopeClimbAngle() { 2290 - const ret = wasm.rawintegrationparameters_normalizedPredictionDistance(this.__wbg_ptr); 2291 - return ret; 2292 - } 2293 - /** 2294 - * @param {number} angle 2295 - */ 2296 - setMaxSlopeClimbAngle(angle) { 2297 - wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, angle); 2298 - } 2299 - /** 2300 - * @returns {number} 2301 - */ 2302 - minSlopeSlideAngle() { 2303 - const ret = wasm.rawkinematiccharactercontroller_minSlopeSlideAngle(this.__wbg_ptr); 2304 - return ret; 2305 - } 2306 - /** 2307 - * @param {number} angle 2308 - */ 2309 - setMinSlopeSlideAngle(angle) { 2310 - wasm.rawkinematiccharactercontroller_setMinSlopeSlideAngle(this.__wbg_ptr, angle); 2311 - } 2312 - /** 2313 - * @returns {number | undefined} 2314 - */ 2315 - snapToGroundDistance() { 2316 - try { 2317 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 2318 - wasm.rawkinematiccharactercontroller_snapToGroundDistance(retptr, this.__wbg_ptr); 2319 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 2320 - var r1 = getFloat32Memory0()[retptr / 4 + 1]; 2321 - return r0 === 0 ? void 0 : r1; 2322 - } finally { 2323 - wasm.__wbindgen_add_to_stack_pointer(16); 2324 - } 2325 - } 2326 - /** 2327 - * @param {number} distance 2328 - */ 2329 - enableSnapToGround(distance) { 2330 - wasm.rawkinematiccharactercontroller_enableSnapToGround(this.__wbg_ptr, distance); 2331 - } 2332 - /** 2333 - */ 2334 - disableSnapToGround() { 2335 - wasm.rawkinematiccharactercontroller_disableSnapToGround(this.__wbg_ptr); 2336 - } 2337 - /** 2338 - * @returns {boolean} 2339 - */ 2340 - snapToGroundEnabled() { 2341 - const ret = wasm.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr); 2342 - return ret !== 0; 2343 - } 2344 - /** 2345 - * @param {number} dt 2346 - * @param {RawRigidBodySet} bodies 2347 - * @param {RawColliderSet} colliders 2348 - * @param {RawQueryPipeline} queries 2349 - * @param {number} collider_handle 2350 - * @param {RawVector} desired_translation_delta 2351 - * @param {boolean} apply_impulses_to_dynamic_bodies 2352 - * @param {number | undefined} character_mass 2353 - * @param {number} filter_flags 2354 - * @param {number | undefined} filter_groups 2355 - * @param {Function} filter_predicate 2356 - */ 2357 - computeColliderMovement(dt, bodies, colliders, queries, collider_handle, desired_translation_delta, apply_impulses_to_dynamic_bodies, character_mass, filter_flags, filter_groups, filter_predicate) { 2358 - try { 2359 - _assertClass(bodies, RawRigidBodySet); 2360 - _assertClass(colliders, RawColliderSet); 2361 - _assertClass(queries, RawQueryPipeline); 2362 - _assertClass(desired_translation_delta, RawVector); 2363 - 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)); 2364 - } finally { 2365 - heap[stack_pointer++] = void 0; 2366 - } 2367 - } 2368 - /** 2369 - * @returns {RawVector} 2370 - */ 2371 - computedMovement() { 2372 - const ret = wasm.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr); 2373 - return RawVector.__wrap(ret); 2374 - } 2375 - /** 2376 - * @returns {boolean} 2377 - */ 2378 - computedGrounded() { 2379 - const ret = wasm.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr); 2380 - return ret !== 0; 2381 - } 2382 - /** 2383 - * @returns {number} 2384 - */ 2385 - numComputedCollisions() { 2386 - const ret = wasm.rawkinematiccharactercontroller_numComputedCollisions(this.__wbg_ptr); 2387 - return ret >>> 0; 2388 - } 2389 - /** 2390 - * @param {number} i 2391 - * @param {RawCharacterCollision} collision 2392 - * @returns {boolean} 2393 - */ 2394 - computedCollision(i, collision) { 2395 - _assertClass(collision, RawCharacterCollision); 2396 - const ret = wasm.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, i, collision.__wbg_ptr); 2397 - return ret !== 0; 2398 - } 2399 - }; 2400 - var RawMultibodyJointSet = class _RawMultibodyJointSet { 2401 - static __wrap(ptr) { 2402 - ptr = ptr >>> 0; 2403 - const obj = Object.create(_RawMultibodyJointSet.prototype); 2404 - obj.__wbg_ptr = ptr; 2405 - return obj; 2406 - } 2407 - __destroy_into_raw() { 2408 - const ptr = this.__wbg_ptr; 2409 - this.__wbg_ptr = 0; 2410 - return ptr; 2411 - } 2412 - free() { 2413 - const ptr = this.__destroy_into_raw(); 2414 - wasm.__wbg_rawmultibodyjointset_free(ptr); 2415 - } 2416 - /** 2417 - * The type of this joint. 2418 - * @param {number} handle 2419 - * @returns {RawJointType} 2420 - */ 2421 - jointType(handle) { 2422 - const ret = wasm.rawmultibodyjointset_jointType(this.__wbg_ptr, handle); 2423 - return ret; 2424 - } 2425 - /** 2426 - * The angular part of the joint’s local frame relative to the first rigid-body it is attached to. 2427 - * @param {number} handle 2428 - * @returns {RawRotation} 2429 - */ 2430 - jointFrameX1(handle) { 2431 - const ret = wasm.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, handle); 2432 - return RawRotation.__wrap(ret); 2433 - } 2434 - /** 2435 - * The angular part of the joint’s local frame relative to the second rigid-body it is attached to. 2436 - * @param {number} handle 2437 - * @returns {RawRotation} 2438 - */ 2439 - jointFrameX2(handle) { 2440 - const ret = wasm.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, handle); 2441 - return RawRotation.__wrap(ret); 2442 - } 2443 - /** 2444 - * The position of the first anchor of this joint. 2445 - * 2446 - * The first anchor gives the position of the points application point on the 2447 - * local frame of the first rigid-body it is attached to. 2448 - * @param {number} handle 2449 - * @returns {RawVector} 2450 - */ 2451 - jointAnchor1(handle) { 2452 - const ret = wasm.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, handle); 2453 - return RawVector.__wrap(ret); 2454 - } 2455 - /** 2456 - * The position of the second anchor of this joint. 2457 - * 2458 - * The second anchor gives the position of the points application point on the 2459 - * local frame of the second rigid-body it is attached to. 2460 - * @param {number} handle 2461 - * @returns {RawVector} 2462 - */ 2463 - jointAnchor2(handle) { 2464 - const ret = wasm.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, handle); 2465 - return RawVector.__wrap(ret); 2466 - } 2467 - /** 2468 - * Are contacts between the rigid-bodies attached by this joint enabled? 2469 - * @param {number} handle 2470 - * @returns {boolean} 2471 - */ 2472 - jointContactsEnabled(handle) { 2473 - const ret = wasm.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, handle); 2474 - return ret !== 0; 2475 - } 2476 - /** 2477 - * Sets whether contacts are enabled between the rigid-bodies attached by this joint. 2478 - * @param {number} handle 2479 - * @param {boolean} enabled 2480 - */ 2481 - jointSetContactsEnabled(handle, enabled) { 2482 - wasm.rawmultibodyjointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled); 2483 - } 2484 - /** 2485 - * Are the limits for this joint enabled? 2486 - * @param {number} handle 2487 - * @param {RawJointAxis} axis 2488 - * @returns {boolean} 2489 - */ 2490 - jointLimitsEnabled(handle, axis) { 2491 - const ret = wasm.rawmultibodyjointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis); 2492 - return ret !== 0; 2493 - } 2494 - /** 2495 - * Return the lower limit along the given joint axis. 2496 - * @param {number} handle 2497 - * @param {RawJointAxis} axis 2498 - * @returns {number} 2499 - */ 2500 - jointLimitsMin(handle, axis) { 2501 - const ret = wasm.rawmultibodyjointset_jointLimitsMin(this.__wbg_ptr, handle, axis); 2502 - return ret; 2503 - } 2504 - /** 2505 - * If this is a prismatic joint, returns its upper limit. 2506 - * @param {number} handle 2507 - * @param {RawJointAxis} axis 2508 - * @returns {number} 2509 - */ 2510 - jointLimitsMax(handle, axis) { 2511 - const ret = wasm.rawmultibodyjointset_jointLimitsMax(this.__wbg_ptr, handle, axis); 2512 - return ret; 2513 - } 2514 - /** 2515 - */ 2516 - constructor() { 2517 - const ret = wasm.rawmultibodyjointset_new(); 2518 - this.__wbg_ptr = ret >>> 0; 2519 - return this; 2520 - } 2521 - /** 2522 - * @param {RawGenericJoint} params 2523 - * @param {number} parent1 2524 - * @param {number} parent2 2525 - * @param {boolean} wakeUp 2526 - * @returns {number} 2527 - */ 2528 - createJoint(params, parent1, parent2, wakeUp) { 2529 - _assertClass(params, RawGenericJoint); 2530 - const ret = wasm.rawmultibodyjointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wakeUp); 2531 - return ret; 2532 - } 2533 - /** 2534 - * @param {number} handle 2535 - * @param {boolean} wakeUp 2536 - */ 2537 - remove(handle, wakeUp) { 2538 - wasm.rawmultibodyjointset_remove(this.__wbg_ptr, handle, wakeUp); 2539 - } 2540 - /** 2541 - * @param {number} handle 2542 - * @returns {boolean} 2543 - */ 2544 - contains(handle) { 2545 - const ret = wasm.rawmultibodyjointset_contains(this.__wbg_ptr, handle); 2546 - return ret !== 0; 2547 - } 2548 - /** 2549 - * Applies the given JavaScript function to the integer handle of each joint managed by this physics world. 2550 - * 2551 - * # Parameters 2552 - * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`. 2553 - * @param {Function} f 2554 - */ 2555 - forEachJointHandle(f) { 2556 - try { 2557 - wasm.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f)); 2558 - } finally { 2559 - heap[stack_pointer++] = void 0; 2560 - } 2561 - } 2562 - /** 2563 - * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body. 2564 - * 2565 - * # Parameters 2566 - * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`. 2567 - * @param {number} body 2568 - * @param {Function} f 2569 - */ 2570 - forEachJointAttachedToRigidBody(body, f) { 2571 - try { 2572 - wasm.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f)); 2573 - } finally { 2574 - heap[stack_pointer++] = void 0; 2575 - } 2576 - } 2577 - }; 2578 - var RawNarrowPhase = class _RawNarrowPhase { 2579 - static __wrap(ptr) { 2580 - ptr = ptr >>> 0; 2581 - const obj = Object.create(_RawNarrowPhase.prototype); 2582 - obj.__wbg_ptr = ptr; 2583 - return obj; 2584 - } 2585 - __destroy_into_raw() { 2586 - const ptr = this.__wbg_ptr; 2587 - this.__wbg_ptr = 0; 2588 - return ptr; 2589 - } 2590 - free() { 2591 - const ptr = this.__destroy_into_raw(); 2592 - wasm.__wbg_rawnarrowphase_free(ptr); 2593 - } 2594 - /** 2595 - */ 2596 - constructor() { 2597 - const ret = wasm.rawnarrowphase_new(); 2598 - this.__wbg_ptr = ret >>> 0; 2599 - return this; 2600 - } 2601 - /** 2602 - * @param {number} handle1 2603 - * @param {Function} f 2604 - */ 2605 - contact_pairs_with(handle1, f) { 2606 - wasm.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f)); 2607 - } 2608 - /** 2609 - * @param {number} handle1 2610 - * @param {number} handle2 2611 - * @returns {RawContactPair | undefined} 2612 - */ 2613 - contact_pair(handle1, handle2) { 2614 - const ret = wasm.rawnarrowphase_contact_pair(this.__wbg_ptr, handle1, handle2); 2615 - return ret === 0 ? void 0 : RawContactPair.__wrap(ret); 2616 - } 2617 - /** 2618 - * @param {number} handle1 2619 - * @param {Function} f 2620 - */ 2621 - intersection_pairs_with(handle1, f) { 2622 - wasm.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f)); 2623 - } 2624 - /** 2625 - * @param {number} handle1 2626 - * @param {number} handle2 2627 - * @returns {boolean} 2628 - */ 2629 - intersection_pair(handle1, handle2) { 2630 - const ret = wasm.rawnarrowphase_intersection_pair(this.__wbg_ptr, handle1, handle2); 2631 - return ret !== 0; 2632 - } 2633 - }; 2634 - var RawPhysicsPipeline = class { 2635 - __destroy_into_raw() { 2636 - const ptr = this.__wbg_ptr; 2637 - this.__wbg_ptr = 0; 2638 - return ptr; 2639 - } 2640 - free() { 2641 - const ptr = this.__destroy_into_raw(); 2642 - wasm.__wbg_rawphysicspipeline_free(ptr); 2643 - } 2644 - /** 2645 - */ 2646 - constructor() { 2647 - const ret = wasm.rawphysicspipeline_new(); 2648 - this.__wbg_ptr = ret >>> 0; 2649 - return this; 2650 - } 2651 - /** 2652 - * @param {RawVector} gravity 2653 - * @param {RawIntegrationParameters} integrationParameters 2654 - * @param {RawIslandManager} islands 2655 - * @param {RawBroadPhase} broadPhase 2656 - * @param {RawNarrowPhase} narrowPhase 2657 - * @param {RawRigidBodySet} bodies 2658 - * @param {RawColliderSet} colliders 2659 - * @param {RawImpulseJointSet} joints 2660 - * @param {RawMultibodyJointSet} articulations 2661 - * @param {RawCCDSolver} ccd_solver 2662 - */ 2663 - step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver) { 2664 - _assertClass(gravity, RawVector); 2665 - _assertClass(integrationParameters, RawIntegrationParameters); 2666 - _assertClass(islands, RawIslandManager); 2667 - _assertClass(broadPhase, RawBroadPhase); 2668 - _assertClass(narrowPhase, RawNarrowPhase); 2669 - _assertClass(bodies, RawRigidBodySet); 2670 - _assertClass(colliders, RawColliderSet); 2671 - _assertClass(joints, RawImpulseJointSet); 2672 - _assertClass(articulations, RawMultibodyJointSet); 2673 - _assertClass(ccd_solver, RawCCDSolver); 2674 - 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); 2675 - } 2676 - /** 2677 - * @param {RawVector} gravity 2678 - * @param {RawIntegrationParameters} integrationParameters 2679 - * @param {RawIslandManager} islands 2680 - * @param {RawBroadPhase} broadPhase 2681 - * @param {RawNarrowPhase} narrowPhase 2682 - * @param {RawRigidBodySet} bodies 2683 - * @param {RawColliderSet} colliders 2684 - * @param {RawImpulseJointSet} joints 2685 - * @param {RawMultibodyJointSet} articulations 2686 - * @param {RawCCDSolver} ccd_solver 2687 - * @param {RawEventQueue} eventQueue 2688 - * @param {object} hookObject 2689 - * @param {Function} hookFilterContactPair 2690 - * @param {Function} hookFilterIntersectionPair 2691 - */ 2692 - stepWithEvents(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver, eventQueue, hookObject, hookFilterContactPair, hookFilterIntersectionPair) { 2693 - _assertClass(gravity, RawVector); 2694 - _assertClass(integrationParameters, RawIntegrationParameters); 2695 - _assertClass(islands, RawIslandManager); 2696 - _assertClass(broadPhase, RawBroadPhase); 2697 - _assertClass(narrowPhase, RawNarrowPhase); 2698 - _assertClass(bodies, RawRigidBodySet); 2699 - _assertClass(colliders, RawColliderSet); 2700 - _assertClass(joints, RawImpulseJointSet); 2701 - _assertClass(articulations, RawMultibodyJointSet); 2702 - _assertClass(ccd_solver, RawCCDSolver); 2703 - _assertClass(eventQueue, RawEventQueue); 2704 - 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)); 2705 - } 2706 - }; 2707 - var RawPointColliderProjection = class _RawPointColliderProjection { 2708 - static __wrap(ptr) { 2709 - ptr = ptr >>> 0; 2710 - const obj = Object.create(_RawPointColliderProjection.prototype); 2711 - obj.__wbg_ptr = ptr; 2712 - return obj; 2713 - } 2714 - __destroy_into_raw() { 2715 - const ptr = this.__wbg_ptr; 2716 - this.__wbg_ptr = 0; 2717 - return ptr; 2718 - } 2719 - free() { 2720 - const ptr = this.__destroy_into_raw(); 2721 - wasm.__wbg_rawpointcolliderprojection_free(ptr); 2722 - } 2723 - /** 2724 - * @returns {number} 2725 - */ 2726 - colliderHandle() { 2727 - const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr); 2728 - return ret; 2729 - } 2730 - /** 2731 - * @returns {RawVector} 2732 - */ 2733 - point() { 2734 - const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr); 2735 - return RawVector.__wrap(ret); 2736 - } 2737 - /** 2738 - * @returns {boolean} 2739 - */ 2740 - isInside() { 2741 - const ret = wasm.rawpointcolliderprojection_isInside(this.__wbg_ptr); 2742 - return ret !== 0; 2743 - } 2744 - /** 2745 - * @returns {RawFeatureType} 2746 - */ 2747 - featureType() { 2748 - const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr); 2749 - return ret; 2750 - } 2751 - /** 2752 - * @returns {number | undefined} 2753 - */ 2754 - featureId() { 2755 - try { 2756 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 2757 - wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr); 2758 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 2759 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 2760 - return r0 === 0 ? void 0 : r1 >>> 0; 2761 - } finally { 2762 - wasm.__wbindgen_add_to_stack_pointer(16); 2763 - } 2764 - } 2765 - }; 2766 - var RawPointProjection = class _RawPointProjection { 2767 - static __wrap(ptr) { 2768 - ptr = ptr >>> 0; 2769 - const obj = Object.create(_RawPointProjection.prototype); 2770 - obj.__wbg_ptr = ptr; 2771 - return obj; 2772 - } 2773 - __destroy_into_raw() { 2774 - const ptr = this.__wbg_ptr; 2775 - this.__wbg_ptr = 0; 2776 - return ptr; 2777 - } 2778 - free() { 2779 - const ptr = this.__destroy_into_raw(); 2780 - wasm.__wbg_rawpointprojection_free(ptr); 2781 - } 2782 - /** 2783 - * @returns {RawVector} 2784 - */ 2785 - point() { 2786 - const ret = wasm.rawpointprojection_point(this.__wbg_ptr); 2787 - return RawVector.__wrap(ret); 2788 - } 2789 - /** 2790 - * @returns {boolean} 2791 - */ 2792 - isInside() { 2793 - const ret = wasm.rawpointprojection_isInside(this.__wbg_ptr); 2794 - return ret !== 0; 2795 - } 2796 - }; 2797 - var RawQueryPipeline = class { 2798 - __destroy_into_raw() { 2799 - const ptr = this.__wbg_ptr; 2800 - this.__wbg_ptr = 0; 2801 - return ptr; 2802 - } 2803 - free() { 2804 - const ptr = this.__destroy_into_raw(); 2805 - wasm.__wbg_rawquerypipeline_free(ptr); 2806 - } 2807 - /** 2808 - */ 2809 - constructor() { 2810 - const ret = wasm.rawquerypipeline_new(); 2811 - this.__wbg_ptr = ret >>> 0; 2812 - return this; 2813 - } 2814 - /** 2815 - * @param {RawRigidBodySet} bodies 2816 - * @param {RawColliderSet} colliders 2817 - */ 2818 - update(bodies, colliders) { 2819 - _assertClass(bodies, RawRigidBodySet); 2820 - _assertClass(colliders, RawColliderSet); 2821 - wasm.rawquerypipeline_update(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr); 2822 - } 2823 - /** 2824 - * @param {RawRigidBodySet} bodies 2825 - * @param {RawColliderSet} colliders 2826 - * @param {RawVector} rayOrig 2827 - * @param {RawVector} rayDir 2828 - * @param {number} maxToi 2829 - * @param {boolean} solid 2830 - * @param {number} filter_flags 2831 - * @param {number | undefined} filter_groups 2832 - * @param {number | undefined} filter_exclude_collider 2833 - * @param {number | undefined} filter_exclude_rigid_body 2834 - * @param {Function} filter_predicate 2835 - * @returns {RawRayColliderHit | undefined} 2836 - */ 2837 - castRay(bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2838 - try { 2839 - _assertClass(bodies, RawRigidBodySet); 2840 - _assertClass(colliders, RawColliderSet); 2841 - _assertClass(rayOrig, RawVector); 2842 - _assertClass(rayDir, RawVector); 2843 - 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)); 2844 - return ret === 0 ? void 0 : RawRayColliderHit.__wrap(ret); 2845 - } finally { 2846 - heap[stack_pointer++] = void 0; 2847 - } 2848 - } 2849 - /** 2850 - * @param {RawRigidBodySet} bodies 2851 - * @param {RawColliderSet} colliders 2852 - * @param {RawVector} rayOrig 2853 - * @param {RawVector} rayDir 2854 - * @param {number} maxToi 2855 - * @param {boolean} solid 2856 - * @param {number} filter_flags 2857 - * @param {number | undefined} filter_groups 2858 - * @param {number | undefined} filter_exclude_collider 2859 - * @param {number | undefined} filter_exclude_rigid_body 2860 - * @param {Function} filter_predicate 2861 - * @returns {RawRayColliderIntersection | undefined} 2862 - */ 2863 - castRayAndGetNormal(bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2864 - try { 2865 - _assertClass(bodies, RawRigidBodySet); 2866 - _assertClass(colliders, RawColliderSet); 2867 - _assertClass(rayOrig, RawVector); 2868 - _assertClass(rayDir, RawVector); 2869 - 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)); 2870 - return ret === 0 ? void 0 : RawRayColliderIntersection.__wrap(ret); 2871 - } finally { 2872 - heap[stack_pointer++] = void 0; 2873 - } 2874 - } 2875 - /** 2876 - * @param {RawRigidBodySet} bodies 2877 - * @param {RawColliderSet} colliders 2878 - * @param {RawVector} rayOrig 2879 - * @param {RawVector} rayDir 2880 - * @param {number} maxToi 2881 - * @param {boolean} solid 2882 - * @param {Function} callback 2883 - * @param {number} filter_flags 2884 - * @param {number | undefined} filter_groups 2885 - * @param {number | undefined} filter_exclude_collider 2886 - * @param {number | undefined} filter_exclude_rigid_body 2887 - * @param {Function} filter_predicate 2888 - */ 2889 - intersectionsWithRay(bodies, colliders, rayOrig, rayDir, maxToi, solid, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2890 - try { 2891 - _assertClass(bodies, RawRigidBodySet); 2892 - _assertClass(colliders, RawColliderSet); 2893 - _assertClass(rayOrig, RawVector); 2894 - _assertClass(rayDir, RawVector); 2895 - 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)); 2896 - } finally { 2897 - heap[stack_pointer++] = void 0; 2898 - heap[stack_pointer++] = void 0; 2899 - } 2900 - } 2901 - /** 2902 - * @param {RawRigidBodySet} bodies 2903 - * @param {RawColliderSet} colliders 2904 - * @param {RawVector} shapePos 2905 - * @param {RawRotation} shapeRot 2906 - * @param {RawShape} shape 2907 - * @param {number} filter_flags 2908 - * @param {number | undefined} filter_groups 2909 - * @param {number | undefined} filter_exclude_collider 2910 - * @param {number | undefined} filter_exclude_rigid_body 2911 - * @param {Function} filter_predicate 2912 - * @returns {number | undefined} 2913 - */ 2914 - intersectionWithShape(bodies, colliders, shapePos, shapeRot, shape, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2915 - try { 2916 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 2917 - _assertClass(bodies, RawRigidBodySet); 2918 - _assertClass(colliders, RawColliderSet); 2919 - _assertClass(shapePos, RawVector); 2920 - _assertClass(shapeRot, RawRotation); 2921 - _assertClass(shape, RawShape); 2922 - 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)); 2923 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 2924 - var r2 = getFloat64Memory0()[retptr / 8 + 1]; 2925 - return r0 === 0 ? void 0 : r2; 2926 - } finally { 2927 - wasm.__wbindgen_add_to_stack_pointer(16); 2928 - heap[stack_pointer++] = void 0; 2929 - } 2930 - } 2931 - /** 2932 - * @param {RawRigidBodySet} bodies 2933 - * @param {RawColliderSet} colliders 2934 - * @param {RawVector} point 2935 - * @param {boolean} solid 2936 - * @param {number} filter_flags 2937 - * @param {number | undefined} filter_groups 2938 - * @param {number | undefined} filter_exclude_collider 2939 - * @param {number | undefined} filter_exclude_rigid_body 2940 - * @param {Function} filter_predicate 2941 - * @returns {RawPointColliderProjection | undefined} 2942 - */ 2943 - projectPoint(bodies, colliders, point, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2944 - try { 2945 - _assertClass(bodies, RawRigidBodySet); 2946 - _assertClass(colliders, RawColliderSet); 2947 - _assertClass(point, RawVector); 2948 - 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)); 2949 - return ret === 0 ? void 0 : RawPointColliderProjection.__wrap(ret); 2950 - } finally { 2951 - heap[stack_pointer++] = void 0; 2952 - } 2953 - } 2954 - /** 2955 - * @param {RawRigidBodySet} bodies 2956 - * @param {RawColliderSet} colliders 2957 - * @param {RawVector} point 2958 - * @param {number} filter_flags 2959 - * @param {number | undefined} filter_groups 2960 - * @param {number | undefined} filter_exclude_collider 2961 - * @param {number | undefined} filter_exclude_rigid_body 2962 - * @param {Function} filter_predicate 2963 - * @returns {RawPointColliderProjection | undefined} 2964 - */ 2965 - projectPointAndGetFeature(bodies, colliders, point, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2966 - try { 2967 - _assertClass(bodies, RawRigidBodySet); 2968 - _assertClass(colliders, RawColliderSet); 2969 - _assertClass(point, RawVector); 2970 - 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)); 2971 - return ret === 0 ? void 0 : RawPointColliderProjection.__wrap(ret); 2972 - } finally { 2973 - heap[stack_pointer++] = void 0; 2974 - } 2975 - } 2976 - /** 2977 - * @param {RawRigidBodySet} bodies 2978 - * @param {RawColliderSet} colliders 2979 - * @param {RawVector} point 2980 - * @param {Function} callback 2981 - * @param {number} filter_flags 2982 - * @param {number | undefined} filter_groups 2983 - * @param {number | undefined} filter_exclude_collider 2984 - * @param {number | undefined} filter_exclude_rigid_body 2985 - * @param {Function} filter_predicate 2986 - */ 2987 - intersectionsWithPoint(bodies, colliders, point, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 2988 - try { 2989 - _assertClass(bodies, RawRigidBodySet); 2990 - _assertClass(colliders, RawColliderSet); 2991 - _assertClass(point, RawVector); 2992 - 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)); 2993 - } finally { 2994 - heap[stack_pointer++] = void 0; 2995 - heap[stack_pointer++] = void 0; 2996 - } 2997 - } 2998 - /** 2999 - * @param {RawRigidBodySet} bodies 3000 - * @param {RawColliderSet} colliders 3001 - * @param {RawVector} shapePos 3002 - * @param {RawRotation} shapeRot 3003 - * @param {RawVector} shapeVel 3004 - * @param {RawShape} shape 3005 - * @param {number} target_distance 3006 - * @param {number} maxToi 3007 - * @param {boolean} stop_at_penetration 3008 - * @param {number} filter_flags 3009 - * @param {number | undefined} filter_groups 3010 - * @param {number | undefined} filter_exclude_collider 3011 - * @param {number | undefined} filter_exclude_rigid_body 3012 - * @param {Function} filter_predicate 3013 - * @returns {RawColliderShapeCastHit | undefined} 3014 - */ 3015 - 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) { 3016 - try { 3017 - _assertClass(bodies, RawRigidBodySet); 3018 - _assertClass(colliders, RawColliderSet); 3019 - _assertClass(shapePos, RawVector); 3020 - _assertClass(shapeRot, RawRotation); 3021 - _assertClass(shapeVel, RawVector); 3022 - _assertClass(shape, RawShape); 3023 - 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)); 3024 - return ret === 0 ? void 0 : RawColliderShapeCastHit.__wrap(ret); 3025 - } finally { 3026 - heap[stack_pointer++] = void 0; 3027 - } 3028 - } 3029 - /** 3030 - * @param {RawRigidBodySet} bodies 3031 - * @param {RawColliderSet} colliders 3032 - * @param {RawVector} shapePos 3033 - * @param {RawRotation} shapeRot 3034 - * @param {RawShape} shape 3035 - * @param {Function} callback 3036 - * @param {number} filter_flags 3037 - * @param {number | undefined} filter_groups 3038 - * @param {number | undefined} filter_exclude_collider 3039 - * @param {number | undefined} filter_exclude_rigid_body 3040 - * @param {Function} filter_predicate 3041 - */ 3042 - intersectionsWithShape(bodies, colliders, shapePos, shapeRot, shape, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { 3043 - try { 3044 - _assertClass(bodies, RawRigidBodySet); 3045 - _assertClass(colliders, RawColliderSet); 3046 - _assertClass(shapePos, RawVector); 3047 - _assertClass(shapeRot, RawRotation); 3048 - _assertClass(shape, RawShape); 3049 - 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)); 3050 - } finally { 3051 - heap[stack_pointer++] = void 0; 3052 - heap[stack_pointer++] = void 0; 3053 - } 3054 - } 3055 - /** 3056 - * @param {RawVector} aabbCenter 3057 - * @param {RawVector} aabbHalfExtents 3058 - * @param {Function} callback 3059 - */ 3060 - collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) { 3061 - try { 3062 - _assertClass(aabbCenter, RawVector); 3063 - _assertClass(aabbHalfExtents, RawVector); 3064 - wasm.rawquerypipeline_collidersWithAabbIntersectingAabb(this.__wbg_ptr, aabbCenter.__wbg_ptr, aabbHalfExtents.__wbg_ptr, addBorrowedObject(callback)); 3065 - } finally { 3066 - heap[stack_pointer++] = void 0; 3067 - } 3068 - } 3069 - }; 3070 - var RawRayColliderHit = class _RawRayColliderHit { 3071 - static __wrap(ptr) { 3072 - ptr = ptr >>> 0; 3073 - const obj = Object.create(_RawRayColliderHit.prototype); 3074 - obj.__wbg_ptr = ptr; 3075 - return obj; 3076 - } 3077 - __destroy_into_raw() { 3078 - const ptr = this.__wbg_ptr; 3079 - this.__wbg_ptr = 0; 3080 - return ptr; 3081 - } 3082 - free() { 3083 - const ptr = this.__destroy_into_raw(); 3084 - wasm.__wbg_rawraycolliderhit_free(ptr); 3085 - } 3086 - /** 3087 - * @returns {number} 3088 - */ 3089 - colliderHandle() { 3090 - const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr); 3091 - return ret; 3092 - } 3093 - /** 3094 - * @returns {number} 3095 - */ 3096 - timeOfImpact() { 3097 - const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); 3098 - return ret; 3099 - } 3100 - }; 3101 - var RawRayColliderIntersection = class _RawRayColliderIntersection { 3102 - static __wrap(ptr) { 3103 - ptr = ptr >>> 0; 3104 - const obj = Object.create(_RawRayColliderIntersection.prototype); 3105 - obj.__wbg_ptr = ptr; 3106 - return obj; 3107 - } 3108 - __destroy_into_raw() { 3109 - const ptr = this.__wbg_ptr; 3110 - this.__wbg_ptr = 0; 3111 - return ptr; 3112 - } 3113 - free() { 3114 - const ptr = this.__destroy_into_raw(); 3115 - wasm.__wbg_rawraycolliderintersection_free(ptr); 3116 - } 3117 - /** 3118 - * @returns {number} 3119 - */ 3120 - colliderHandle() { 3121 - const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr); 3122 - return ret; 3123 - } 3124 - /** 3125 - * @returns {RawVector} 3126 - */ 3127 - normal() { 3128 - const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); 3129 - return RawVector.__wrap(ret); 3130 - } 3131 - /** 3132 - * @returns {number} 3133 - */ 3134 - time_of_impact() { 3135 - const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); 3136 - return ret; 3137 - } 3138 - /** 3139 - * @returns {RawFeatureType} 3140 - */ 3141 - featureType() { 3142 - const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr); 3143 - return ret; 3144 - } 3145 - /** 3146 - * @returns {number | undefined} 3147 - */ 3148 - featureId() { 3149 - try { 3150 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 3151 - wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr); 3152 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 3153 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 3154 - return r0 === 0 ? void 0 : r1 >>> 0; 3155 - } finally { 3156 - wasm.__wbindgen_add_to_stack_pointer(16); 3157 - } 3158 - } 3159 - }; 3160 - var RawRayIntersection = class _RawRayIntersection { 3161 - static __wrap(ptr) { 3162 - ptr = ptr >>> 0; 3163 - const obj = Object.create(_RawRayIntersection.prototype); 3164 - obj.__wbg_ptr = ptr; 3165 - return obj; 3166 - } 3167 - __destroy_into_raw() { 3168 - const ptr = this.__wbg_ptr; 3169 - this.__wbg_ptr = 0; 3170 - return ptr; 3171 - } 3172 - free() { 3173 - const ptr = this.__destroy_into_raw(); 3174 - wasm.__wbg_rawrayintersection_free(ptr); 3175 - } 3176 - /** 3177 - * @returns {RawVector} 3178 - */ 3179 - normal() { 3180 - const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); 3181 - return RawVector.__wrap(ret); 3182 - } 3183 - /** 3184 - * @returns {number} 3185 - */ 3186 - time_of_impact() { 3187 - const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); 3188 - return ret; 3189 - } 3190 - /** 3191 - * @returns {RawFeatureType} 3192 - */ 3193 - featureType() { 3194 - const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr); 3195 - return ret; 3196 - } 3197 - /** 3198 - * @returns {number | undefined} 3199 - */ 3200 - featureId() { 3201 - try { 3202 - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 3203 - wasm.rawpointcolliderprojection_featureId(retptr, this.__wbg_ptr); 3204 - var r0 = getInt32Memory0()[retptr / 4 + 0]; 3205 - var r1 = getInt32Memory0()[retptr / 4 + 1]; 3206 - return r0 === 0 ? void 0 : r1 >>> 0; 3207 - } finally { 3208 - wasm.__wbindgen_add_to_stack_pointer(16); 3209 - } 3210 - } 3211 - }; 3212 - var RawRigidBodySet = class _RawRigidBodySet { 3213 - static __wrap(ptr) { 3214 - ptr = ptr >>> 0; 3215 - const obj = Object.create(_RawRigidBodySet.prototype); 3216 - obj.__wbg_ptr = ptr; 3217 - return obj; 3218 - } 3219 - __destroy_into_raw() { 3220 - const ptr = this.__wbg_ptr; 3221 - this.__wbg_ptr = 0; 3222 - return ptr; 3223 - } 3224 - free() { 3225 - const ptr = this.__destroy_into_raw(); 3226 - wasm.__wbg_rawrigidbodyset_free(ptr); 3227 - } 3228 - /** 3229 - * The world-space translation of this rigid-body. 3230 - * @param {number} handle 3231 - * @returns {RawVector} 3232 - */ 3233 - rbTranslation(handle) { 3234 - const ret = wasm.rawrigidbodyset_rbTranslation(this.__wbg_ptr, handle); 3235 - return RawVector.__wrap(ret); 3236 - } 3237 - /** 3238 - * The world-space orientation of this rigid-body. 3239 - * @param {number} handle 3240 - * @returns {RawRotation} 3241 - */ 3242 - rbRotation(handle) { 3243 - const ret = wasm.rawrigidbodyset_rbRotation(this.__wbg_ptr, handle); 3244 - return RawRotation.__wrap(ret); 3245 - } 3246 - /** 3247 - * Put the given rigid-body to sleep. 3248 - * @param {number} handle 3249 - */ 3250 - rbSleep(handle) { 3251 - wasm.rawrigidbodyset_rbSleep(this.__wbg_ptr, handle); 3252 - } 3253 - /** 3254 - * Is this rigid-body sleeping? 3255 - * @param {number} handle 3256 - * @returns {boolean} 3257 - */ 3258 - rbIsSleeping(handle) { 3259 - const ret = wasm.rawrigidbodyset_rbIsSleeping(this.__wbg_ptr, handle); 3260 - return ret !== 0; 3261 - } 3262 - /** 3263 - * Is the velocity of this rigid-body not zero? 3264 - * @param {number} handle 3265 - * @returns {boolean} 3266 - */ 3267 - rbIsMoving(handle) { 3268 - const ret = wasm.rawrigidbodyset_rbIsMoving(this.__wbg_ptr, handle); 3269 - return ret !== 0; 3270 - } 3271 - /** 3272 - * The world-space predicted translation of this rigid-body. 3273 - * 3274 - * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation` 3275 - * method and is used for estimating the kinematic body velocity at the next timestep. 3276 - * For non-kinematic bodies, this value is currently unspecified. 3277 - * @param {number} handle 3278 - * @returns {RawVector} 3279 - */ 3280 - rbNextTranslation(handle) { 3281 - const ret = wasm.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, handle); 3282 - return RawVector.__wrap(ret); 3283 - } 3284 - /** 3285 - * The world-space predicted orientation of this rigid-body. 3286 - * 3287 - * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation` 3288 - * method and is used for estimating the kinematic body velocity at the next timestep. 3289 - * For non-kinematic bodies, this value is currently unspecified. 3290 - * @param {number} handle 3291 - * @returns {RawRotation} 3292 - */ 3293 - rbNextRotation(handle) { 3294 - const ret = wasm.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, handle); 3295 - return RawRotation.__wrap(ret); 3296 - } 3297 - /** 3298 - * Sets the translation of this rigid-body. 3299 - * 3300 - * # Parameters 3301 - * - `x`: the world-space position of the rigid-body along the `x` axis. 3302 - * - `y`: the world-space position of the rigid-body along the `y` axis. 3303 - * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it 3304 - * wasn't moving before modifying its position. 3305 - * @param {number} handle 3306 - * @param {number} x 3307 - * @param {number} y 3308 - * @param {boolean} wakeUp 3309 - */ 3310 - rbSetTranslation(handle, x, y, wakeUp) { 3311 - wasm.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, handle, x, y, wakeUp); 3312 - } 3313 - /** 3314 - * Sets the rotation angle of this rigid-body. 3315 - * 3316 - * # Parameters 3317 - * - `angle`: the rotation angle, in radians. 3318 - * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it 3319 - * wasn't moving before modifying its position. 3320 - * @param {number} handle 3321 - * @param {number} angle 3322 - * @param {boolean} wakeUp 3323 - */ 3324 - rbSetRotation(handle, angle, wakeUp) { 3325 - wasm.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, handle, angle, wakeUp); 3326 - } 3327 - /** 3328 - * Sets the linear velocity of this rigid-body. 3329 - * @param {number} handle 3330 - * @param {RawVector} linvel 3331 - * @param {boolean} wakeUp 3332 - */ 3333 - rbSetLinvel(handle, linvel, wakeUp) { 3334 - _assertClass(linvel, RawVector); 3335 - wasm.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, handle, linvel.__wbg_ptr, wakeUp); 3336 - } 3337 - /** 3338 - * Sets the angular velocity of this rigid-body. 3339 - * @param {number} handle 3340 - * @param {number} angvel 3341 - * @param {boolean} wakeUp 3342 - */ 3343 - rbSetAngvel(handle, angvel, wakeUp) { 3344 - wasm.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, handle, angvel, wakeUp); 3345 - } 3346 - /** 3347 - * If this rigid body is kinematic, sets its future translation after the next timestep integration. 3348 - * 3349 - * This should be used instead of `rigidBody.setTranslation` to make the dynamic object 3350 - * interacting with this kinematic body behave as expected. Internally, Rapier will compute 3351 - * an artificial velocity for this rigid-body from its current position and its next kinematic 3352 - * position. This velocity will be used to compute forces on dynamic bodies interacting with 3353 - * this body. 3354 - * 3355 - * # Parameters 3356 - * - `x`: the world-space position of the rigid-body along the `x` axis. 3357 - * - `y`: the world-space position of the rigid-body along the `y` axis. 3358 - * @param {number} handle 3359 - * @param {number} x 3360 - * @param {number} y 3361 - */ 3362 - rbSetNextKinematicTranslation(handle, x, y) { 3363 - wasm.rawrigidbodyset_rbSetNextKinematicTranslation(this.__wbg_ptr, handle, x, y); 3364 - } 3365 - /** 3366 - * If this rigid body is kinematic, sets its future rotation after the next timestep integration. 3367 - * 3368 - * This should be used instead of `rigidBody.setRotation` to make the dynamic object 3369 - * interacting with this kinematic body behave as expected. Internally, Rapier will compute 3370 - * an artificial velocity for this rigid-body from its current position and its next kinematic 3371 - * position. This velocity will be used to compute forces on dynamic bodies interacting with 3372 - * this body. 3373 - * 3374 - * # Parameters 3375 - * - `angle`: the rotation angle, in radians. 3376 - * @param {number} handle 3377 - * @param {number} angle 3378 - */ 3379 - rbSetNextKinematicRotation(handle, angle) { 3380 - wasm.rawrigidbodyset_rbSetNextKinematicRotation(this.__wbg_ptr, handle, angle); 3381 - } 3382 - /** 3383 - * @param {number} handle 3384 - * @param {RawColliderSet} colliders 3385 - */ 3386 - rbRecomputeMassPropertiesFromColliders(handle, colliders) { 3387 - _assertClass(colliders, RawColliderSet); 3388 - wasm.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, handle, colliders.__wbg_ptr); 3389 - } 3390 - /** 3391 - * @param {number} handle 3392 - * @param {number} mass 3393 - * @param {boolean} wake_up 3394 - */ 3395 - rbSetAdditionalMass(handle, mass, wake_up) { 3396 - wasm.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, handle, mass, wake_up); 3397 - } 3398 - /** 3399 - * @param {number} handle 3400 - * @param {number} mass 3401 - * @param {RawVector} centerOfMass 3402 - * @param {number} principalAngularInertia 3403 - * @param {boolean} wake_up 3404 - */ 3405 - rbSetAdditionalMassProperties(handle, mass, centerOfMass, principalAngularInertia, wake_up) { 3406 - _assertClass(centerOfMass, RawVector); 3407 - wasm.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia, wake_up); 3408 - } 3409 - /** 3410 - * The linear velocity of this rigid-body. 3411 - * @param {number} handle 3412 - * @returns {RawVector} 3413 - */ 3414 - rbLinvel(handle) { 3415 - const ret = wasm.rawrigidbodyset_rbLinvel(this.__wbg_ptr, handle); 3416 - return RawVector.__wrap(ret); 3417 - } 3418 - /** 3419 - * The angular velocity of this rigid-body. 3420 - * @param {number} handle 3421 - * @returns {number} 3422 - */ 3423 - rbAngvel(handle) { 3424 - const ret = wasm.rawrigidbodyset_rbAngvel(this.__wbg_ptr, handle); 3425 - return ret; 3426 - } 3427 - /** 3428 - * @param {number} handle 3429 - * @param {boolean} locked 3430 - * @param {boolean} wake_up 3431 - */ 3432 - rbLockTranslations(handle, locked, wake_up) { 3433 - wasm.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, handle, locked, wake_up); 3434 - } 3435 - /** 3436 - * @param {number} handle 3437 - * @param {boolean} allow_x 3438 - * @param {boolean} allow_y 3439 - * @param {boolean} wake_up 3440 - */ 3441 - rbSetEnabledTranslations(handle, allow_x, allow_y, wake_up) { 3442 - wasm.rawrigidbodyset_rbSetEnabledTranslations(this.__wbg_ptr, handle, allow_x, allow_y, wake_up); 3443 - } 3444 - /** 3445 - * @param {number} handle 3446 - * @param {boolean} locked 3447 - * @param {boolean} wake_up 3448 - */ 3449 - rbLockRotations(handle, locked, wake_up) { 3450 - wasm.rawrigidbodyset_rbLockRotations(this.__wbg_ptr, handle, locked, wake_up); 3451 - } 3452 - /** 3453 - * @param {number} handle 3454 - * @returns {number} 3455 - */ 3456 - rbDominanceGroup(handle) { 3457 - const ret = wasm.rawrigidbodyset_rbDominanceGroup(this.__wbg_ptr, handle); 3458 - return ret; 3459 - } 3460 - /** 3461 - * @param {number} handle 3462 - * @param {number} group 3463 - */ 3464 - rbSetDominanceGroup(handle, group) { 3465 - wasm.rawrigidbodyset_rbSetDominanceGroup(this.__wbg_ptr, handle, group); 3466 - } 3467 - /** 3468 - * @param {number} handle 3469 - * @param {boolean} enabled 3470 - */ 3471 - rbEnableCcd(handle, enabled) { 3472 - wasm.rawrigidbodyset_rbEnableCcd(this.__wbg_ptr, handle, enabled); 3473 - } 3474 - /** 3475 - * @param {number} handle 3476 - * @param {number} prediction 3477 - */ 3478 - rbSetSoftCcdPrediction(handle, prediction) { 3479 - wasm.rawrigidbodyset_rbSetSoftCcdPrediction(this.__wbg_ptr, handle, prediction); 3480 - } 3481 - /** 3482 - * The mass of this rigid-body. 3483 - * @param {number} handle 3484 - * @returns {number} 3485 - */ 3486 - rbMass(handle) { 3487 - const ret = wasm.rawrigidbodyset_rbMass(this.__wbg_ptr, handle); 3488 - return ret; 3489 - } 3490 - /** 3491 - * The inverse of the mass of a rigid-body. 3492 - * 3493 - * If this is zero, the rigid-body is assumed to have infinite mass. 3494 - * @param {number} handle 3495 - * @returns {number} 3496 - */ 3497 - rbInvMass(handle) { 3498 - const ret = wasm.rawrigidbodyset_rbInvMass(this.__wbg_ptr, handle); 3499 - return ret; 3500 - } 3501 - /** 3502 - * The inverse mass taking into account translation locking. 3503 - * @param {number} handle 3504 - * @returns {RawVector} 3505 - */ 3506 - rbEffectiveInvMass(handle) { 3507 - const ret = wasm.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, handle); 3508 - return RawVector.__wrap(ret); 3509 - } 3510 - /** 3511 - * The center of mass of a rigid-body expressed in its local-space. 3512 - * @param {number} handle 3513 - * @returns {RawVector} 3514 - */ 3515 - rbLocalCom(handle) { 3516 - const ret = wasm.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, handle); 3517 - return RawVector.__wrap(ret); 3518 - } 3519 - /** 3520 - * The world-space center of mass of the rigid-body. 3521 - * @param {number} handle 3522 - * @returns {RawVector} 3523 - */ 3524 - rbWorldCom(handle) { 3525 - const ret = wasm.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, handle); 3526 - return RawVector.__wrap(ret); 3527 - } 3528 - /** 3529 - * The inverse of the principal angular inertia of the rigid-body. 3530 - * 3531 - * Components set to zero are assumed to be infinite along the corresponding principal axis. 3532 - * @param {number} handle 3533 - * @returns {number} 3534 - */ 3535 - rbInvPrincipalInertiaSqrt(handle) { 3536 - const ret = wasm.rawrigidbodyset_rbInvPrincipalInertiaSqrt(this.__wbg_ptr, handle); 3537 - return ret; 3538 - } 3539 - /** 3540 - * The angular inertia along the principal inertia axes of the rigid-body. 3541 - * @param {number} handle 3542 - * @returns {number} 3543 - */ 3544 - rbPrincipalInertia(handle) { 3545 - const ret = wasm.rawrigidbodyset_rbPrincipalInertia(this.__wbg_ptr, handle); 3546 - return ret; 3547 - } 3548 - /** 3549 - * The square-root of the world-space inverse angular inertia tensor of the rigid-body, 3550 - * taking into account rotation locking. 3551 - * @param {number} handle 3552 - * @returns {number} 3553 - */ 3554 - rbEffectiveWorldInvInertiaSqrt(handle) { 3555 - const ret = wasm.rawrigidbodyset_rbEffectiveWorldInvInertiaSqrt(this.__wbg_ptr, handle); 3556 - return ret; 3557 - } 3558 - /** 3559 - * The effective world-space angular inertia (that takes the potential rotation locking into account) of 3560 - * this rigid-body. 3561 - * @param {number} handle 3562 - * @returns {number} 3563 - */ 3564 - rbEffectiveAngularInertia(handle) { 3565 - const ret = wasm.rawrigidbodyset_rbEffectiveAngularInertia(this.__wbg_ptr, handle); 3566 - return ret; 3567 - } 3568 - /** 3569 - * Wakes this rigid-body up. 3570 - * 3571 - * A dynamic rigid-body that does not move during several consecutive frames will 3572 - * be put to sleep by the physics engine, i.e., it will stop being simulated in order 3573 - * to avoid useless computations. 3574 - * This method forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying 3575 - * the position of a dynamic body so that it is properly simulated afterwards. 3576 - * @param {number} handle 3577 - */ 3578 - rbWakeUp(handle) { 3579 - wasm.rawrigidbodyset_rbWakeUp(this.__wbg_ptr, handle); 3580 - } 3581 - /** 3582 - * Is Continuous Collision Detection enabled for this rigid-body? 3583 - * @param {number} handle 3584 - * @returns {boolean} 3585 - */ 3586 - rbIsCcdEnabled(handle) { 3587 - const ret = wasm.rawrigidbodyset_rbIsCcdEnabled(this.__wbg_ptr, handle); 3588 - return ret !== 0; 3589 - } 3590 - /** 3591 - * @param {number} handle 3592 - * @returns {number} 3593 - */ 3594 - rbSoftCcdPrediction(handle) { 3595 - const ret = wasm.rawrigidbodyset_rbSoftCcdPrediction(this.__wbg_ptr, handle); 3596 - return ret; 3597 - } 3598 - /** 3599 - * The number of colliders attached to this rigid-body. 3600 - * @param {number} handle 3601 - * @returns {number} 3602 - */ 3603 - rbNumColliders(handle) { 3604 - const ret = wasm.rawrigidbodyset_rbNumColliders(this.__wbg_ptr, handle); 3605 - return ret >>> 0; 3606 - } 3607 - /** 3608 - * Retrieves the `i-th` collider attached to this rigid-body. 3609 - * 3610 - * # Parameters 3611 - * - `at`: The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`. 3612 - * This index is **not** the same as the unique identifier of the collider. 3613 - * @param {number} handle 3614 - * @param {number} at 3615 - * @returns {number} 3616 - */ 3617 - rbCollider(handle, at) { 3618 - const ret = wasm.rawrigidbodyset_rbCollider(this.__wbg_ptr, handle, at); 3619 - return ret; 3620 - } 3621 - /** 3622 - * The status of this rigid-body: fixed, dynamic, or kinematic. 3623 - * @param {number} handle 3624 - * @returns {RawRigidBodyType} 3625 - */ 3626 - rbBodyType(handle) { 3627 - const ret = wasm.rawrigidbodyset_rbBodyType(this.__wbg_ptr, handle); 3628 - return ret; 3629 - } 3630 - /** 3631 - * Set a new status for this rigid-body: fixed, dynamic, or kinematic. 3632 - * @param {number} handle 3633 - * @param {RawRigidBodyType} status 3634 - * @param {boolean} wake_up 3635 - */ 3636 - rbSetBodyType(handle, status, wake_up) { 3637 - wasm.rawrigidbodyset_rbSetBodyType(this.__wbg_ptr, handle, status, wake_up); 3638 - } 3639 - /** 3640 - * Is this rigid-body fixed? 3641 - * @param {number} handle 3642 - * @returns {boolean} 3643 - */ 3644 - rbIsFixed(handle) { 3645 - const ret = wasm.rawrigidbodyset_rbIsFixed(this.__wbg_ptr, handle); 3646 - return ret !== 0; 3647 - } 3648 - /** 3649 - * Is this rigid-body kinematic? 3650 - * @param {number} handle 3651 - * @returns {boolean} 3652 - */ 3653 - rbIsKinematic(handle) { 3654 - const ret = wasm.rawrigidbodyset_rbIsKinematic(this.__wbg_ptr, handle); 3655 - return ret !== 0; 3656 - } 3657 - /** 3658 - * Is this rigid-body dynamic? 3659 - * @param {number} handle 3660 - * @returns {boolean} 3661 - */ 3662 - rbIsDynamic(handle) { 3663 - const ret = wasm.rawrigidbodyset_rbIsDynamic(this.__wbg_ptr, handle); 3664 - return ret !== 0; 3665 - } 3666 - /** 3667 - * The linear damping coefficient of this rigid-body. 3668 - * @param {number} handle 3669 - * @returns {number} 3670 - */ 3671 - rbLinearDamping(handle) { 3672 - const ret = wasm.rawrigidbodyset_rbLinearDamping(this.__wbg_ptr, handle); 3673 - return ret; 3674 - } 3675 - /** 3676 - * The angular damping coefficient of this rigid-body. 3677 - * @param {number} handle 3678 - * @returns {number} 3679 - */ 3680 - rbAngularDamping(handle) { 3681 - const ret = wasm.rawrigidbodyset_rbAngularDamping(this.__wbg_ptr, handle); 3682 - return ret; 3683 - } 3684 - /** 3685 - * @param {number} handle 3686 - * @param {number} factor 3687 - */ 3688 - rbSetLinearDamping(handle, factor) { 3689 - wasm.rawrigidbodyset_rbSetLinearDamping(this.__wbg_ptr, handle, factor); 3690 - } 3691 - /** 3692 - * @param {number} handle 3693 - * @param {number} factor 3694 - */ 3695 - rbSetAngularDamping(handle, factor) { 3696 - wasm.rawrigidbodyset_rbSetAngularDamping(this.__wbg_ptr, handle, factor); 3697 - } 3698 - /** 3699 - * @param {number} handle 3700 - * @param {boolean} enabled 3701 - */ 3702 - rbSetEnabled(handle, enabled) { 3703 - wasm.rawrigidbodyset_rbSetEnabled(this.__wbg_ptr, handle, enabled); 3704 - } 3705 - /** 3706 - * @param {number} handle 3707 - * @returns {boolean} 3708 - */ 3709 - rbIsEnabled(handle) { 3710 - const ret = wasm.rawrigidbodyset_rbIsEnabled(this.__wbg_ptr, handle); 3711 - return ret !== 0; 3712 - } 3713 - /** 3714 - * @param {number} handle 3715 - * @returns {number} 3716 - */ 3717 - rbGravityScale(handle) { 3718 - const ret = wasm.rawrigidbodyset_rbGravityScale(this.__wbg_ptr, handle); 3719 - return ret; 3720 - } 3721 - /** 3722 - * @param {number} handle 3723 - * @param {number} factor 3724 - * @param {boolean} wakeUp 3725 - */ 3726 - rbSetGravityScale(handle, factor, wakeUp) { 3727 - wasm.rawrigidbodyset_rbSetGravityScale(this.__wbg_ptr, handle, factor, wakeUp); 3728 - } 3729 - /** 3730 - * Resets to zero all user-added forces added to this rigid-body. 3731 - * @param {number} handle 3732 - * @param {boolean} wakeUp 3733 - */ 3734 - rbResetForces(handle, wakeUp) { 3735 - wasm.rawrigidbodyset_rbResetForces(this.__wbg_ptr, handle, wakeUp); 3736 - } 3737 - /** 3738 - * Resets to zero all user-added torques added to this rigid-body. 3739 - * @param {number} handle 3740 - * @param {boolean} wakeUp 3741 - */ 3742 - rbResetTorques(handle, wakeUp) { 3743 - wasm.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, handle, wakeUp); 3744 - } 3745 - /** 3746 - * Adds a force at the center-of-mass of this rigid-body. 3747 - * 3748 - * # Parameters 3749 - * - `force`: the world-space force to apply on the rigid-body. 3750 - * - `wakeUp`: should the rigid-body be automatically woken-up? 3751 - * @param {number} handle 3752 - * @param {RawVector} force 3753 - * @param {boolean} wakeUp 3754 - */ 3755 - rbAddForce(handle, force, wakeUp) { 3756 - _assertClass(force, RawVector); 3757 - wasm.rawrigidbodyset_rbAddForce(this.__wbg_ptr, handle, force.__wbg_ptr, wakeUp); 3758 - } 3759 - /** 3760 - * Applies an impulse at the center-of-mass of this rigid-body. 3761 - * 3762 - * # Parameters 3763 - * - `impulse`: the world-space impulse to apply on the rigid-body. 3764 - * - `wakeUp`: should the rigid-body be automatically woken-up? 3765 - * @param {number} handle 3766 - * @param {RawVector} impulse 3767 - * @param {boolean} wakeUp 3768 - */ 3769 - rbApplyImpulse(handle, impulse, wakeUp) { 3770 - _assertClass(impulse, RawVector); 3771 - wasm.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, handle, impulse.__wbg_ptr, wakeUp); 3772 - } 3773 - /** 3774 - * Adds a torque at the center-of-mass of this rigid-body. 3775 - * 3776 - * # Parameters 3777 - * - `torque`: the torque to apply on the rigid-body. 3778 - * - `wakeUp`: should the rigid-body be automatically woken-up? 3779 - * @param {number} handle 3780 - * @param {number} torque 3781 - * @param {boolean} wakeUp 3782 - */ 3783 - rbAddTorque(handle, torque, wakeUp) { 3784 - wasm.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, handle, torque, wakeUp); 3785 - } 3786 - /** 3787 - * Applies an impulsive torque at the center-of-mass of this rigid-body. 3788 - * 3789 - * # Parameters 3790 - * - `torque impulse`: the torque impulse to apply on the rigid-body. 3791 - * - `wakeUp`: should the rigid-body be automatically woken-up? 3792 - * @param {number} handle 3793 - * @param {number} torque_impulse 3794 - * @param {boolean} wakeUp 3795 - */ 3796 - rbApplyTorqueImpulse(handle, torque_impulse, wakeUp) { 3797 - wasm.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, handle, torque_impulse, wakeUp); 3798 - } 3799 - /** 3800 - * Adds a force at the given world-space point of this rigid-body. 3801 - * 3802 - * # Parameters 3803 - * - `force`: the world-space force to apply on the rigid-body. 3804 - * - `point`: the world-space point where the impulse is to be applied on the rigid-body. 3805 - * - `wakeUp`: should the rigid-body be automatically woken-up? 3806 - * @param {number} handle 3807 - * @param {RawVector} force 3808 - * @param {RawVector} point 3809 - * @param {boolean} wakeUp 3810 - */ 3811 - rbAddForceAtPoint(handle, force, point, wakeUp) { 3812 - _assertClass(force, RawVector); 3813 - _assertClass(point, RawVector); 3814 - wasm.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, handle, force.__wbg_ptr, point.__wbg_ptr, wakeUp); 3815 - } 3816 - /** 3817 - * Applies an impulse at the given world-space point of this rigid-body. 3818 - * 3819 - * # Parameters 3820 - * - `impulse`: the world-space impulse to apply on the rigid-body. 3821 - * - `point`: the world-space point where the impulse is to be applied on the rigid-body. 3822 - * - `wakeUp`: should the rigid-body be automatically woken-up? 3823 - * @param {number} handle 3824 - * @param {RawVector} impulse 3825 - * @param {RawVector} point 3826 - * @param {boolean} wakeUp 3827 - */ 3828 - rbApplyImpulseAtPoint(handle, impulse, point, wakeUp) { 3829 - _assertClass(impulse, RawVector); 3830 - _assertClass(point, RawVector); 3831 - wasm.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, handle, impulse.__wbg_ptr, point.__wbg_ptr, wakeUp); 3832 - } 3833 - /** 3834 - * @param {number} handle 3835 - * @returns {number} 3836 - */ 3837 - rbAdditionalSolverIterations(handle) { 3838 - const ret = wasm.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, handle); 3839 - return ret >>> 0; 3840 - } 3841 - /** 3842 - * @param {number} handle 3843 - * @param {number} iters 3844 - */ 3845 - rbSetAdditionalSolverIterations(handle, iters) { 3846 - wasm.rawrigidbodyset_rbSetAdditionalSolverIterations(this.__wbg_ptr, handle, iters); 3847 - } 3848 - /** 3849 - * An arbitrary user-defined 32-bit integer 3850 - * @param {number} handle 3851 - * @returns {number} 3852 - */ 3853 - rbUserData(handle) { 3854 - const ret = wasm.rawrigidbodyset_rbUserData(this.__wbg_ptr, handle); 3855 - return ret >>> 0; 3856 - } 3857 - /** 3858 - * Sets the user-defined 32-bit integer of this rigid-body. 3859 - * 3860 - * # Parameters 3861 - * - `data`: an arbitrary user-defined 32-bit integer. 3862 - * @param {number} handle 3863 - * @param {number} data 3864 - */ 3865 - rbSetUserData(handle, data) { 3866 - wasm.rawrigidbodyset_rbSetUserData(this.__wbg_ptr, handle, data); 3867 - } 3868 - /** 3869 - */ 3870 - constructor() { 3871 - const ret = wasm.rawrigidbodyset_new(); 3872 - this.__wbg_ptr = ret >>> 0; 3873 - return this; 3874 - } 3875 - /** 3876 - * @param {boolean} enabled 3877 - * @param {RawVector} translation 3878 - * @param {RawRotation} rotation 3879 - * @param {number} gravityScale 3880 - * @param {number} mass 3881 - * @param {boolean} massOnly 3882 - * @param {RawVector} centerOfMass 3883 - * @param {RawVector} linvel 3884 - * @param {number} angvel 3885 - * @param {number} principalAngularInertia 3886 - * @param {boolean} translationEnabledX 3887 - * @param {boolean} translationEnabledY 3888 - * @param {boolean} rotationsEnabled 3889 - * @param {number} linearDamping 3890 - * @param {number} angularDamping 3891 - * @param {RawRigidBodyType} rb_type 3892 - * @param {boolean} canSleep 3893 - * @param {boolean} sleeping 3894 - * @param {number} softCcdPrediciton 3895 - * @param {boolean} ccdEnabled 3896 - * @param {number} dominanceGroup 3897 - * @param {number} additional_solver_iterations 3898 - * @returns {number} 3899 - */ 3900 - 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) { 3901 - _assertClass(translation, RawVector); 3902 - _assertClass(rotation, RawRotation); 3903 - _assertClass(centerOfMass, RawVector); 3904 - _assertClass(linvel, RawVector); 3905 - 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); 3906 - return ret; 3907 - } 3908 - /** 3909 - * @param {number} handle 3910 - * @param {RawIslandManager} islands 3911 - * @param {RawColliderSet} colliders 3912 - * @param {RawImpulseJointSet} joints 3913 - * @param {RawMultibodyJointSet} articulations 3914 - */ 3915 - remove(handle, islands, colliders, joints, articulations) { 3916 - _assertClass(islands, RawIslandManager); 3917 - _assertClass(colliders, RawColliderSet); 3918 - _assertClass(joints, RawImpulseJointSet); 3919 - _assertClass(articulations, RawMultibodyJointSet); 3920 - wasm.rawrigidbodyset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr); 3921 - } 3922 - /** 3923 - * The number of rigid-bodies on this set. 3924 - * @returns {number} 3925 - */ 3926 - len() { 3927 - const ret = wasm.rawcolliderset_len(this.__wbg_ptr); 3928 - return ret >>> 0; 3929 - } 3930 - /** 3931 - * Checks if a rigid-body with the given integer handle exists. 3932 - * @param {number} handle 3933 - * @returns {boolean} 3934 - */ 3935 - contains(handle) { 3936 - const ret = wasm.rawrigidbodyset_contains(this.__wbg_ptr, handle); 3937 - return ret !== 0; 3938 - } 3939 - /** 3940 - * Applies the given JavaScript function to the integer handle of each rigid-body managed by this set. 3941 - * 3942 - * # Parameters 3943 - * - `f(handle)`: the function to apply to the integer handle of each rigid-body managed by this set. Called as `f(collider)`. 3944 - * @param {Function} f 3945 - */ 3946 - forEachRigidBodyHandle(f) { 3947 - try { 3948 - wasm.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f)); 3949 - } finally { 3950 - heap[stack_pointer++] = void 0; 3951 - } 3952 - } 3953 - /** 3954 - * @param {RawColliderSet} colliders 3955 - */ 3956 - propagateModifiedBodyPositionsToColliders(colliders) { 3957 - _assertClass(colliders, RawColliderSet); 3958 - wasm.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, colliders.__wbg_ptr); 3959 - } 3960 - }; 3961 - var RawRotation = class _RawRotation { 3962 - static __wrap(ptr) { 3963 - ptr = ptr >>> 0; 3964 - const obj = Object.create(_RawRotation.prototype); 3965 - obj.__wbg_ptr = ptr; 3966 - return obj; 3967 - } 3968 - __destroy_into_raw() { 3969 - const ptr = this.__wbg_ptr; 3970 - this.__wbg_ptr = 0; 3971 - return ptr; 3972 - } 3973 - free() { 3974 - const ptr = this.__destroy_into_raw(); 3975 - wasm.__wbg_rawrotation_free(ptr); 3976 - } 3977 - /** 3978 - * The identity rotation. 3979 - * @returns {RawRotation} 3980 - */ 3981 - static identity() { 3982 - const ret = wasm.rawrotation_identity(); 3983 - return _RawRotation.__wrap(ret); 3984 - } 3985 - /** 3986 - * The rotation with thegiven angle. 3987 - * @param {number} angle 3988 - * @returns {RawRotation} 3989 - */ 3990 - static fromAngle(angle) { 3991 - const ret = wasm.rawrotation_fromAngle(angle); 3992 - return _RawRotation.__wrap(ret); 3993 - } 3994 - /** 3995 - * The imaginary part of this complex number. 3996 - * @returns {number} 3997 - */ 3998 - get im() { 3999 - const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); 4000 - return ret; 4001 - } 4002 - /** 4003 - * The real part of this complex number. 4004 - * @returns {number} 4005 - */ 4006 - get re() { 4007 - const ret = wasm.rawrotation_re(this.__wbg_ptr); 4008 - return ret; 4009 - } 4010 - /** 4011 - * The rotation angle in radians. 4012 - * @returns {number} 4013 - */ 4014 - get angle() { 4015 - const ret = wasm.rawrotation_angle(this.__wbg_ptr); 4016 - return ret; 4017 - } 4018 - }; 4019 - var RawSerializationPipeline = class { 4020 - __destroy_into_raw() { 4021 - const ptr = this.__wbg_ptr; 4022 - this.__wbg_ptr = 0; 4023 - return ptr; 4024 - } 4025 - free() { 4026 - const ptr = this.__destroy_into_raw(); 4027 - wasm.__wbg_rawserializationpipeline_free(ptr); 4028 - } 4029 - /** 4030 - */ 4031 - constructor() { 4032 - const ret = wasm.rawserializationpipeline_new(); 4033 - this.__wbg_ptr = ret >>> 0; 4034 - return this; 4035 - } 4036 - /** 4037 - * @param {RawVector} gravity 4038 - * @param {RawIntegrationParameters} integrationParameters 4039 - * @param {RawIslandManager} islands 4040 - * @param {RawBroadPhase} broadPhase 4041 - * @param {RawNarrowPhase} narrowPhase 4042 - * @param {RawRigidBodySet} bodies 4043 - * @param {RawColliderSet} colliders 4044 - * @param {RawImpulseJointSet} impulse_joints 4045 - * @param {RawMultibodyJointSet} multibody_joints 4046 - * @returns {Uint8Array | undefined} 4047 - */ 4048 - serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulse_joints, multibody_joints) { 4049 - _assertClass(gravity, RawVector); 4050 - _assertClass(integrationParameters, RawIntegrationParameters); 4051 - _assertClass(islands, RawIslandManager); 4052 - _assertClass(broadPhase, RawBroadPhase); 4053 - _assertClass(narrowPhase, RawNarrowPhase); 4054 - _assertClass(bodies, RawRigidBodySet); 4055 - _assertClass(colliders, RawColliderSet); 4056 - _assertClass(impulse_joints, RawImpulseJointSet); 4057 - _assertClass(multibody_joints, RawMultibodyJointSet); 4058 - 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); 4059 - return takeObject(ret); 4060 - } 4061 - /** 4062 - * @param {Uint8Array} data 4063 - * @returns {RawDeserializedWorld | undefined} 4064 - */ 4065 - deserializeAll(data) { 4066 - const ret = wasm.rawserializationpipeline_deserializeAll(this.__wbg_ptr, addHeapObject(data)); 4067 - return ret === 0 ? void 0 : RawDeserializedWorld.__wrap(ret); 4068 - } 4069 - }; 4070 - var RawShape = class _RawShape { 4071 - static __wrap(ptr) { 4072 - ptr = ptr >>> 0; 4073 - const obj = Object.create(_RawShape.prototype); 4074 - obj.__wbg_ptr = ptr; 4075 - return obj; 4076 - } 4077 - __destroy_into_raw() { 4078 - const ptr = this.__wbg_ptr; 4079 - this.__wbg_ptr = 0; 4080 - return ptr; 4081 - } 4082 - free() { 4083 - const ptr = this.__destroy_into_raw(); 4084 - wasm.__wbg_rawshape_free(ptr); 4085 - } 4086 - /** 4087 - * @param {number} hx 4088 - * @param {number} hy 4089 - * @returns {RawShape} 4090 - */ 4091 - static cuboid(hx, hy) { 4092 - const ret = wasm.rawshape_cuboid(hx, hy); 4093 - return _RawShape.__wrap(ret); 4094 - } 4095 - /** 4096 - * @param {number} hx 4097 - * @param {number} hy 4098 - * @param {number} borderRadius 4099 - * @returns {RawShape} 4100 - */ 4101 - static roundCuboid(hx, hy, borderRadius) { 4102 - const ret = wasm.rawshape_roundCuboid(hx, hy, borderRadius); 4103 - return _RawShape.__wrap(ret); 4104 - } 4105 - /** 4106 - * @param {number} radius 4107 - * @returns {RawShape} 4108 - */ 4109 - static ball(radius) { 4110 - const ret = wasm.rawshape_ball(radius); 4111 - return _RawShape.__wrap(ret); 4112 - } 4113 - /** 4114 - * @param {RawVector} normal 4115 - * @returns {RawShape} 4116 - */ 4117 - static halfspace(normal) { 4118 - _assertClass(normal, RawVector); 4119 - const ret = wasm.rawshape_halfspace(normal.__wbg_ptr); 4120 - return _RawShape.__wrap(ret); 4121 - } 4122 - /** 4123 - * @param {number} halfHeight 4124 - * @param {number} radius 4125 - * @returns {RawShape} 4126 - */ 4127 - static capsule(halfHeight, radius) { 4128 - const ret = wasm.rawshape_capsule(halfHeight, radius); 4129 - return _RawShape.__wrap(ret); 4130 - } 4131 - /** 4132 - * @param {Float32Array} vertices 4133 - * @param {Uint32Array} indices 4134 - * @returns {RawShape} 4135 - */ 4136 - static polyline(vertices, indices) { 4137 - const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc); 4138 - const len0 = WASM_VECTOR_LEN; 4139 - const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc); 4140 - const len1 = WASM_VECTOR_LEN; 4141 - const ret = wasm.rawshape_polyline(ptr0, len0, ptr1, len1); 4142 - return _RawShape.__wrap(ret); 4143 - } 4144 - /** 4145 - * @param {Float32Array} vertices 4146 - * @param {Uint32Array} indices 4147 - * @param {number} flags 4148 - * @returns {RawShape} 4149 - */ 4150 - static trimesh(vertices, indices, flags) { 4151 - const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc); 4152 - const len0 = WASM_VECTOR_LEN; 4153 - const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc); 4154 - const len1 = WASM_VECTOR_LEN; 4155 - const ret = wasm.rawshape_trimesh(ptr0, len0, ptr1, len1, flags); 4156 - return _RawShape.__wrap(ret); 4157 - } 4158 - /** 4159 - * @param {Float32Array} heights 4160 - * @param {RawVector} scale 4161 - * @returns {RawShape} 4162 - */ 4163 - static heightfield(heights, scale) { 4164 - const ptr0 = passArrayF32ToWasm0(heights, wasm.__wbindgen_malloc); 4165 - const len0 = WASM_VECTOR_LEN; 4166 - _assertClass(scale, RawVector); 4167 - const ret = wasm.rawshape_heightfield(ptr0, len0, scale.__wbg_ptr); 4168 - return _RawShape.__wrap(ret); 4169 - } 4170 - /** 4171 - * @param {RawVector} p1 4172 - * @param {RawVector} p2 4173 - * @returns {RawShape} 4174 - */ 4175 - static segment(p1, p2) { 4176 - _assertClass(p1, RawVector); 4177 - _assertClass(p2, RawVector); 4178 - const ret = wasm.rawshape_segment(p1.__wbg_ptr, p2.__wbg_ptr); 4179 - return _RawShape.__wrap(ret); 4180 - } 4181 - /** 4182 - * @param {RawVector} p1 4183 - * @param {RawVector} p2 4184 - * @param {RawVector} p3 4185 - * @returns {RawShape} 4186 - */ 4187 - static triangle(p1, p2, p3) { 4188 - _assertClass(p1, RawVector); 4189 - _assertClass(p2, RawVector); 4190 - _assertClass(p3, RawVector); 4191 - const ret = wasm.rawshape_triangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr); 4192 - return _RawShape.__wrap(ret); 4193 - } 4194 - /** 4195 - * @param {RawVector} p1 4196 - * @param {RawVector} p2 4197 - * @param {RawVector} p3 4198 - * @param {number} borderRadius 4199 - * @returns {RawShape} 4200 - */ 4201 - static roundTriangle(p1, p2, p3, borderRadius) { 4202 - _assertClass(p1, RawVector); 4203 - _assertClass(p2, RawVector); 4204 - _assertClass(p3, RawVector); 4205 - const ret = wasm.rawshape_roundTriangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr, borderRadius); 4206 - return _RawShape.__wrap(ret); 4207 - } 4208 - /** 4209 - * @param {Float32Array} points 4210 - * @returns {RawShape | undefined} 4211 - */ 4212 - static convexHull(points) { 4213 - const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_malloc); 4214 - const len0 = WASM_VECTOR_LEN; 4215 - const ret = wasm.rawshape_convexHull(ptr0, len0); 4216 - return ret === 0 ? void 0 : _RawShape.__wrap(ret); 4217 - } 4218 - /** 4219 - * @param {Float32Array} points 4220 - * @param {number} borderRadius 4221 - * @returns {RawShape | undefined} 4222 - */ 4223 - static roundConvexHull(points, borderRadius) { 4224 - const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_malloc); 4225 - const len0 = WASM_VECTOR_LEN; 4226 - const ret = wasm.rawshape_roundConvexHull(ptr0, len0, borderRadius); 4227 - return ret === 0 ? void 0 : _RawShape.__wrap(ret); 4228 - } 4229 - /** 4230 - * @param {Float32Array} vertices 4231 - * @returns {RawShape | undefined} 4232 - */ 4233 - static convexPolyline(vertices) { 4234 - const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc); 4235 - const len0 = WASM_VECTOR_LEN; 4236 - const ret = wasm.rawshape_convexPolyline(ptr0, len0); 4237 - return ret === 0 ? void 0 : _RawShape.__wrap(ret); 4238 - } 4239 - /** 4240 - * @param {Float32Array} vertices 4241 - * @param {number} borderRadius 4242 - * @returns {RawShape | undefined} 4243 - */ 4244 - static roundConvexPolyline(vertices, borderRadius) { 4245 - const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc); 4246 - const len0 = WASM_VECTOR_LEN; 4247 - const ret = wasm.rawshape_roundConvexPolyline(ptr0, len0, borderRadius); 4248 - return ret === 0 ? void 0 : _RawShape.__wrap(ret); 4249 - } 4250 - /** 4251 - * @param {RawVector} shapePos1 4252 - * @param {RawRotation} shapeRot1 4253 - * @param {RawVector} shapeVel1 4254 - * @param {RawShape} shape2 4255 - * @param {RawVector} shapePos2 4256 - * @param {RawRotation} shapeRot2 4257 - * @param {RawVector} shapeVel2 4258 - * @param {number} target_distance 4259 - * @param {number} maxToi 4260 - * @param {boolean} stop_at_penetration 4261 - * @returns {RawShapeCastHit | undefined} 4262 - */ 4263 - castShape(shapePos1, shapeRot1, shapeVel1, shape2, shapePos2, shapeRot2, shapeVel2, target_distance, maxToi, stop_at_penetration) { 4264 - _assertClass(shapePos1, RawVector); 4265 - _assertClass(shapeRot1, RawRotation); 4266 - _assertClass(shapeVel1, RawVector); 4267 - _assertClass(shape2, _RawShape); 4268 - _assertClass(shapePos2, RawVector); 4269 - _assertClass(shapeRot2, RawRotation); 4270 - _assertClass(shapeVel2, RawVector); 4271 - 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); 4272 - return ret === 0 ? void 0 : RawShapeCastHit.__wrap(ret); 4273 - } 4274 - /** 4275 - * @param {RawVector} shapePos1 4276 - * @param {RawRotation} shapeRot1 4277 - * @param {RawShape} shape2 4278 - * @param {RawVector} shapePos2 4279 - * @param {RawRotation} shapeRot2 4280 - * @returns {boolean} 4281 - */ 4282 - intersectsShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2) { 4283 - _assertClass(shapePos1, RawVector); 4284 - _assertClass(shapeRot1, RawRotation); 4285 - _assertClass(shape2, _RawShape); 4286 - _assertClass(shapePos2, RawVector); 4287 - _assertClass(shapeRot2, RawRotation); 4288 - const ret = wasm.rawshape_intersectsShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr); 4289 - return ret !== 0; 4290 - } 4291 - /** 4292 - * @param {RawVector} shapePos1 4293 - * @param {RawRotation} shapeRot1 4294 - * @param {RawShape} shape2 4295 - * @param {RawVector} shapePos2 4296 - * @param {RawRotation} shapeRot2 4297 - * @param {number} prediction 4298 - * @returns {RawShapeContact | undefined} 4299 - */ 4300 - contactShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2, prediction) { 4301 - _assertClass(shapePos1, RawVector); 4302 - _assertClass(shapeRot1, RawRotation); 4303 - _assertClass(shape2, _RawShape); 4304 - _assertClass(shapePos2, RawVector); 4305 - _assertClass(shapeRot2, RawRotation); 4306 - const ret = wasm.rawshape_contactShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction); 4307 - return ret === 0 ? void 0 : RawShapeContact.__wrap(ret); 4308 - } 4309 - /** 4310 - * @param {RawVector} shapePos 4311 - * @param {RawRotation} shapeRot 4312 - * @param {RawVector} point 4313 - * @returns {boolean} 4314 - */ 4315 - containsPoint(shapePos, shapeRot, point) { 4316 - _assertClass(shapePos, RawVector); 4317 - _assertClass(shapeRot, RawRotation); 4318 - _assertClass(point, RawVector); 4319 - const ret = wasm.rawshape_containsPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr); 4320 - return ret !== 0; 4321 - } 4322 - /** 4323 - * @param {RawVector} shapePos 4324 - * @param {RawRotation} shapeRot 4325 - * @param {RawVector} point 4326 - * @param {boolean} solid 4327 - * @returns {RawPointProjection} 4328 - */ 4329 - projectPoint(shapePos, shapeRot, point, solid) { 4330 - _assertClass(shapePos, RawVector); 4331 - _assertClass(shapeRot, RawRotation); 4332 - _assertClass(point, RawVector); 4333 - const ret = wasm.rawshape_projectPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr, solid); 4334 - return RawPointProjection.__wrap(ret); 4335 - } 4336 - /** 4337 - * @param {RawVector} shapePos 4338 - * @param {RawRotation} shapeRot 4339 - * @param {RawVector} rayOrig 4340 - * @param {RawVector} rayDir 4341 - * @param {number} maxToi 4342 - * @returns {boolean} 4343 - */ 4344 - intersectsRay(shapePos, shapeRot, rayOrig, rayDir, maxToi) { 4345 - _assertClass(shapePos, RawVector); 4346 - _assertClass(shapeRot, RawRotation); 4347 - _assertClass(rayOrig, RawVector); 4348 - _assertClass(rayDir, RawVector); 4349 - const ret = wasm.rawshape_intersectsRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi); 4350 - return ret !== 0; 4351 - } 4352 - /** 4353 - * @param {RawVector} shapePos 4354 - * @param {RawRotation} shapeRot 4355 - * @param {RawVector} rayOrig 4356 - * @param {RawVector} rayDir 4357 - * @param {number} maxToi 4358 - * @param {boolean} solid 4359 - * @returns {number} 4360 - */ 4361 - castRay(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) { 4362 - _assertClass(shapePos, RawVector); 4363 - _assertClass(shapeRot, RawRotation); 4364 - _assertClass(rayOrig, RawVector); 4365 - _assertClass(rayDir, RawVector); 4366 - const ret = wasm.rawshape_castRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); 4367 - return ret; 4368 - } 4369 - /** 4370 - * @param {RawVector} shapePos 4371 - * @param {RawRotation} shapeRot 4372 - * @param {RawVector} rayOrig 4373 - * @param {RawVector} rayDir 4374 - * @param {number} maxToi 4375 - * @param {boolean} solid 4376 - * @returns {RawRayIntersection | undefined} 4377 - */ 4378 - castRayAndGetNormal(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) { 4379 - _assertClass(shapePos, RawVector); 4380 - _assertClass(shapeRot, RawRotation); 4381 - _assertClass(rayOrig, RawVector); 4382 - _assertClass(rayDir, RawVector); 4383 - const ret = wasm.rawshape_castRayAndGetNormal(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); 4384 - return ret === 0 ? void 0 : RawRayIntersection.__wrap(ret); 4385 - } 4386 - }; 4387 - var RawShapeCastHit = class _RawShapeCastHit { 4388 - static __wrap(ptr) { 4389 - ptr = ptr >>> 0; 4390 - const obj = Object.create(_RawShapeCastHit.prototype); 4391 - obj.__wbg_ptr = ptr; 4392 - return obj; 4393 - } 4394 - __destroy_into_raw() { 4395 - const ptr = this.__wbg_ptr; 4396 - this.__wbg_ptr = 0; 4397 - return ptr; 4398 - } 4399 - free() { 4400 - const ptr = this.__destroy_into_raw(); 4401 - wasm.__wbg_rawshapecasthit_free(ptr); 4402 - } 4403 - /** 4404 - * @returns {number} 4405 - */ 4406 - time_of_impact() { 4407 - const ret = wasm.rawrotation_re(this.__wbg_ptr); 4408 - return ret; 4409 - } 4410 - /** 4411 - * @returns {RawVector} 4412 - */ 4413 - witness1() { 4414 - const ret = wasm.rawshapecasthit_witness1(this.__wbg_ptr); 4415 - return RawVector.__wrap(ret); 4416 - } 4417 - /** 4418 - * @returns {RawVector} 4419 - */ 4420 - witness2() { 4421 - const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); 4422 - return RawVector.__wrap(ret); 4423 - } 4424 - /** 4425 - * @returns {RawVector} 4426 - */ 4427 - normal1() { 4428 - const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr); 4429 - return RawVector.__wrap(ret); 4430 - } 4431 - /** 4432 - * @returns {RawVector} 4433 - */ 4434 - normal2() { 4435 - const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr); 4436 - return RawVector.__wrap(ret); 4437 - } 4438 - }; 4439 - var RawShapeContact = class _RawShapeContact { 4440 - static __wrap(ptr) { 4441 - ptr = ptr >>> 0; 4442 - const obj = Object.create(_RawShapeContact.prototype); 4443 - obj.__wbg_ptr = ptr; 4444 - return obj; 4445 - } 4446 - __destroy_into_raw() { 4447 - const ptr = this.__wbg_ptr; 4448 - this.__wbg_ptr = 0; 4449 - return ptr; 4450 - } 4451 - free() { 4452 - const ptr = this.__destroy_into_raw(); 4453 - wasm.__wbg_rawshapecontact_free(ptr); 4454 - } 4455 - /** 4456 - * @returns {number} 4457 - */ 4458 - distance() { 4459 - const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr); 4460 - return ret; 4461 - } 4462 - /** 4463 - * @returns {RawVector} 4464 - */ 4465 - point1() { 4466 - const ret = wasm.rawpointprojection_point(this.__wbg_ptr); 4467 - return RawVector.__wrap(ret); 4468 - } 4469 - /** 4470 - * @returns {RawVector} 4471 - */ 4472 - point2() { 4473 - const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr); 4474 - return RawVector.__wrap(ret); 4475 - } 4476 - /** 4477 - * @returns {RawVector} 4478 - */ 4479 - normal1() { 4480 - const ret = wasm.rawcontactforceevent_total_force(this.__wbg_ptr); 4481 - return RawVector.__wrap(ret); 4482 - } 4483 - /** 4484 - * @returns {RawVector} 4485 - */ 4486 - normal2() { 4487 - const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr); 4488 - return RawVector.__wrap(ret); 4489 - } 4490 - }; 4491 - var RawVector = class _RawVector { 4492 - static __wrap(ptr) { 4493 - ptr = ptr >>> 0; 4494 - const obj = Object.create(_RawVector.prototype); 4495 - obj.__wbg_ptr = ptr; 4496 - return obj; 4497 - } 4498 - __destroy_into_raw() { 4499 - const ptr = this.__wbg_ptr; 4500 - this.__wbg_ptr = 0; 4501 - return ptr; 4502 - } 4503 - free() { 4504 - const ptr = this.__destroy_into_raw(); 4505 - wasm.__wbg_rawvector_free(ptr); 4506 - } 4507 - /** 4508 - * Creates a new vector filled with zeros. 4509 - * @returns {RawVector} 4510 - */ 4511 - static zero() { 4512 - const ret = wasm.rawvector_zero(); 4513 - return _RawVector.__wrap(ret); 4514 - } 4515 - /** 4516 - * Creates a new 2D vector from its two components. 4517 - * 4518 - * # Parameters 4519 - * - `x`: the `x` component of this 2D vector. 4520 - * - `y`: the `y` component of this 2D vector. 4521 - * @param {number} x 4522 - * @param {number} y 4523 - */ 4524 - constructor(x, y) { 4525 - const ret = wasm.rawvector_new(x, y); 4526 - this.__wbg_ptr = ret >>> 0; 4527 - return this; 4528 - } 4529 - /** 4530 - * The `x` component of this vector. 4531 - * @returns {number} 4532 - */ 4533 - get x() { 4534 - const ret = wasm.rawrotation_re(this.__wbg_ptr); 4535 - return ret; 4536 - } 4537 - /** 4538 - * Sets the `x` component of this vector. 4539 - * @param {number} x 4540 - */ 4541 - set x(x) { 4542 - wasm.rawvector_set_x(this.__wbg_ptr, x); 4543 - } 4544 - /** 4545 - * The `y` component of this vector. 4546 - * @returns {number} 4547 - */ 4548 - get y() { 4549 - const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); 4550 - return ret; 4551 - } 4552 - /** 4553 - * Sets the `y` component of this vector. 4554 - * @param {number} y 4555 - */ 4556 - set y(y) { 4557 - wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, y); 4558 - } 4559 - /** 4560 - * Create a new 2D vector from this vector with its components rearranged as `{x, y}`. 4561 - * @returns {RawVector} 4562 - */ 4563 - xy() { 4564 - const ret = wasm.rawvector_xy(this.__wbg_ptr); 4565 - return _RawVector.__wrap(ret); 4566 - } 4567 - /** 4568 - * Create a new 2D vector from this vector with its components rearranged as `{y, x}`. 4569 - * @returns {RawVector} 4570 - */ 4571 - yx() { 4572 - const ret = wasm.rawvector_yx(this.__wbg_ptr); 4573 - return _RawVector.__wrap(ret); 4574 - } 4575 - }; 4576 - 4577 - // ../node_modules/@dimforge/rapier2d/rapier_wasm2d.js 4578 - __wbg_set_wasm(wasm2); 4579 - 4580 - // ../node_modules/@dimforge/rapier2d/math.js 4581 - var Vector2 = class { 4582 - constructor(x, y) { 4583 - this.x = x; 4584 - this.y = y; 4585 - } 4586 - }; 4587 - var VectorOps = class _VectorOps { 4588 - static new(x, y) { 4589 - return new Vector2(x, y); 4590 - } 4591 - static zeros() { 4592 - return _VectorOps.new(0, 0); 4593 - } 4594 - // FIXME: type ram: RawVector? 4595 - static fromRaw(raw) { 4596 - if (!raw) 4597 - return null; 4598 - let res = _VectorOps.new(raw.x, raw.y); 4599 - raw.free(); 4600 - return res; 4601 - } 4602 - static intoRaw(v) { 4603 - return new RawVector(v.x, v.y); 4604 - } 4605 - static copy(out, input) { 4606 - out.x = input.x; 4607 - out.y = input.y; 4608 - } 4609 - }; 4610 - var RotationOps = class { 4611 - static identity() { 4612 - return 0; 4613 - } 4614 - static fromRaw(raw) { 4615 - if (!raw) 4616 - return null; 4617 - let res = raw.angle; 4618 - raw.free(); 4619 - return res; 4620 - } 4621 - static intoRaw(angle) { 4622 - return RawRotation.fromAngle(angle); 4623 - } 4624 - }; 4625 - 4626 - // ../node_modules/@dimforge/rapier2d/dynamics/rigid_body.js 4627 - var RigidBodyType; 4628 - (function(RigidBodyType2) { 4629 - RigidBodyType2[RigidBodyType2["Dynamic"] = 0] = "Dynamic"; 4630 - RigidBodyType2[RigidBodyType2["Fixed"] = 1] = "Fixed"; 4631 - RigidBodyType2[RigidBodyType2["KinematicPositionBased"] = 2] = "KinematicPositionBased"; 4632 - RigidBodyType2[RigidBodyType2["KinematicVelocityBased"] = 3] = "KinematicVelocityBased"; 4633 - })(RigidBodyType || (RigidBodyType = {})); 4634 - var RigidBody = class { 4635 - constructor(rawSet, colliderSet, handle) { 4636 - this.rawSet = rawSet; 4637 - this.colliderSet = colliderSet; 4638 - this.handle = handle; 4639 - } 4640 - /** @internal */ 4641 - finalizeDeserialization(colliderSet) { 4642 - this.colliderSet = colliderSet; 4643 - } 4644 - /** 4645 - * Checks if this rigid-body is still valid (i.e. that it has 4646 - * not been deleted from the rigid-body set yet. 4647 - */ 4648 - isValid() { 4649 - return this.rawSet.contains(this.handle); 4650 - } 4651 - /** 4652 - * Locks or unlocks the ability of this rigid-body to translate. 4653 - * 4654 - * @param locked - If `true`, this rigid-body will no longer translate due to forces and impulses. 4655 - * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep. 4656 - */ 4657 - lockTranslations(locked, wakeUp) { 4658 - return this.rawSet.rbLockTranslations(this.handle, locked, wakeUp); 4659 - } 4660 - /** 4661 - * Locks or unlocks the ability of this rigid-body to rotate. 4662 - * 4663 - * @param locked - If `true`, this rigid-body will no longer rotate due to torques and impulses. 4664 - * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep. 4665 - */ 4666 - lockRotations(locked, wakeUp) { 4667 - return this.rawSet.rbLockRotations(this.handle, locked, wakeUp); 4668 - } 4669 - // #if DIM2 4670 - /** 4671 - * Locks or unlocks the ability of this rigid-body to translation along individual coordinate axes. 4672 - * 4673 - * @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis. 4674 - * @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis. 4675 - * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep. 4676 - */ 4677 - setEnabledTranslations(enableX, enableY, wakeUp) { 4678 - return this.rawSet.rbSetEnabledTranslations(this.handle, enableX, enableY, wakeUp); 4679 - } 4680 - /** 4681 - * Locks or unlocks the ability of this rigid-body to translation along individual coordinate axes. 4682 - * 4683 - * @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis. 4684 - * @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis. 4685 - * @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep. 4686 - * @deprecated use `this.setEnabledTranslations` with the same arguments instead. 4687 - */ 4688 - restrictTranslations(enableX, enableY, wakeUp) { 4689 - this.setEnabledTranslations(enableX, enableX, wakeUp); 4690 - } 4691 - // #endif 4692 - /** 4693 - * The dominance group, in [-127, +127] this rigid-body is part of. 4694 - */ 4695 - dominanceGroup() { 4696 - return this.rawSet.rbDominanceGroup(this.handle); 4697 - } 4698 - /** 4699 - * Sets the dominance group of this rigid-body. 4700 - * 4701 - * @param group - The dominance group of this rigid-body. Must be a signed integer in the range [-127, +127]. 4702 - */ 4703 - setDominanceGroup(group) { 4704 - this.rawSet.rbSetDominanceGroup(this.handle, group); 4705 - } 4706 - /** 4707 - * The number of additional solver iterations that will be run for this 4708 - * rigid-body and everything that interacts with it directly or indirectly 4709 - * through contacts or joints. 4710 - */ 4711 - additionalSolverIterations() { 4712 - return this.rawSet.rbAdditionalSolverIterations(this.handle); 4713 - } 4714 - /** 4715 - * Sets the number of additional solver iterations that will be run for this 4716 - * rigid-body and everything that interacts with it directly or indirectly 4717 - * through contacts or joints. 4718 - * 4719 - * Compared to increasing the global `World.numSolverIteration`, setting this 4720 - * value lets you increase accuracy on only a subset of the scene, resulting in reduced 4721 - * performance loss. 4722 - * 4723 - * @param iters - The new number of additional solver iterations (default: 0). 4724 - */ 4725 - setAdditionalSolverIterations(iters) { 4726 - this.rawSet.rbSetAdditionalSolverIterations(this.handle, iters); 4727 - } 4728 - /** 4729 - * Enable or disable CCD (Continuous Collision Detection) for this rigid-body. 4730 - * 4731 - * @param enabled - If `true`, CCD will be enabled for this rigid-body. 4732 - */ 4733 - enableCcd(enabled) { 4734 - this.rawSet.rbEnableCcd(this.handle, enabled); 4735 - } 4736 - /** 4737 - * Sets the soft-CCD prediction distance for this rigid-body. 4738 - * 4739 - * See the documentation of `RigidBodyDesc.setSoftCcdPrediction` for 4740 - * additional details. 4741 - */ 4742 - setSoftCcdPrediction(distance) { 4743 - this.rawSet.rbSetSoftCcdPrediction(this.handle, distance); 4744 - } 4745 - /** 4746 - * Gets the soft-CCD prediction distance for this rigid-body. 4747 - * 4748 - * See the documentation of `RigidBodyDesc.setSoftCcdPrediction` for 4749 - * additional details. 4750 - */ 4751 - softCcdPrediction() { 4752 - return this.rawSet.rbSoftCcdPrediction(this.handle); 4753 - } 4754 - /** 4755 - * The world-space translation of this rigid-body. 4756 - */ 4757 - translation() { 4758 - let res = this.rawSet.rbTranslation(this.handle); 4759 - return VectorOps.fromRaw(res); 4760 - } 4761 - /** 4762 - * The world-space orientation of this rigid-body. 4763 - */ 4764 - rotation() { 4765 - let res = this.rawSet.rbRotation(this.handle); 4766 - return RotationOps.fromRaw(res); 4767 - } 4768 - /** 4769 - * The world-space next translation of this rigid-body. 4770 - * 4771 - * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation` 4772 - * method and is used for estimating the kinematic body velocity at the next timestep. 4773 - * For non-kinematic bodies, this value is currently unspecified. 4774 - */ 4775 - nextTranslation() { 4776 - let res = this.rawSet.rbNextTranslation(this.handle); 4777 - return VectorOps.fromRaw(res); 4778 - } 4779 - /** 4780 - * The world-space next orientation of this rigid-body. 4781 - * 4782 - * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation` 4783 - * method and is used for estimating the kinematic body velocity at the next timestep. 4784 - * For non-kinematic bodies, this value is currently unspecified. 4785 - */ 4786 - nextRotation() { 4787 - let res = this.rawSet.rbNextRotation(this.handle); 4788 - return RotationOps.fromRaw(res); 4789 - } 4790 - /** 4791 - * Sets the translation of this rigid-body. 4792 - * 4793 - * @param tra - The world-space position of the rigid-body. 4794 - * @param wakeUp - Forces the rigid-body to wake-up so it is properly affected by forces if it 4795 - * wasn't moving before modifying its position. 4796 - */ 4797 - setTranslation(tra, wakeUp) { 4798 - this.rawSet.rbSetTranslation(this.handle, tra.x, tra.y, wakeUp); 4799 - } 4800 - /** 4801 - * Sets the linear velocity of this rigid-body. 4802 - * 4803 - * @param vel - The linear velocity to set. 4804 - * @param wakeUp - Forces the rigid-body to wake-up if it was asleep. 4805 - */ 4806 - setLinvel(vel, wakeUp) { 4807 - let rawVel = VectorOps.intoRaw(vel); 4808 - this.rawSet.rbSetLinvel(this.handle, rawVel, wakeUp); 4809 - rawVel.free(); 4810 - } 4811 - /** 4812 - * The scale factor applied to the gravity affecting 4813 - * this rigid-body. 4814 - */ 4815 - gravityScale() { 4816 - return this.rawSet.rbGravityScale(this.handle); 4817 - } 4818 - /** 4819 - * Sets the scale factor applied to the gravity affecting 4820 - * this rigid-body. 4821 - * 4822 - * @param factor - The scale factor to set. A value of 0.0 means 4823 - * that this rigid-body will on longer be affected by gravity. 4824 - * @param wakeUp - Forces the rigid-body to wake-up if it was asleep. 4825 - */ 4826 - setGravityScale(factor, wakeUp) { 4827 - this.rawSet.rbSetGravityScale(this.handle, factor, wakeUp); 4828 - } 4829 - // #if DIM2 4830 - /** 4831 - * Sets the rotation angle of this rigid-body. 4832 - * 4833 - * @param angle - The rotation angle, in radians. 4834 - * @param wakeUp - Forces the rigid-body to wake-up so it is properly affected by forces if it 4835 - * wasn't moving before modifying its position. 4836 - */ 4837 - setRotation(angle, wakeUp) { 4838 - this.rawSet.rbSetRotation(this.handle, angle, wakeUp); 4839 - } 4840 - /** 4841 - * Sets the angular velocity fo this rigid-body. 4842 - * 4843 - * @param vel - The angular velocity to set. 4844 - * @param wakeUp - Forces the rigid-body to wake-up if it was asleep. 4845 - */ 4846 - setAngvel(vel, wakeUp) { 4847 - this.rawSet.rbSetAngvel(this.handle, vel, wakeUp); 4848 - } 4849 - // #endif 4850 - /** 4851 - * If this rigid body is kinematic, sets its future translation after the next timestep integration. 4852 - * 4853 - * This should be used instead of `rigidBody.setTranslation` to make the dynamic object 4854 - * interacting with this kinematic body behave as expected. Internally, Rapier will compute 4855 - * an artificial velocity for this rigid-body from its current position and its next kinematic 4856 - * position. This velocity will be used to compute forces on dynamic bodies interacting with 4857 - * this body. 4858 - * 4859 - * @param t - The kinematic translation to set. 4860 - */ 4861 - setNextKinematicTranslation(t) { 4862 - this.rawSet.rbSetNextKinematicTranslation(this.handle, t.x, t.y); 4863 - } 4864 - // #if DIM2 4865 - /** 4866 - * If this rigid body is kinematic, sets its future rotation after the next timestep integration. 4867 - * 4868 - * This should be used instead of `rigidBody.setRotation` to make the dynamic object 4869 - * interacting with this kinematic body behave as expected. Internally, Rapier will compute 4870 - * an artificial velocity for this rigid-body from its current position and its next kinematic 4871 - * position. This velocity will be used to compute forces on dynamic bodies interacting with 4872 - * this body. 4873 - * 4874 - * @param angle - The kinematic rotation angle, in radians. 4875 - */ 4876 - setNextKinematicRotation(angle) { 4877 - this.rawSet.rbSetNextKinematicRotation(this.handle, angle); 4878 - } 4879 - // #endif 4880 - /** 4881 - * The linear velocity of this rigid-body. 4882 - */ 4883 - linvel() { 4884 - return VectorOps.fromRaw(this.rawSet.rbLinvel(this.handle)); 4885 - } 4886 - // #if DIM2 4887 - /** 4888 - * The angular velocity of this rigid-body. 4889 - */ 4890 - angvel() { 4891 - return this.rawSet.rbAngvel(this.handle); 4892 - } 4893 - // #endif 4894 - /** 4895 - * The mass of this rigid-body. 4896 - */ 4897 - mass() { 4898 - return this.rawSet.rbMass(this.handle); 4899 - } 4900 - /** 4901 - * The inverse mass taking into account translation locking. 4902 - */ 4903 - effectiveInvMass() { 4904 - return VectorOps.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle)); 4905 - } 4906 - /** 4907 - * The inverse of the mass of a rigid-body. 4908 - * 4909 - * If this is zero, the rigid-body is assumed to have infinite mass. 4910 - */ 4911 - invMass() { 4912 - return this.rawSet.rbInvMass(this.handle); 4913 - } 4914 - /** 4915 - * The center of mass of a rigid-body expressed in its local-space. 4916 - */ 4917 - localCom() { 4918 - return VectorOps.fromRaw(this.rawSet.rbLocalCom(this.handle)); 4919 - } 4920 - /** 4921 - * The world-space center of mass of the rigid-body. 4922 - */ 4923 - worldCom() { 4924 - return VectorOps.fromRaw(this.rawSet.rbWorldCom(this.handle)); 4925 - } 4926 - // #if DIM2 4927 - /** 4928 - * The inverse of the principal angular inertia of the rigid-body. 4929 - * 4930 - * Components set to zero are assumed to be infinite along the corresponding principal axis. 4931 - */ 4932 - invPrincipalInertiaSqrt() { 4933 - return this.rawSet.rbInvPrincipalInertiaSqrt(this.handle); 4934 - } 4935 - // #endif 4936 - // #if DIM2 4937 - /** 4938 - * The angular inertia along the principal inertia axes of the rigid-body. 4939 - */ 4940 - principalInertia() { 4941 - return this.rawSet.rbPrincipalInertia(this.handle); 4942 - } 4943 - // #endif 4944 - // #if DIM2 4945 - /** 4946 - * The square-root of the world-space inverse angular inertia tensor of the rigid-body, 4947 - * taking into account rotation locking. 4948 - */ 4949 - effectiveWorldInvInertiaSqrt() { 4950 - return this.rawSet.rbEffectiveWorldInvInertiaSqrt(this.handle); 4951 - } 4952 - // #endif 4953 - // #if DIM2 4954 - /** 4955 - * The effective world-space angular inertia (that takes the potential rotation locking into account) of 4956 - * this rigid-body. 4957 - */ 4958 - effectiveAngularInertia() { 4959 - return this.rawSet.rbEffectiveAngularInertia(this.handle); 4960 - } 4961 - // #endif 4962 - /** 4963 - * Put this rigid body to sleep. 4964 - * 4965 - * A sleeping body no longer moves and is no longer simulated by the physics engine unless 4966 - * it is waken up. It can be woken manually with `this.wakeUp()` or automatically due to 4967 - * external forces like contacts. 4968 - */ 4969 - sleep() { 4970 - this.rawSet.rbSleep(this.handle); 4971 - } 4972 - /** 4973 - * Wakes this rigid-body up. 4974 - * 4975 - * A dynamic rigid-body that does not move during several consecutive frames will 4976 - * be put to sleep by the physics engine, i.e., it will stop being simulated in order 4977 - * to avoid useless computations. 4978 - * This methods forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying 4979 - * the position of a dynamic body so that it is properly simulated afterwards. 4980 - */ 4981 - wakeUp() { 4982 - this.rawSet.rbWakeUp(this.handle); 4983 - } 4984 - /** 4985 - * Is CCD enabled for this rigid-body? 4986 - */ 4987 - isCcdEnabled() { 4988 - return this.rawSet.rbIsCcdEnabled(this.handle); 4989 - } 4990 - /** 4991 - * The number of colliders attached to this rigid-body. 4992 - */ 4993 - numColliders() { 4994 - return this.rawSet.rbNumColliders(this.handle); 4995 - } 4996 - /** 4997 - * Retrieves the `i-th` collider attached to this rigid-body. 4998 - * 4999 - * @param i - The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`. 5000 - * This index is **not** the same as the unique identifier of the collider. 5001 - */ 5002 - collider(i) { 5003 - return this.colliderSet.get(this.rawSet.rbCollider(this.handle, i)); 5004 - } 5005 - /** 5006 - * Sets whether this rigid-body is enabled or not. 5007 - * 5008 - * @param enabled - Set to `false` to disable this rigid-body and all its attached colliders. 5009 - */ 5010 - setEnabled(enabled) { 5011 - this.rawSet.rbSetEnabled(this.handle, enabled); 5012 - } 5013 - /** 5014 - * Is this rigid-body enabled? 5015 - */ 5016 - isEnabled() { 5017 - return this.rawSet.rbIsEnabled(this.handle); 5018 - } 5019 - /** 5020 - * The status of this rigid-body: static, dynamic, or kinematic. 5021 - */ 5022 - bodyType() { 5023 - return this.rawSet.rbBodyType(this.handle); 5024 - } 5025 - /** 5026 - * Set a new status for this rigid-body: static, dynamic, or kinematic. 5027 - */ 5028 - setBodyType(type, wakeUp) { 5029 - return this.rawSet.rbSetBodyType(this.handle, type, wakeUp); 5030 - } 5031 - /** 5032 - * Is this rigid-body sleeping? 5033 - */ 5034 - isSleeping() { 5035 - return this.rawSet.rbIsSleeping(this.handle); 5036 - } 5037 - /** 5038 - * Is the velocity of this rigid-body not zero? 5039 - */ 5040 - isMoving() { 5041 - return this.rawSet.rbIsMoving(this.handle); 5042 - } 5043 - /** 5044 - * Is this rigid-body static? 5045 - */ 5046 - isFixed() { 5047 - return this.rawSet.rbIsFixed(this.handle); 5048 - } 5049 - /** 5050 - * Is this rigid-body kinematic? 5051 - */ 5052 - isKinematic() { 5053 - return this.rawSet.rbIsKinematic(this.handle); 5054 - } 5055 - /** 5056 - * Is this rigid-body dynamic? 5057 - */ 5058 - isDynamic() { 5059 - return this.rawSet.rbIsDynamic(this.handle); 5060 - } 5061 - /** 5062 - * The linear damping coefficient of this rigid-body. 5063 - */ 5064 - linearDamping() { 5065 - return this.rawSet.rbLinearDamping(this.handle); 5066 - } 5067 - /** 5068 - * The angular damping coefficient of this rigid-body. 5069 - */ 5070 - angularDamping() { 5071 - return this.rawSet.rbAngularDamping(this.handle); 5072 - } 5073 - /** 5074 - * Sets the linear damping factor applied to this rigid-body. 5075 - * 5076 - * @param factor - The damping factor to set. 5077 - */ 5078 - setLinearDamping(factor) { 5079 - this.rawSet.rbSetLinearDamping(this.handle, factor); 5080 - } 5081 - /** 5082 - * Recompute the mass-properties of this rigid-bodies based on its currently attached colliders. 5083 - */ 5084 - recomputeMassPropertiesFromColliders() { 5085 - this.rawSet.rbRecomputeMassPropertiesFromColliders(this.handle, this.colliderSet.raw); 5086 - } 5087 - /** 5088 - * Sets the rigid-body's additional mass. 5089 - * 5090 - * The total angular inertia of the rigid-body will be scaled automatically based on this additional mass. If this 5091 - * scaling effect isn’t desired, use Self::additional_mass_properties instead of this method. 5092 - * 5093 - * This is only the "additional" mass because the total mass of the rigid-body is equal to the sum of this 5094 - * additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body. 5095 - * 5096 - * That total mass (which includes the attached colliders’ contributions) will be updated at the name physics step, 5097 - * or can be updated manually with `this.recomputeMassPropertiesFromColliders`. 5098 - * 5099 - * This will override any previous additional mass-properties set by `this.setAdditionalMass`, 5100 - * `this.setAdditionalMassProperties`, `RigidBodyDesc::setAdditionalMass`, or 5101 - * `RigidBodyDesc.setAdditionalMassfProperties` for this rigid-body. 5102 - * 5103 - * @param mass - The additional mass to set. 5104 - * @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. 5105 - */ 5106 - setAdditionalMass(mass, wakeUp) { 5107 - this.rawSet.rbSetAdditionalMass(this.handle, mass, wakeUp); 5108 - } 5109 - // #if DIM2 5110 - /** 5111 - * Sets the rigid-body's additional mass-properties. 5112 - * 5113 - * This is only the "additional" mass-properties because the total mass-properties of the rigid-body is equal to the 5114 - * sum of this additional mass-properties and the mass computed from the colliders (with non-zero densities) attached 5115 - * to this rigid-body. 5116 - * 5117 - * That total mass-properties (which include the attached colliders’ contributions) will be updated at the name 5118 - * physics step, or can be updated manually with `this.recomputeMassPropertiesFromColliders`. 5119 - * 5120 - * This will override any previous mass-properties set by `this.setAdditionalMass`, 5121 - * `this.setAdditionalMassProperties`, `RigidBodyDesc.setAdditionalMass`, or `RigidBodyDesc.setAdditionalMassProperties` 5122 - * for this rigid-body. 5123 - * 5124 - * 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. 5125 - */ 5126 - setAdditionalMassProperties(mass, centerOfMass, principalAngularInertia, wakeUp) { 5127 - let rawCom = VectorOps.intoRaw(centerOfMass); 5128 - this.rawSet.rbSetAdditionalMassProperties(this.handle, mass, rawCom, principalAngularInertia, wakeUp); 5129 - rawCom.free(); 5130 - } 5131 - // #endif 5132 - /** 5133 - * Sets the linear damping factor applied to this rigid-body. 5134 - * 5135 - * @param factor - The damping factor to set. 5136 - */ 5137 - setAngularDamping(factor) { 5138 - this.rawSet.rbSetAngularDamping(this.handle, factor); 5139 - } 5140 - /** 5141 - * Resets to zero the user forces (but not torques) applied to this rigid-body. 5142 - * 5143 - * @param wakeUp - should the rigid-body be automatically woken-up? 5144 - */ 5145 - resetForces(wakeUp) { 5146 - this.rawSet.rbResetForces(this.handle, wakeUp); 5147 - } 5148 - /** 5149 - * Resets to zero the user torques applied to this rigid-body. 5150 - * 5151 - * @param wakeUp - should the rigid-body be automatically woken-up? 5152 - */ 5153 - resetTorques(wakeUp) { 5154 - this.rawSet.rbResetTorques(this.handle, wakeUp); 5155 - } 5156 - /** 5157 - * Adds a force at the center-of-mass of this rigid-body. 5158 - * 5159 - * @param force - the world-space force to add to the rigid-body. 5160 - * @param wakeUp - should the rigid-body be automatically woken-up? 5161 - */ 5162 - addForce(force, wakeUp) { 5163 - const rawForce = VectorOps.intoRaw(force); 5164 - this.rawSet.rbAddForce(this.handle, rawForce, wakeUp); 5165 - rawForce.free(); 5166 - } 5167 - /** 5168 - * Applies an impulse at the center-of-mass of this rigid-body. 5169 - * 5170 - * @param impulse - the world-space impulse to apply on the rigid-body. 5171 - * @param wakeUp - should the rigid-body be automatically woken-up? 5172 - */ 5173 - applyImpulse(impulse, wakeUp) { 5174 - const rawImpulse = VectorOps.intoRaw(impulse); 5175 - this.rawSet.rbApplyImpulse(this.handle, rawImpulse, wakeUp); 5176 - rawImpulse.free(); 5177 - } 5178 - // #if DIM2 5179 - /** 5180 - * Adds a torque at the center-of-mass of this rigid-body. 5181 - * 5182 - * @param torque - the torque to add to the rigid-body. 5183 - * @param wakeUp - should the rigid-body be automatically woken-up? 5184 - */ 5185 - addTorque(torque, wakeUp) { 5186 - this.rawSet.rbAddTorque(this.handle, torque, wakeUp); 5187 - } 5188 - // #endif 5189 - // #if DIM2 5190 - /** 5191 - * Applies an impulsive torque at the center-of-mass of this rigid-body. 5192 - * 5193 - * @param torqueImpulse - the torque impulse to apply on the rigid-body. 5194 - * @param wakeUp - should the rigid-body be automatically woken-up? 5195 - */ 5196 - applyTorqueImpulse(torqueImpulse, wakeUp) { 5197 - this.rawSet.rbApplyTorqueImpulse(this.handle, torqueImpulse, wakeUp); 5198 - } 5199 - // #endif 5200 - /** 5201 - * Adds a force at the given world-space point of this rigid-body. 5202 - * 5203 - * @param force - the world-space force to add to the rigid-body. 5204 - * @param point - the world-space point where the impulse is to be applied on the rigid-body. 5205 - * @param wakeUp - should the rigid-body be automatically woken-up? 5206 - */ 5207 - addForceAtPoint(force, point, wakeUp) { 5208 - const rawForce = VectorOps.intoRaw(force); 5209 - const rawPoint = VectorOps.intoRaw(point); 5210 - this.rawSet.rbAddForceAtPoint(this.handle, rawForce, rawPoint, wakeUp); 5211 - rawForce.free(); 5212 - rawPoint.free(); 5213 - } 5214 - /** 5215 - * Applies an impulse at the given world-space point of this rigid-body. 5216 - * 5217 - * @param impulse - the world-space impulse to apply on the rigid-body. 5218 - * @param point - the world-space point where the impulse is to be applied on the rigid-body. 5219 - * @param wakeUp - should the rigid-body be automatically woken-up? 5220 - */ 5221 - applyImpulseAtPoint(impulse, point, wakeUp) { 5222 - const rawImpulse = VectorOps.intoRaw(impulse); 5223 - const rawPoint = VectorOps.intoRaw(point); 5224 - this.rawSet.rbApplyImpulseAtPoint(this.handle, rawImpulse, rawPoint, wakeUp); 5225 - rawImpulse.free(); 5226 - rawPoint.free(); 5227 - } 5228 - }; 5229 - var RigidBodyDesc = class _RigidBodyDesc { 5230 - constructor(status) { 5231 - this.enabled = true; 5232 - this.status = status; 5233 - this.translation = VectorOps.zeros(); 5234 - this.rotation = RotationOps.identity(); 5235 - this.gravityScale = 1; 5236 - this.linvel = VectorOps.zeros(); 5237 - this.mass = 0; 5238 - this.massOnly = false; 5239 - this.centerOfMass = VectorOps.zeros(); 5240 - this.translationsEnabledX = true; 5241 - this.translationsEnabledY = true; 5242 - this.angvel = 0; 5243 - this.principalAngularInertia = 0; 5244 - this.rotationsEnabled = true; 5245 - this.linearDamping = 0; 5246 - this.angularDamping = 0; 5247 - this.canSleep = true; 5248 - this.sleeping = false; 5249 - this.ccdEnabled = false; 5250 - this.softCcdPrediction = 0; 5251 - this.dominanceGroup = 0; 5252 - this.additionalSolverIterations = 0; 5253 - } 5254 - /** 5255 - * A rigid-body descriptor used to build a dynamic rigid-body. 5256 - */ 5257 - static dynamic() { 5258 - return new _RigidBodyDesc(RigidBodyType.Dynamic); 5259 - } 5260 - /** 5261 - * A rigid-body descriptor used to build a position-based kinematic rigid-body. 5262 - */ 5263 - static kinematicPositionBased() { 5264 - return new _RigidBodyDesc(RigidBodyType.KinematicPositionBased); 5265 - } 5266 - /** 5267 - * A rigid-body descriptor used to build a velocity-based kinematic rigid-body. 5268 - */ 5269 - static kinematicVelocityBased() { 5270 - return new _RigidBodyDesc(RigidBodyType.KinematicVelocityBased); 5271 - } 5272 - /** 5273 - * A rigid-body descriptor used to build a fixed rigid-body. 5274 - */ 5275 - static fixed() { 5276 - return new _RigidBodyDesc(RigidBodyType.Fixed); 5277 - } 5278 - /** 5279 - * A rigid-body descriptor used to build a dynamic rigid-body. 5280 - * 5281 - * @deprecated The method has been renamed to `.dynamic()`. 5282 - */ 5283 - static newDynamic() { 5284 - return new _RigidBodyDesc(RigidBodyType.Dynamic); 5285 - } 5286 - /** 5287 - * A rigid-body descriptor used to build a position-based kinematic rigid-body. 5288 - * 5289 - * @deprecated The method has been renamed to `.kinematicPositionBased()`. 5290 - */ 5291 - static newKinematicPositionBased() { 5292 - return new _RigidBodyDesc(RigidBodyType.KinematicPositionBased); 5293 - } 5294 - /** 5295 - * A rigid-body descriptor used to build a velocity-based kinematic rigid-body. 5296 - * 5297 - * @deprecated The method has been renamed to `.kinematicVelocityBased()`. 5298 - */ 5299 - static newKinematicVelocityBased() { 5300 - return new _RigidBodyDesc(RigidBodyType.KinematicVelocityBased); 5301 - } 5302 - /** 5303 - * A rigid-body descriptor used to build a fixed rigid-body. 5304 - * 5305 - * @deprecated The method has been renamed to `.fixed()`. 5306 - */ 5307 - static newStatic() { 5308 - return new _RigidBodyDesc(RigidBodyType.Fixed); 5309 - } 5310 - setDominanceGroup(group) { 5311 - this.dominanceGroup = group; 5312 - return this; 5313 - } 5314 - /** 5315 - * Sets the number of additional solver iterations that will be run for this 5316 - * rigid-body and everything that interacts with it directly or indirectly 5317 - * through contacts or joints. 5318 - * 5319 - * Compared to increasing the global `World.numSolverIteration`, setting this 5320 - * value lets you increase accuracy on only a subset of the scene, resulting in reduced 5321 - * performance loss. 5322 - * 5323 - * @param iters - The new number of additional solver iterations (default: 0). 5324 - */ 5325 - setAdditionalSolverIterations(iters) { 5326 - this.additionalSolverIterations = iters; 5327 - return this; 5328 - } 5329 - /** 5330 - * Sets whether the created rigid-body will be enabled or disabled. 5331 - * @param enabled − If set to `false` the rigid-body will be disabled at creation. 5332 - */ 5333 - setEnabled(enabled) { 5334 - this.enabled = enabled; 5335 - return this; 5336 - } 5337 - // #if DIM2 5338 - /** 5339 - * Sets the initial translation of the rigid-body to create. 5340 - */ 5341 - setTranslation(x, y) { 5342 - if (typeof x != "number" || typeof y != "number") 5343 - throw TypeError("The translation components must be numbers."); 5344 - this.translation = { x, y }; 5345 - return this; 5346 - } 5347 - // #endif 5348 - /** 5349 - * Sets the initial rotation of the rigid-body to create. 5350 - * 5351 - * @param rot - The rotation to set. 5352 - */ 5353 - setRotation(rot) { 5354 - this.rotation = rot; 5355 - return this; 5356 - } 5357 - /** 5358 - * Sets the scale factor applied to the gravity affecting 5359 - * the rigid-body being built. 5360 - * 5361 - * @param scale - The scale factor. Set this to `0.0` if the rigid-body 5362 - * needs to ignore gravity. 5363 - */ 5364 - setGravityScale(scale) { 5365 - this.gravityScale = scale; 5366 - return this; 5367 - } 5368 - /** 5369 - * Sets the initial mass of the rigid-body being built, before adding colliders' contributions. 5370 - * 5371 - * @param mass − The initial mass of the rigid-body to create. 5372 - */ 5373 - setAdditionalMass(mass) { 5374 - this.mass = mass; 5375 - this.massOnly = true; 5376 - return this; 5377 - } 5378 - // #if DIM2 5379 - /** 5380 - * Sets the initial linear velocity of the rigid-body to create. 5381 - * 5382 - * @param x - The linear velocity to set along the `x` axis. 5383 - * @param y - The linear velocity to set along the `y` axis. 5384 - */ 5385 - setLinvel(x, y) { 5386 - if (typeof x != "number" || typeof y != "number") 5387 - throw TypeError("The linvel components must be numbers."); 5388 - this.linvel = { x, y }; 5389 - return this; 5390 - } 5391 - /** 5392 - * Sets the initial angular velocity of the rigid-body to create. 5393 - * 5394 - * @param vel - The angular velocity to set. 5395 - */ 5396 - setAngvel(vel) { 5397 - this.angvel = vel; 5398 - return this; 5399 - } 5400 - /** 5401 - * Sets the mass properties of the rigid-body being built. 5402 - * 5403 - * Note that the final mass properties of the rigid-bodies depends 5404 - * on the initial mass-properties of the rigid-body (set by this method) 5405 - * to which is added the contributions of all the colliders with non-zero density 5406 - * attached to this rigid-body. 5407 - * 5408 - * Therefore, if you want your provided mass properties to be the final 5409 - * mass properties of your rigid-body, don't attach colliders to it, or 5410 - * only attach colliders with densities equal to zero. 5411 - * 5412 - * @param mass − The initial mass of the rigid-body to create. 5413 - * @param centerOfMass − The initial center-of-mass of the rigid-body to create. 5414 - * @param principalAngularInertia − The initial principal angular inertia of the rigid-body to create. 5415 - */ 5416 - setAdditionalMassProperties(mass, centerOfMass, principalAngularInertia) { 5417 - this.mass = mass; 5418 - VectorOps.copy(this.centerOfMass, centerOfMass); 5419 - this.principalAngularInertia = principalAngularInertia; 5420 - this.massOnly = false; 5421 - return this; 5422 - } 5423 - /** 5424 - * Allow translation of this rigid-body only along specific axes. 5425 - * @param translationsEnabledX - Are translations along the X axis enabled? 5426 - * @param translationsEnabledY - Are translations along the y axis enabled? 5427 - */ 5428 - enabledTranslations(translationsEnabledX, translationsEnabledY) { 5429 - this.translationsEnabledX = translationsEnabledX; 5430 - this.translationsEnabledY = translationsEnabledY; 5431 - return this; 5432 - } 5433 - /** 5434 - * Allow translation of this rigid-body only along specific axes. 5435 - * @param translationsEnabledX - Are translations along the X axis enabled? 5436 - * @param translationsEnabledY - Are translations along the y axis enabled? 5437 - * @deprecated use `this.enabledTranslations` with the same arguments instead. 5438 - */ 5439 - restrictTranslations(translationsEnabledX, translationsEnabledY) { 5440 - return this.enabledTranslations(translationsEnabledX, translationsEnabledY); 5441 - } 5442 - /** 5443 - * Locks all translations that would have resulted from forces on 5444 - * the created rigid-body. 5445 - */ 5446 - lockTranslations() { 5447 - return this.restrictTranslations(false, false); 5448 - } 5449 - /** 5450 - * Locks all rotations that would have resulted from forces on 5451 - * the created rigid-body. 5452 - */ 5453 - lockRotations() { 5454 - this.rotationsEnabled = false; 5455 - return this; 5456 - } 5457 - // #endif 5458 - /** 5459 - * Sets the linear damping of the rigid-body to create. 5460 - * 5461 - * This will progressively slowdown the translational movement of the rigid-body. 5462 - * 5463 - * @param damping - The angular damping coefficient. Should be >= 0. The higher this 5464 - * value is, the stronger the translational slowdown will be. 5465 - */ 5466 - setLinearDamping(damping) { 5467 - this.linearDamping = damping; 5468 - return this; 5469 - } 5470 - /** 5471 - * Sets the angular damping of the rigid-body to create. 5472 - * 5473 - * This will progressively slowdown the rotational movement of the rigid-body. 5474 - * 5475 - * @param damping - The angular damping coefficient. Should be >= 0. The higher this 5476 - * value is, the stronger the rotational slowdown will be. 5477 - */ 5478 - setAngularDamping(damping) { 5479 - this.angularDamping = damping; 5480 - return this; 5481 - } 5482 - /** 5483 - * Sets whether or not the rigid-body to create can sleep. 5484 - * 5485 - * @param can - true if the rigid-body can sleep, false if it can't. 5486 - */ 5487 - setCanSleep(can) { 5488 - this.canSleep = can; 5489 - return this; 5490 - } 5491 - /** 5492 - * Sets whether or not the rigid-body is to be created asleep. 5493 - * 5494 - * @param can - true if the rigid-body should be in sleep, default false. 5495 - */ 5496 - setSleeping(sleeping) { 5497 - this.sleeping = sleeping; 5498 - return this; 5499 - } 5500 - /** 5501 - * Sets whether Continuous Collision Detection (CCD) is enabled for this rigid-body. 5502 - * 5503 - * @param enabled - true if the rigid-body has CCD enabled. 5504 - */ 5505 - setCcdEnabled(enabled) { 5506 - this.ccdEnabled = enabled; 5507 - return this; 5508 - } 5509 - /** 5510 - * Sets the maximum prediction distance Soft Continuous Collision-Detection. 5511 - * 5512 - * When set to 0, soft-CCD is disabled. Soft-CCD helps prevent tunneling especially of 5513 - * slow-but-thin to moderately fast objects. The soft CCD prediction distance indicates how 5514 - * far in the object’s path the CCD algorithm is allowed to inspect. Large values can impact 5515 - * performance badly by increasing the work needed from the broad-phase. 5516 - * 5517 - * It is a generally cheaper variant of regular CCD (that can be enabled with 5518 - * `RigidBodyDesc::setCcdEnabled` since it relies on predictive constraints instead of 5519 - * shape-cast and substeps. 5520 - */ 5521 - setSoftCcdPrediction(distance) { 5522 - this.softCcdPrediction = distance; 5523 - return this; 5524 - } 5525 - /** 5526 - * Sets the user-defined object of this rigid-body. 5527 - * 5528 - * @param userData - The user-defined object to set. 5529 - */ 5530 - setUserData(data) { 5531 - this.userData = data; 5532 - return this; 5533 - } 5534 - }; 5535 - 5536 - // ../node_modules/@dimforge/rapier2d/coarena.js 5537 - var Coarena = class { 5538 - constructor() { 5539 - this.fconv = new Float64Array(1); 5540 - this.uconv = new Uint32Array(this.fconv.buffer); 5541 - this.data = new Array(); 5542 - this.size = 0; 5543 - } 5544 - set(handle, data) { 5545 - let i = this.index(handle); 5546 - while (this.data.length <= i) { 5547 - this.data.push(null); 5548 - } 5549 - if (this.data[i] == null) 5550 - this.size += 1; 5551 - this.data[i] = data; 5552 - } 5553 - len() { 5554 - return this.size; 5555 - } 5556 - delete(handle) { 5557 - let i = this.index(handle); 5558 - if (i < this.data.length) { 5559 - if (this.data[i] != null) 5560 - this.size -= 1; 5561 - this.data[i] = null; 5562 - } 5563 - } 5564 - clear() { 5565 - this.data = new Array(); 5566 - } 5567 - get(handle) { 5568 - let i = this.index(handle); 5569 - if (i < this.data.length) { 5570 - return this.data[i]; 5571 - } else { 5572 - return null; 5573 - } 5574 - } 5575 - forEach(f) { 5576 - for (const elt of this.data) { 5577 - if (elt != null) 5578 - f(elt); 5579 - } 5580 - } 5581 - getAll() { 5582 - return this.data.filter((elt) => elt != null); 5583 - } 5584 - index(handle) { 5585 - this.fconv[0] = handle; 5586 - return this.uconv[0]; 5587 - } 5588 - }; 5589 - 5590 - // ../node_modules/@dimforge/rapier2d/dynamics/rigid_body_set.js 5591 - var RigidBodySet = class { 5592 - constructor(raw) { 5593 - this.raw = raw || new RawRigidBodySet(); 5594 - this.map = new Coarena(); 5595 - if (raw) { 5596 - raw.forEachRigidBodyHandle((handle) => { 5597 - this.map.set(handle, new RigidBody(raw, null, handle)); 5598 - }); 5599 - } 5600 - } 5601 - /** 5602 - * Release the WASM memory occupied by this rigid-body set. 5603 - */ 5604 - free() { 5605 - if (!!this.raw) { 5606 - this.raw.free(); 5607 - } 5608 - this.raw = void 0; 5609 - if (!!this.map) { 5610 - this.map.clear(); 5611 - } 5612 - this.map = void 0; 5613 - } 5614 - /** 5615 - * Internal method, do not call this explicitly. 5616 - */ 5617 - finalizeDeserialization(colliderSet) { 5618 - this.map.forEach((rb) => rb.finalizeDeserialization(colliderSet)); 5619 - } 5620 - /** 5621 - * Creates a new rigid-body and return its integer handle. 5622 - * 5623 - * @param desc - The description of the rigid-body to create. 5624 - */ 5625 - createRigidBody(colliderSet, desc) { 5626 - let rawTra = VectorOps.intoRaw(desc.translation); 5627 - let rawRot = RotationOps.intoRaw(desc.rotation); 5628 - let rawLv = VectorOps.intoRaw(desc.linvel); 5629 - let rawCom = VectorOps.intoRaw(desc.centerOfMass); 5630 - let handle = this.raw.createRigidBody( 5631 - desc.enabled, 5632 - rawTra, 5633 - rawRot, 5634 - desc.gravityScale, 5635 - desc.mass, 5636 - desc.massOnly, 5637 - rawCom, 5638 - rawLv, 5639 - // #if DIM2 5640 - desc.angvel, 5641 - desc.principalAngularInertia, 5642 - desc.translationsEnabledX, 5643 - desc.translationsEnabledY, 5644 - desc.rotationsEnabled, 5645 - // #endif 5646 - desc.linearDamping, 5647 - desc.angularDamping, 5648 - desc.status, 5649 - desc.canSleep, 5650 - desc.sleeping, 5651 - desc.softCcdPrediction, 5652 - desc.ccdEnabled, 5653 - desc.dominanceGroup, 5654 - desc.additionalSolverIterations 5655 - ); 5656 - rawTra.free(); 5657 - rawRot.free(); 5658 - rawLv.free(); 5659 - rawCom.free(); 5660 - const body = new RigidBody(this.raw, colliderSet, handle); 5661 - body.userData = desc.userData; 5662 - this.map.set(handle, body); 5663 - return body; 5664 - } 5665 - /** 5666 - * Removes a rigid-body from this set. 5667 - * 5668 - * This will also remove all the colliders and joints attached to the rigid-body. 5669 - * 5670 - * @param handle - The integer handle of the rigid-body to remove. 5671 - * @param colliders - The set of colliders that may contain colliders attached to the removed rigid-body. 5672 - * @param impulseJoints - The set of impulse joints that may contain joints attached to the removed rigid-body. 5673 - * @param multibodyJoints - The set of multibody joints that may contain joints attached to the removed rigid-body. 5674 - */ 5675 - remove(handle, islands, colliders, impulseJoints, multibodyJoints) { 5676 - for (let i = 0; i < this.raw.rbNumColliders(handle); i += 1) { 5677 - colliders.unmap(this.raw.rbCollider(handle, i)); 5678 - } 5679 - impulseJoints.forEachJointHandleAttachedToRigidBody(handle, (handle2) => impulseJoints.unmap(handle2)); 5680 - multibodyJoints.forEachJointHandleAttachedToRigidBody(handle, (handle2) => multibodyJoints.unmap(handle2)); 5681 - this.raw.remove(handle, islands.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw); 5682 - this.map.delete(handle); 5683 - } 5684 - /** 5685 - * The number of rigid-bodies on this set. 5686 - */ 5687 - len() { 5688 - return this.map.len(); 5689 - } 5690 - /** 5691 - * Does this set contain a rigid-body with the given handle? 5692 - * 5693 - * @param handle - The rigid-body handle to check. 5694 - */ 5695 - contains(handle) { 5696 - return this.get(handle) != null; 5697 - } 5698 - /** 5699 - * Gets the rigid-body with the given handle. 5700 - * 5701 - * @param handle - The handle of the rigid-body to retrieve. 5702 - */ 5703 - get(handle) { 5704 - return this.map.get(handle); 5705 - } 5706 - /** 5707 - * Applies the given closure to each rigid-body contained by this set. 5708 - * 5709 - * @param f - The closure to apply. 5710 - */ 5711 - forEach(f) { 5712 - this.map.forEach(f); 5713 - } 5714 - /** 5715 - * Applies the given closure to each active rigid-bodies contained by this set. 5716 - * 5717 - * A rigid-body is active if it is not sleeping, i.e., if it moved recently. 5718 - * 5719 - * @param f - The closure to apply. 5720 - */ 5721 - forEachActiveRigidBody(islands, f) { 5722 - islands.forEachActiveRigidBodyHandle((handle) => { 5723 - f(this.get(handle)); 5724 - }); 5725 - } 5726 - /** 5727 - * Gets all rigid-bodies in the list. 5728 - * 5729 - * @returns rigid-bodies list. 5730 - */ 5731 - getAll() { 5732 - return this.map.getAll(); 5733 - } 5734 - }; 5735 - 5736 - // ../node_modules/@dimforge/rapier2d/dynamics/integration_parameters.js 5737 - var IntegrationParameters = class { 5738 - constructor(raw) { 5739 - this.raw = raw || new RawIntegrationParameters(); 5740 - } 5741 - /** 5742 - * Free the WASM memory used by these integration parameters. 5743 - */ 5744 - free() { 5745 - if (!!this.raw) { 5746 - this.raw.free(); 5747 - } 5748 - this.raw = void 0; 5749 - } 5750 - /** 5751 - * The timestep length (default: `1.0 / 60.0`) 5752 - */ 5753 - get dt() { 5754 - return this.raw.dt; 5755 - } 5756 - /** 5757 - * The Error Reduction Parameter in `[0, 1]` is the proportion of 5758 - * the positional error to be corrected at each time step (default: `0.2`). 5759 - */ 5760 - get erp() { 5761 - return this.raw.erp; 5762 - } 5763 - get lengthUnit() { 5764 - return this.raw.lengthUnit; 5765 - } 5766 - /** 5767 - * Normalized amount of penetration the engine won’t attempt to correct (default: `0.001m`). 5768 - * 5769 - * This threshold considered by the physics engine is this value multiplied by the `lengthUnit`. 5770 - */ 5771 - get normalizedAllowedLinearError() { 5772 - return this.raw.normalizedAllowedLinearError; 5773 - } 5774 - /** 5775 - * The maximal normalized distance separating two objects that will generate predictive contacts (default: `0.002`). 5776 - * 5777 - * This threshold considered by the physics engine is this value multiplied by the `lengthUnit`. 5778 - */ 5779 - get normalizedPredictionDistance() { 5780 - return this.raw.normalizedPredictionDistance; 5781 - } 5782 - /** 5783 - * The number of solver iterations run by the constraints solver for calculating forces (default: `4`). 5784 - */ 5785 - get numSolverIterations() { 5786 - return this.raw.numSolverIterations; 5787 - } 5788 - /** 5789 - * Number of addition friction resolution iteration run during the last solver sub-step (default: `4`). 5790 - */ 5791 - get numAdditionalFrictionIterations() { 5792 - return this.raw.numAdditionalFrictionIterations; 5793 - } 5794 - /** 5795 - * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`). 5796 - */ 5797 - get numInternalPgsIterations() { 5798 - return this.raw.numInternalPgsIterations; 5799 - } 5800 - /** 5801 - * Minimum number of dynamic bodies in each active island (default: `128`). 5802 - */ 5803 - get minIslandSize() { 5804 - return this.raw.minIslandSize; 5805 - } 5806 - /** 5807 - * Maximum number of substeps performed by the solver (default: `1`). 5808 - */ 5809 - get maxCcdSubsteps() { 5810 - return this.raw.maxCcdSubsteps; 5811 - } 5812 - set dt(value) { 5813 - this.raw.dt = value; 5814 - } 5815 - set erp(value) { 5816 - this.raw.erp = value; 5817 - } 5818 - set lengthUnit(value) { 5819 - this.raw.lengthUnit = value; 5820 - } 5821 - set normalizedAllowedLinearError(value) { 5822 - this.raw.normalizedAllowedLinearError = value; 5823 - } 5824 - set normalizedPredictionDistance(value) { 5825 - this.raw.normalizedPredictionDistance = value; 5826 - } 5827 - /** 5828 - * Sets the number of solver iterations run by the constraints solver for calculating forces (default: `4`). 5829 - */ 5830 - set numSolverIterations(value) { 5831 - this.raw.numSolverIterations = value; 5832 - } 5833 - /** 5834 - * Sets the number of addition friction resolution iteration run during the last solver sub-step (default: `4`). 5835 - */ 5836 - set numAdditionalFrictionIterations(value) { 5837 - this.raw.numAdditionalFrictionIterations = value; 5838 - } 5839 - /** 5840 - * Sets the number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`). 5841 - */ 5842 - set numInternalPgsIterations(value) { 5843 - this.raw.numInternalPgsIterations = value; 5844 - } 5845 - set minIslandSize(value) { 5846 - this.raw.minIslandSize = value; 5847 - } 5848 - set maxCcdSubsteps(value) { 5849 - this.raw.maxCcdSubsteps = value; 5850 - } 5851 - switchToStandardPgsSolver() { 5852 - this.raw.switchToStandardPgsSolver(); 5853 - } 5854 - switchToSmallStepsPgsSolver() { 5855 - this.raw.switchToSmallStepsPgsSolver(); 5856 - } 5857 - switchToSmallStepsPgsSolverWithoutWarmstart() { 5858 - this.raw.switchToSmallStepsPgsSolverWithoutWarmstart(); 5859 - } 5860 - }; 5861 - 5862 - // ../node_modules/@dimforge/rapier2d/dynamics/impulse_joint.js 5863 - var JointType; 5864 - (function(JointType2) { 5865 - JointType2[JointType2["Revolute"] = 0] = "Revolute"; 5866 - JointType2[JointType2["Fixed"] = 1] = "Fixed"; 5867 - JointType2[JointType2["Prismatic"] = 2] = "Prismatic"; 5868 - JointType2[JointType2["Rope"] = 3] = "Rope"; 5869 - JointType2[JointType2["Spring"] = 4] = "Spring"; 5870 - })(JointType || (JointType = {})); 5871 - var MotorModel; 5872 - (function(MotorModel2) { 5873 - MotorModel2[MotorModel2["AccelerationBased"] = 0] = "AccelerationBased"; 5874 - MotorModel2[MotorModel2["ForceBased"] = 1] = "ForceBased"; 5875 - })(MotorModel || (MotorModel = {})); 5876 - var JointAxesMask; 5877 - (function(JointAxesMask2) { 5878 - JointAxesMask2[JointAxesMask2["X"] = 1] = "X"; 5879 - JointAxesMask2[JointAxesMask2["Y"] = 2] = "Y"; 5880 - JointAxesMask2[JointAxesMask2["Z"] = 4] = "Z"; 5881 - JointAxesMask2[JointAxesMask2["AngX"] = 8] = "AngX"; 5882 - JointAxesMask2[JointAxesMask2["AngY"] = 16] = "AngY"; 5883 - JointAxesMask2[JointAxesMask2["AngZ"] = 32] = "AngZ"; 5884 - })(JointAxesMask || (JointAxesMask = {})); 5885 - var ImpulseJoint = class _ImpulseJoint { 5886 - constructor(rawSet, bodySet, handle) { 5887 - this.rawSet = rawSet; 5888 - this.bodySet = bodySet; 5889 - this.handle = handle; 5890 - } 5891 - static newTyped(rawSet, bodySet, handle) { 5892 - switch (rawSet.jointType(handle)) { 5893 - case RawJointType.Revolute: 5894 - return new RevoluteImpulseJoint(rawSet, bodySet, handle); 5895 - case RawJointType.Prismatic: 5896 - return new PrismaticImpulseJoint(rawSet, bodySet, handle); 5897 - case RawJointType.Fixed: 5898 - return new FixedImpulseJoint(rawSet, bodySet, handle); 5899 - case RawJointType.Spring: 5900 - return new SpringImpulseJoint(rawSet, bodySet, handle); 5901 - case RawJointType.Rope: 5902 - return new RopeImpulseJoint(rawSet, bodySet, handle); 5903 - default: 5904 - return new _ImpulseJoint(rawSet, bodySet, handle); 5905 - } 5906 - } 5907 - /** @internal */ 5908 - finalizeDeserialization(bodySet) { 5909 - this.bodySet = bodySet; 5910 - } 5911 - /** 5912 - * Checks if this joint is still valid (i.e. that it has 5913 - * not been deleted from the joint set yet). 5914 - */ 5915 - isValid() { 5916 - return this.rawSet.contains(this.handle); 5917 - } 5918 - /** 5919 - * The first rigid-body this joint it attached to. 5920 - */ 5921 - body1() { 5922 - return this.bodySet.get(this.rawSet.jointBodyHandle1(this.handle)); 5923 - } 5924 - /** 5925 - * The second rigid-body this joint is attached to. 5926 - */ 5927 - body2() { 5928 - return this.bodySet.get(this.rawSet.jointBodyHandle2(this.handle)); 5929 - } 5930 - /** 5931 - * The type of this joint given as a string. 5932 - */ 5933 - type() { 5934 - return this.rawSet.jointType(this.handle); 5935 - } 5936 - /** 5937 - * The position of the first anchor of this joint. 5938 - * 5939 - * The first anchor gives the position of the application point on the 5940 - * local frame of the first rigid-body it is attached to. 5941 - */ 5942 - anchor1() { 5943 - return VectorOps.fromRaw(this.rawSet.jointAnchor1(this.handle)); 5944 - } 5945 - /** 5946 - * The position of the second anchor of this joint. 5947 - * 5948 - * The second anchor gives the position of the application point on the 5949 - * local frame of the second rigid-body it is attached to. 5950 - */ 5951 - anchor2() { 5952 - return VectorOps.fromRaw(this.rawSet.jointAnchor2(this.handle)); 5953 - } 5954 - /** 5955 - * Sets the position of the first anchor of this joint. 5956 - * 5957 - * The first anchor gives the position of the application point on the 5958 - * local frame of the first rigid-body it is attached to. 5959 - */ 5960 - setAnchor1(newPos) { 5961 - const rawPoint = VectorOps.intoRaw(newPos); 5962 - this.rawSet.jointSetAnchor1(this.handle, rawPoint); 5963 - rawPoint.free(); 5964 - } 5965 - /** 5966 - * Sets the position of the second anchor of this joint. 5967 - * 5968 - * The second anchor gives the position of the application point on the 5969 - * local frame of the second rigid-body it is attached to. 5970 - */ 5971 - setAnchor2(newPos) { 5972 - const rawPoint = VectorOps.intoRaw(newPos); 5973 - this.rawSet.jointSetAnchor2(this.handle, rawPoint); 5974 - rawPoint.free(); 5975 - } 5976 - /** 5977 - * Controls whether contacts are computed between colliders attached 5978 - * to the rigid-bodies linked by this joint. 5979 - */ 5980 - setContactsEnabled(enabled) { 5981 - this.rawSet.jointSetContactsEnabled(this.handle, enabled); 5982 - } 5983 - /** 5984 - * Indicates if contacts are enabled between colliders attached 5985 - * to the rigid-bodies linked by this joint. 5986 - */ 5987 - contactsEnabled() { 5988 - return this.rawSet.jointContactsEnabled(this.handle); 5989 - } 5990 - }; 5991 - var UnitImpulseJoint = class extends ImpulseJoint { 5992 - /** 5993 - * Are the limits enabled for this joint? 5994 - */ 5995 - limitsEnabled() { 5996 - return this.rawSet.jointLimitsEnabled(this.handle, this.rawAxis()); 5997 - } 5998 - /** 5999 - * The min limit of this joint. 6000 - */ 6001 - limitsMin() { 6002 - return this.rawSet.jointLimitsMin(this.handle, this.rawAxis()); 6003 - } 6004 - /** 6005 - * The max limit of this joint. 6006 - */ 6007 - limitsMax() { 6008 - return this.rawSet.jointLimitsMax(this.handle, this.rawAxis()); 6009 - } 6010 - /** 6011 - * Sets the limits of this joint. 6012 - * 6013 - * @param min - The minimum bound of this joint’s free coordinate. 6014 - * @param max - The maximum bound of this joint’s free coordinate. 6015 - */ 6016 - setLimits(min, max) { 6017 - this.rawSet.jointSetLimits(this.handle, this.rawAxis(), min, max); 6018 - } 6019 - configureMotorModel(model) { 6020 - this.rawSet.jointConfigureMotorModel(this.handle, this.rawAxis(), model); 6021 - } 6022 - configureMotorVelocity(targetVel, factor) { 6023 - this.rawSet.jointConfigureMotorVelocity(this.handle, this.rawAxis(), targetVel, factor); 6024 - } 6025 - configureMotorPosition(targetPos, stiffness, damping) { 6026 - this.rawSet.jointConfigureMotorPosition(this.handle, this.rawAxis(), targetPos, stiffness, damping); 6027 - } 6028 - configureMotor(targetPos, targetVel, stiffness, damping) { 6029 - this.rawSet.jointConfigureMotor(this.handle, this.rawAxis(), targetPos, targetVel, stiffness, damping); 6030 - } 6031 - }; 6032 - var FixedImpulseJoint = class extends ImpulseJoint { 6033 - }; 6034 - var RopeImpulseJoint = class extends ImpulseJoint { 6035 - }; 6036 - var SpringImpulseJoint = class extends ImpulseJoint { 6037 - }; 6038 - var PrismaticImpulseJoint = class extends UnitImpulseJoint { 6039 - rawAxis() { 6040 - return RawJointAxis.X; 6041 - } 6042 - }; 6043 - var RevoluteImpulseJoint = class extends UnitImpulseJoint { 6044 - rawAxis() { 6045 - return RawJointAxis.AngX; 6046 - } 6047 - }; 6048 - var JointData = class _JointData { 6049 - constructor() { 6050 - } 6051 - /** 6052 - * Creates a new joint descriptor that builds a Fixed joint. 6053 - * 6054 - * A fixed joint removes all the degrees of freedom between the affected bodies, ensuring their 6055 - * anchor and local frames coincide in world-space. 6056 - * 6057 - * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the 6058 - * local-space of the rigid-body. 6059 - * @param frame1 - The reference orientation of the joint wrt. the first rigid-body. 6060 - * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the 6061 - * local-space of the rigid-body. 6062 - * @param frame2 - The reference orientation of the joint wrt. the second rigid-body. 6063 - */ 6064 - static fixed(anchor1, frame1, anchor2, frame2) { 6065 - let res = new _JointData(); 6066 - res.anchor1 = anchor1; 6067 - res.anchor2 = anchor2; 6068 - res.frame1 = frame1; 6069 - res.frame2 = frame2; 6070 - res.jointType = JointType.Fixed; 6071 - return res; 6072 - } 6073 - static spring(rest_length, stiffness, damping, anchor1, anchor2) { 6074 - let res = new _JointData(); 6075 - res.anchor1 = anchor1; 6076 - res.anchor2 = anchor2; 6077 - res.length = rest_length; 6078 - res.stiffness = stiffness; 6079 - res.damping = damping; 6080 - res.jointType = JointType.Spring; 6081 - return res; 6082 - } 6083 - static rope(length, anchor1, anchor2) { 6084 - let res = new _JointData(); 6085 - res.anchor1 = anchor1; 6086 - res.anchor2 = anchor2; 6087 - res.length = length; 6088 - res.jointType = JointType.Rope; 6089 - return res; 6090 - } 6091 - // #if DIM2 6092 - /** 6093 - * Create a new joint descriptor that builds revolute joints. 6094 - * 6095 - * A revolute joint allows three relative rotational degrees of freedom 6096 - * by preventing any relative translation between the anchors of the 6097 - * two attached rigid-bodies. 6098 - * 6099 - * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the 6100 - * local-space of the rigid-body. 6101 - * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the 6102 - * local-space of the rigid-body. 6103 - */ 6104 - static revolute(anchor1, anchor2) { 6105 - let res = new _JointData(); 6106 - res.anchor1 = anchor1; 6107 - res.anchor2 = anchor2; 6108 - res.jointType = JointType.Revolute; 6109 - return res; 6110 - } 6111 - /** 6112 - * Creates a new joint descriptor that builds a Prismatic joint. 6113 - * 6114 - * A prismatic joint removes all the degrees of freedom between the 6115 - * affected bodies, except for the translation along one axis. 6116 - * 6117 - * @param anchor1 - Point where the joint is attached on the first rigid-body affected by this joint. Expressed in the 6118 - * local-space of the rigid-body. 6119 - * @param anchor2 - Point where the joint is attached on the second rigid-body affected by this joint. Expressed in the 6120 - * local-space of the rigid-body. 6121 - * @param axis - Axis of the joint, expressed in the local-space of the rigid-bodies it is attached to. 6122 - */ 6123 - static prismatic(anchor1, anchor2, axis) { 6124 - let res = new _JointData(); 6125 - res.anchor1 = anchor1; 6126 - res.anchor2 = anchor2; 6127 - res.axis = axis; 6128 - res.jointType = JointType.Prismatic; 6129 - return res; 6130 - } 6131 - // #endif 6132 - intoRaw() { 6133 - let rawA1 = VectorOps.intoRaw(this.anchor1); 6134 - let rawA2 = VectorOps.intoRaw(this.anchor2); 6135 - let rawAx; 6136 - let result; 6137 - let limitsEnabled = false; 6138 - let limitsMin = 0; 6139 - let limitsMax = 0; 6140 - switch (this.jointType) { 6141 - case JointType.Fixed: 6142 - let rawFra1 = RotationOps.intoRaw(this.frame1); 6143 - let rawFra2 = RotationOps.intoRaw(this.frame2); 6144 - result = RawGenericJoint.fixed(rawA1, rawFra1, rawA2, rawFra2); 6145 - rawFra1.free(); 6146 - rawFra2.free(); 6147 - break; 6148 - case JointType.Spring: 6149 - result = RawGenericJoint.spring(this.length, this.stiffness, this.damping, rawA1, rawA2); 6150 - break; 6151 - case JointType.Rope: 6152 - result = RawGenericJoint.rope(this.length, rawA1, rawA2); 6153 - break; 6154 - case JointType.Prismatic: 6155 - rawAx = VectorOps.intoRaw(this.axis); 6156 - if (!!this.limitsEnabled) { 6157 - limitsEnabled = true; 6158 - limitsMin = this.limits[0]; 6159 - limitsMax = this.limits[1]; 6160 - } 6161 - result = RawGenericJoint.prismatic(rawA1, rawA2, rawAx, limitsEnabled, limitsMin, limitsMax); 6162 - rawAx.free(); 6163 - break; 6164 - case JointType.Revolute: 6165 - result = RawGenericJoint.revolute(rawA1, rawA2); 6166 - break; 6167 - } 6168 - rawA1.free(); 6169 - rawA2.free(); 6170 - return result; 6171 - } 6172 - }; 6173 - 6174 - // ../node_modules/@dimforge/rapier2d/dynamics/impulse_joint_set.js 6175 - var ImpulseJointSet = class { 6176 - constructor(raw) { 6177 - this.raw = raw || new RawImpulseJointSet(); 6178 - this.map = new Coarena(); 6179 - if (raw) { 6180 - raw.forEachJointHandle((handle) => { 6181 - this.map.set(handle, ImpulseJoint.newTyped(raw, null, handle)); 6182 - }); 6183 - } 6184 - } 6185 - /** 6186 - * Release the WASM memory occupied by this joint set. 6187 - */ 6188 - free() { 6189 - if (!!this.raw) { 6190 - this.raw.free(); 6191 - } 6192 - this.raw = void 0; 6193 - if (!!this.map) { 6194 - this.map.clear(); 6195 - } 6196 - this.map = void 0; 6197 - } 6198 - /** @internal */ 6199 - finalizeDeserialization(bodies) { 6200 - this.map.forEach((joint) => joint.finalizeDeserialization(bodies)); 6201 - } 6202 - /** 6203 - * Creates a new joint and return its integer handle. 6204 - * 6205 - * @param bodies - The set of rigid-bodies containing the bodies the joint is attached to. 6206 - * @param desc - The joint's parameters. 6207 - * @param parent1 - The handle of the first rigid-body this joint is attached to. 6208 - * @param parent2 - The handle of the second rigid-body this joint is attached to. 6209 - * @param wakeUp - Should the attached rigid-bodies be awakened? 6210 - */ 6211 - createJoint(bodies, desc, parent1, parent2, wakeUp) { 6212 - const rawParams = desc.intoRaw(); 6213 - const handle = this.raw.createJoint(rawParams, parent1, parent2, wakeUp); 6214 - rawParams.free(); 6215 - let joint = ImpulseJoint.newTyped(this.raw, bodies, handle); 6216 - this.map.set(handle, joint); 6217 - return joint; 6218 - } 6219 - /** 6220 - * Remove a joint from this set. 6221 - * 6222 - * @param handle - The integer handle of the joint. 6223 - * @param wakeUp - If `true`, the rigid-bodies attached by the removed joint will be woken-up automatically. 6224 - */ 6225 - remove(handle, wakeUp) { 6226 - this.raw.remove(handle, wakeUp); 6227 - this.unmap(handle); 6228 - } 6229 - /** 6230 - * Calls the given closure with the integer handle of each impulse joint attached to this rigid-body. 6231 - * 6232 - * @param f - The closure called with the integer handle of each impulse joint attached to the rigid-body. 6233 - */ 6234 - forEachJointHandleAttachedToRigidBody(handle, f) { 6235 - this.raw.forEachJointAttachedToRigidBody(handle, f); 6236 - } 6237 - /** 6238 - * Internal function, do not call directly. 6239 - * @param handle 6240 - */ 6241 - unmap(handle) { 6242 - this.map.delete(handle); 6243 - } 6244 - /** 6245 - * The number of joints on this set. 6246 - */ 6247 - len() { 6248 - return this.map.len(); 6249 - } 6250 - /** 6251 - * Does this set contain a joint with the given handle? 6252 - * 6253 - * @param handle - The joint handle to check. 6254 - */ 6255 - contains(handle) { 6256 - return this.get(handle) != null; 6257 - } 6258 - /** 6259 - * Gets the joint with the given handle. 6260 - * 6261 - * Returns `null` if no joint with the specified handle exists. 6262 - * 6263 - * @param handle - The integer handle of the joint to retrieve. 6264 - */ 6265 - get(handle) { 6266 - return this.map.get(handle); 6267 - } 6268 - /** 6269 - * Applies the given closure to each joint contained by this set. 6270 - * 6271 - * @param f - The closure to apply. 6272 - */ 6273 - forEach(f) { 6274 - this.map.forEach(f); 6275 - } 6276 - /** 6277 - * Gets all joints in the list. 6278 - * 6279 - * @returns joint list. 6280 - */ 6281 - getAll() { 6282 - return this.map.getAll(); 6283 - } 6284 - }; 6285 - 6286 - // ../node_modules/@dimforge/rapier2d/dynamics/multibody_joint.js 6287 - var MultibodyJoint = class _MultibodyJoint { 6288 - constructor(rawSet, handle) { 6289 - this.rawSet = rawSet; 6290 - this.handle = handle; 6291 - } 6292 - static newTyped(rawSet, handle) { 6293 - switch (rawSet.jointType(handle)) { 6294 - case RawJointType.Revolute: 6295 - return new RevoluteMultibodyJoint(rawSet, handle); 6296 - case RawJointType.Prismatic: 6297 - return new PrismaticMultibodyJoint(rawSet, handle); 6298 - case RawJointType.Fixed: 6299 - return new FixedMultibodyJoint(rawSet, handle); 6300 - default: 6301 - return new _MultibodyJoint(rawSet, handle); 6302 - } 6303 - } 6304 - /** 6305 - * Checks if this joint is still valid (i.e. that it has 6306 - * not been deleted from the joint set yet). 6307 - */ 6308 - isValid() { 6309 - return this.rawSet.contains(this.handle); 6310 - } 6311 - // /** 6312 - // * The unique integer identifier of the first rigid-body this joint it attached to. 6313 - // */ 6314 - // public bodyHandle1(): RigidBodyHandle { 6315 - // return this.rawSet.jointBodyHandle1(this.handle); 6316 - // } 6317 - // 6318 - // /** 6319 - // * The unique integer identifier of the second rigid-body this joint is attached to. 6320 - // */ 6321 - // public bodyHandle2(): RigidBodyHandle { 6322 - // return this.rawSet.jointBodyHandle2(this.handle); 6323 - // } 6324 - // 6325 - // /** 6326 - // * The type of this joint given as a string. 6327 - // */ 6328 - // public type(): JointType { 6329 - // return this.rawSet.jointType(this.handle); 6330 - // } 6331 - // 6332 - // 6333 - // 6334 - // /** 6335 - // * The position of the first anchor of this joint. 6336 - // * 6337 - // * The first anchor gives the position of the points application point on the 6338 - // * local frame of the first rigid-body it is attached to. 6339 - // */ 6340 - // public anchor1(): Vector { 6341 - // return VectorOps.fromRaw(this.rawSet.jointAnchor1(this.handle)); 6342 - // } 6343 - // 6344 - // /** 6345 - // * The position of the second anchor of this joint. 6346 - // * 6347 - // * The second anchor gives the position of the points application point on the 6348 - // * local frame of the second rigid-body it is attached to. 6349 - // */ 6350 - // public anchor2(): Vector { 6351 - // return VectorOps.fromRaw(this.rawSet.jointAnchor2(this.handle)); 6352 - // } 6353 - /** 6354 - * Controls whether contacts are computed between colliders attached 6355 - * to the rigid-bodies linked by this joint. 6356 - */ 6357 - setContactsEnabled(enabled) { 6358 - this.rawSet.jointSetContactsEnabled(this.handle, enabled); 6359 - } 6360 - /** 6361 - * Indicates if contacts are enabled between colliders attached 6362 - * to the rigid-bodies linked by this joint. 6363 - */ 6364 - contactsEnabled() { 6365 - return this.rawSet.jointContactsEnabled(this.handle); 6366 - } 6367 - }; 6368 - var UnitMultibodyJoint = class extends MultibodyJoint { 6369 - }; 6370 - var FixedMultibodyJoint = class extends MultibodyJoint { 6371 - }; 6372 - var PrismaticMultibodyJoint = class extends UnitMultibodyJoint { 6373 - rawAxis() { 6374 - return RawJointAxis.X; 6375 - } 6376 - }; 6377 - var RevoluteMultibodyJoint = class extends UnitMultibodyJoint { 6378 - rawAxis() { 6379 - return RawJointAxis.AngX; 6380 - } 6381 - }; 6382 - 6383 - // ../node_modules/@dimforge/rapier2d/dynamics/multibody_joint_set.js 6384 - var MultibodyJointSet = class { 6385 - constructor(raw) { 6386 - this.raw = raw || new RawMultibodyJointSet(); 6387 - this.map = new Coarena(); 6388 - if (raw) { 6389 - raw.forEachJointHandle((handle) => { 6390 - this.map.set(handle, MultibodyJoint.newTyped(this.raw, handle)); 6391 - }); 6392 - } 6393 - } 6394 - /** 6395 - * Release the WASM memory occupied by this joint set. 6396 - */ 6397 - free() { 6398 - if (!!this.raw) { 6399 - this.raw.free(); 6400 - } 6401 - this.raw = void 0; 6402 - if (!!this.map) { 6403 - this.map.clear(); 6404 - } 6405 - this.map = void 0; 6406 - } 6407 - /** 6408 - * Creates a new joint and return its integer handle. 6409 - * 6410 - * @param desc - The joint's parameters. 6411 - * @param parent1 - The handle of the first rigid-body this joint is attached to. 6412 - * @param parent2 - The handle of the second rigid-body this joint is attached to. 6413 - * @param wakeUp - Should the attached rigid-bodies be awakened? 6414 - */ 6415 - createJoint(desc, parent1, parent2, wakeUp) { 6416 - const rawParams = desc.intoRaw(); 6417 - const handle = this.raw.createJoint(rawParams, parent1, parent2, wakeUp); 6418 - rawParams.free(); 6419 - let joint = MultibodyJoint.newTyped(this.raw, handle); 6420 - this.map.set(handle, joint); 6421 - return joint; 6422 - } 6423 - /** 6424 - * Remove a joint from this set. 6425 - * 6426 - * @param handle - The integer handle of the joint. 6427 - * @param wake_up - If `true`, the rigid-bodies attached by the removed joint will be woken-up automatically. 6428 - */ 6429 - remove(handle, wake_up) { 6430 - this.raw.remove(handle, wake_up); 6431 - this.map.delete(handle); 6432 - } 6433 - /** 6434 - * Internal function, do not call directly. 6435 - * @param handle 6436 - */ 6437 - unmap(handle) { 6438 - this.map.delete(handle); 6439 - } 6440 - /** 6441 - * The number of joints on this set. 6442 - */ 6443 - len() { 6444 - return this.map.len(); 6445 - } 6446 - /** 6447 - * Does this set contain a joint with the given handle? 6448 - * 6449 - * @param handle - The joint handle to check. 6450 - */ 6451 - contains(handle) { 6452 - return this.get(handle) != null; 6453 - } 6454 - /** 6455 - * Gets the joint with the given handle. 6456 - * 6457 - * Returns `null` if no joint with the specified handle exists. 6458 - * 6459 - * @param handle - The integer handle of the joint to retrieve. 6460 - */ 6461 - get(handle) { 6462 - return this.map.get(handle); 6463 - } 6464 - /** 6465 - * Applies the given closure to each joint contained by this set. 6466 - * 6467 - * @param f - The closure to apply. 6468 - */ 6469 - forEach(f) { 6470 - this.map.forEach(f); 6471 - } 6472 - /** 6473 - * Calls the given closure with the integer handle of each multibody joint attached to this rigid-body. 6474 - * 6475 - * @param f - The closure called with the integer handle of each multibody joint attached to the rigid-body. 6476 - */ 6477 - forEachJointHandleAttachedToRigidBody(handle, f) { 6478 - this.raw.forEachJointAttachedToRigidBody(handle, f); 6479 - } 6480 - /** 6481 - * Gets all joints in the list. 6482 - * 6483 - * @returns joint list. 6484 - */ 6485 - getAll() { 6486 - return this.map.getAll(); 6487 - } 6488 - }; 6489 - 6490 - // ../node_modules/@dimforge/rapier2d/dynamics/coefficient_combine_rule.js 6491 - var CoefficientCombineRule; 6492 - (function(CoefficientCombineRule2) { 6493 - CoefficientCombineRule2[CoefficientCombineRule2["Average"] = 0] = "Average"; 6494 - CoefficientCombineRule2[CoefficientCombineRule2["Min"] = 1] = "Min"; 6495 - CoefficientCombineRule2[CoefficientCombineRule2["Multiply"] = 2] = "Multiply"; 6496 - CoefficientCombineRule2[CoefficientCombineRule2["Max"] = 3] = "Max"; 6497 - })(CoefficientCombineRule || (CoefficientCombineRule = {})); 6498 - 6499 - // ../node_modules/@dimforge/rapier2d/dynamics/ccd_solver.js 6500 - var CCDSolver = class { 6501 - constructor(raw) { 6502 - this.raw = raw || new RawCCDSolver(); 6503 - } 6504 - /** 6505 - * Release the WASM memory occupied by this narrow-phase. 6506 - */ 6507 - free() { 6508 - if (!!this.raw) { 6509 - this.raw.free(); 6510 - } 6511 - this.raw = void 0; 6512 - } 6513 - }; 6514 - 6515 - // ../node_modules/@dimforge/rapier2d/dynamics/island_manager.js 6516 - var IslandManager = class { 6517 - constructor(raw) { 6518 - this.raw = raw || new RawIslandManager(); 6519 - } 6520 - /** 6521 - * Release the WASM memory occupied by this narrow-phase. 6522 - */ 6523 - free() { 6524 - if (!!this.raw) { 6525 - this.raw.free(); 6526 - } 6527 - this.raw = void 0; 6528 - } 6529 - /** 6530 - * Applies the given closure to the handle of each active rigid-bodies contained by this set. 6531 - * 6532 - * A rigid-body is active if it is not sleeping, i.e., if it moved recently. 6533 - * 6534 - * @param f - The closure to apply. 6535 - */ 6536 - forEachActiveRigidBodyHandle(f) { 6537 - this.raw.forEachActiveRigidBodyHandle(f); 6538 - } 6539 - }; 6540 - 6541 - // ../node_modules/@dimforge/rapier2d/geometry/broad_phase.js 6542 - var BroadPhase = class { 6543 - constructor(raw) { 6544 - this.raw = raw || new RawBroadPhase(); 6545 - } 6546 - /** 6547 - * Release the WASM memory occupied by this broad-phase. 6548 - */ 6549 - free() { 6550 - if (!!this.raw) { 6551 - this.raw.free(); 6552 - } 6553 - this.raw = void 0; 6554 - } 6555 - }; 6556 - 6557 - // ../node_modules/@dimforge/rapier2d/geometry/narrow_phase.js 6558 - var NarrowPhase = class { 6559 - constructor(raw) { 6560 - this.raw = raw || new RawNarrowPhase(); 6561 - this.tempManifold = new TempContactManifold(null); 6562 - } 6563 - /** 6564 - * Release the WASM memory occupied by this narrow-phase. 6565 - */ 6566 - free() { 6567 - if (!!this.raw) { 6568 - this.raw.free(); 6569 - } 6570 - this.raw = void 0; 6571 - } 6572 - /** 6573 - * Enumerates all the colliders potentially in contact with the given collider. 6574 - * 6575 - * @param collider1 - The second collider involved in the contact. 6576 - * @param f - Closure that will be called on each collider that is in contact with `collider1`. 6577 - */ 6578 - contactPairsWith(collider1, f) { 6579 - this.raw.contact_pairs_with(collider1, f); 6580 - } 6581 - /** 6582 - * Enumerates all the colliders intersecting the given colliders, assuming one of them 6583 - * is a sensor. 6584 - */ 6585 - intersectionPairsWith(collider1, f) { 6586 - this.raw.intersection_pairs_with(collider1, f); 6587 - } 6588 - /** 6589 - * Iterates through all the contact manifolds between the given pair of colliders. 6590 - * 6591 - * @param collider1 - The first collider involved in the contact. 6592 - * @param collider2 - The second collider involved in the contact. 6593 - * @param f - Closure that will be called on each contact manifold between the two colliders. If the second argument 6594 - * passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1` 6595 - * actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`. 6596 - */ 6597 - contactPair(collider1, collider2, f) { 6598 - const rawPair = this.raw.contact_pair(collider1, collider2); 6599 - if (!!rawPair) { 6600 - const flipped = rawPair.collider1() != collider1; 6601 - let i; 6602 - for (i = 0; i < rawPair.numContactManifolds(); ++i) { 6603 - this.tempManifold.raw = rawPair.contactManifold(i); 6604 - if (!!this.tempManifold.raw) { 6605 - f(this.tempManifold, flipped); 6606 - } 6607 - this.tempManifold.free(); 6608 - } 6609 - rawPair.free(); 6610 - } 6611 - } 6612 - /** 6613 - * Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor. 6614 - * @param collider1 − The first collider involved in the intersection. 6615 - * @param collider2 − The second collider involved in the intersection. 6616 - */ 6617 - intersectionPair(collider1, collider2) { 6618 - return this.raw.intersection_pair(collider1, collider2); 6619 - } 6620 - }; 6621 - var TempContactManifold = class { 6622 - constructor(raw) { 6623 - this.raw = raw; 6624 - } 6625 - free() { 6626 - if (!!this.raw) { 6627 - this.raw.free(); 6628 - } 6629 - this.raw = void 0; 6630 - } 6631 - normal() { 6632 - return VectorOps.fromRaw(this.raw.normal()); 6633 - } 6634 - localNormal1() { 6635 - return VectorOps.fromRaw(this.raw.local_n1()); 6636 - } 6637 - localNormal2() { 6638 - return VectorOps.fromRaw(this.raw.local_n2()); 6639 - } 6640 - subshape1() { 6641 - return this.raw.subshape1(); 6642 - } 6643 - subshape2() { 6644 - return this.raw.subshape2(); 6645 - } 6646 - numContacts() { 6647 - return this.raw.num_contacts(); 6648 - } 6649 - localContactPoint1(i) { 6650 - return VectorOps.fromRaw(this.raw.contact_local_p1(i)); 6651 - } 6652 - localContactPoint2(i) { 6653 - return VectorOps.fromRaw(this.raw.contact_local_p2(i)); 6654 - } 6655 - contactDist(i) { 6656 - return this.raw.contact_dist(i); 6657 - } 6658 - contactFid1(i) { 6659 - return this.raw.contact_fid1(i); 6660 - } 6661 - contactFid2(i) { 6662 - return this.raw.contact_fid2(i); 6663 - } 6664 - contactImpulse(i) { 6665 - return this.raw.contact_impulse(i); 6666 - } 6667 - // #if DIM2 6668 - contactTangentImpulse(i) { 6669 - return this.raw.contact_tangent_impulse(i); 6670 - } 6671 - // #endif 6672 - numSolverContacts() { 6673 - return this.raw.num_solver_contacts(); 6674 - } 6675 - solverContactPoint(i) { 6676 - return VectorOps.fromRaw(this.raw.solver_contact_point(i)); 6677 - } 6678 - solverContactDist(i) { 6679 - return this.raw.solver_contact_dist(i); 6680 - } 6681 - solverContactFriction(i) { 6682 - return this.raw.solver_contact_friction(i); 6683 - } 6684 - solverContactRestitution(i) { 6685 - return this.raw.solver_contact_restitution(i); 6686 - } 6687 - solverContactTangentVelocity(i) { 6688 - return VectorOps.fromRaw(this.raw.solver_contact_tangent_velocity(i)); 6689 - } 6690 - }; 6691 - 6692 - // ../node_modules/@dimforge/rapier2d/geometry/contact.js 6693 - var ShapeContact = class _ShapeContact { 6694 - constructor(dist, point1, point2, normal1, normal2) { 6695 - this.distance = dist; 6696 - this.point1 = point1; 6697 - this.point2 = point2; 6698 - this.normal1 = normal1; 6699 - this.normal2 = normal2; 6700 - } 6701 - static fromRaw(raw) { 6702 - if (!raw) 6703 - return null; 6704 - const result = new _ShapeContact(raw.distance(), VectorOps.fromRaw(raw.point1()), VectorOps.fromRaw(raw.point2()), VectorOps.fromRaw(raw.normal1()), VectorOps.fromRaw(raw.normal2())); 6705 - raw.free(); 6706 - return result; 6707 - } 6708 - }; 6709 - 6710 - // ../node_modules/@dimforge/rapier2d/geometry/feature.js 6711 - var FeatureType; 6712 - (function(FeatureType2) { 6713 - FeatureType2[FeatureType2["Vertex"] = 0] = "Vertex"; 6714 - FeatureType2[FeatureType2["Face"] = 1] = "Face"; 6715 - FeatureType2[FeatureType2["Unknown"] = 2] = "Unknown"; 6716 - })(FeatureType || (FeatureType = {})); 6717 - 6718 - // ../node_modules/@dimforge/rapier2d/geometry/point.js 6719 - var PointProjection = class _PointProjection { 6720 - constructor(point, isInside) { 6721 - this.point = point; 6722 - this.isInside = isInside; 6723 - } 6724 - static fromRaw(raw) { 6725 - if (!raw) 6726 - return null; 6727 - const result = new _PointProjection(VectorOps.fromRaw(raw.point()), raw.isInside()); 6728 - raw.free(); 6729 - return result; 6730 - } 6731 - }; 6732 - var PointColliderProjection = class _PointColliderProjection { 6733 - constructor(collider, point, isInside, featureType, featureId) { 6734 - this.featureType = FeatureType.Unknown; 6735 - this.featureId = void 0; 6736 - this.collider = collider; 6737 - this.point = point; 6738 - this.isInside = isInside; 6739 - if (featureId !== void 0) 6740 - this.featureId = featureId; 6741 - if (featureType !== void 0) 6742 - this.featureType = featureType; 6743 - } 6744 - static fromRaw(colliderSet, raw) { 6745 - if (!raw) 6746 - return null; 6747 - const result = new _PointColliderProjection(colliderSet.get(raw.colliderHandle()), VectorOps.fromRaw(raw.point()), raw.isInside(), raw.featureType(), raw.featureId()); 6748 - raw.free(); 6749 - return result; 6750 - } 6751 - }; 6752 - 6753 - // ../node_modules/@dimforge/rapier2d/geometry/ray.js 6754 - var Ray = class { 6755 - /** 6756 - * Builds a ray from its origin and direction. 6757 - * 6758 - * @param origin - The ray's starting point. 6759 - * @param dir - The ray's direction of propagation. 6760 - */ 6761 - constructor(origin, dir) { 6762 - this.origin = origin; 6763 - this.dir = dir; 6764 - } 6765 - pointAt(t) { 6766 - return { 6767 - x: this.origin.x + this.dir.x * t, 6768 - y: this.origin.y + this.dir.y * t 6769 - }; 6770 - } 6771 - }; 6772 - var RayIntersection = class _RayIntersection { 6773 - constructor(timeOfImpact, normal, featureType, featureId) { 6774 - this.featureType = FeatureType.Unknown; 6775 - this.featureId = void 0; 6776 - this.timeOfImpact = timeOfImpact; 6777 - this.normal = normal; 6778 - if (featureId !== void 0) 6779 - this.featureId = featureId; 6780 - if (featureType !== void 0) 6781 - this.featureType = featureType; 6782 - } 6783 - static fromRaw(raw) { 6784 - if (!raw) 6785 - return null; 6786 - const result = new _RayIntersection(raw.time_of_impact(), VectorOps.fromRaw(raw.normal()), raw.featureType(), raw.featureId()); 6787 - raw.free(); 6788 - return result; 6789 - } 6790 - }; 6791 - var RayColliderIntersection = class _RayColliderIntersection { 6792 - constructor(collider, timeOfImpact, normal, featureType, featureId) { 6793 - this.featureType = FeatureType.Unknown; 6794 - this.featureId = void 0; 6795 - this.collider = collider; 6796 - this.timeOfImpact = timeOfImpact; 6797 - this.normal = normal; 6798 - if (featureId !== void 0) 6799 - this.featureId = featureId; 6800 - if (featureType !== void 0) 6801 - this.featureType = featureType; 6802 - } 6803 - static fromRaw(colliderSet, raw) { 6804 - if (!raw) 6805 - return null; 6806 - const result = new _RayColliderIntersection(colliderSet.get(raw.colliderHandle()), raw.time_of_impact(), VectorOps.fromRaw(raw.normal()), raw.featureType(), raw.featureId()); 6807 - raw.free(); 6808 - return result; 6809 - } 6810 - }; 6811 - var RayColliderHit = class _RayColliderHit { 6812 - constructor(collider, timeOfImpact) { 6813 - this.collider = collider; 6814 - this.timeOfImpact = timeOfImpact; 6815 - } 6816 - static fromRaw(colliderSet, raw) { 6817 - if (!raw) 6818 - return null; 6819 - const result = new _RayColliderHit(colliderSet.get(raw.colliderHandle()), raw.timeOfImpact()); 6820 - raw.free(); 6821 - return result; 6822 - } 6823 - }; 6824 - 6825 - // ../node_modules/@dimforge/rapier2d/geometry/toi.js 6826 - var ShapeCastHit = class _ShapeCastHit { 6827 - constructor(time_of_impact, witness1, witness2, normal1, normal2) { 6828 - this.time_of_impact = time_of_impact; 6829 - this.witness1 = witness1; 6830 - this.witness2 = witness2; 6831 - this.normal1 = normal1; 6832 - this.normal2 = normal2; 6833 - } 6834 - static fromRaw(colliderSet, raw) { 6835 - if (!raw) 6836 - return null; 6837 - const result = new _ShapeCastHit(raw.time_of_impact(), VectorOps.fromRaw(raw.witness1()), VectorOps.fromRaw(raw.witness2()), VectorOps.fromRaw(raw.normal1()), VectorOps.fromRaw(raw.normal2())); 6838 - raw.free(); 6839 - return result; 6840 - } 6841 - }; 6842 - var ColliderShapeCastHit = class _ColliderShapeCastHit extends ShapeCastHit { 6843 - constructor(collider, time_of_impact, witness1, witness2, normal1, normal2) { 6844 - super(time_of_impact, witness1, witness2, normal1, normal2); 6845 - this.collider = collider; 6846 - } 6847 - static fromRaw(colliderSet, raw) { 6848 - if (!raw) 6849 - return null; 6850 - 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())); 6851 - raw.free(); 6852 - return result; 6853 - } 6854 - }; 6855 - 6856 - // ../node_modules/@dimforge/rapier2d/geometry/shape.js 6857 - var Shape = class { 6858 - /** 6859 - * instant mode without cache 6860 - */ 6861 - static fromRaw(rawSet, handle) { 6862 - const rawType = rawSet.coShapeType(handle); 6863 - let extents; 6864 - let borderRadius; 6865 - let vs; 6866 - let indices; 6867 - let halfHeight; 6868 - let radius; 6869 - let normal; 6870 - switch (rawType) { 6871 - case RawShapeType.Ball: 6872 - return new Ball(rawSet.coRadius(handle)); 6873 - case RawShapeType.Cuboid: 6874 - extents = rawSet.coHalfExtents(handle); 6875 - return new Cuboid(extents.x, extents.y); 6876 - case RawShapeType.RoundCuboid: 6877 - extents = rawSet.coHalfExtents(handle); 6878 - borderRadius = rawSet.coRoundRadius(handle); 6879 - return new RoundCuboid(extents.x, extents.y, borderRadius); 6880 - case RawShapeType.Capsule: 6881 - halfHeight = rawSet.coHalfHeight(handle); 6882 - radius = rawSet.coRadius(handle); 6883 - return new Capsule(halfHeight, radius); 6884 - case RawShapeType.Segment: 6885 - vs = rawSet.coVertices(handle); 6886 - return new Segment(VectorOps.new(vs[0], vs[1]), VectorOps.new(vs[2], vs[3])); 6887 - case RawShapeType.Polyline: 6888 - vs = rawSet.coVertices(handle); 6889 - indices = rawSet.coIndices(handle); 6890 - return new Polyline(vs, indices); 6891 - case RawShapeType.Triangle: 6892 - vs = rawSet.coVertices(handle); 6893 - return new Triangle(VectorOps.new(vs[0], vs[1]), VectorOps.new(vs[2], vs[3]), VectorOps.new(vs[4], vs[5])); 6894 - case RawShapeType.RoundTriangle: 6895 - vs = rawSet.coVertices(handle); 6896 - borderRadius = rawSet.coRoundRadius(handle); 6897 - return new RoundTriangle(VectorOps.new(vs[0], vs[1]), VectorOps.new(vs[2], vs[3]), VectorOps.new(vs[4], vs[5]), borderRadius); 6898 - case RawShapeType.HalfSpace: 6899 - normal = VectorOps.fromRaw(rawSet.coHalfspaceNormal(handle)); 6900 - return new HalfSpace(normal); 6901 - case RawShapeType.TriMesh: 6902 - vs = rawSet.coVertices(handle); 6903 - indices = rawSet.coIndices(handle); 6904 - const tri_flags = rawSet.coTriMeshFlags(handle); 6905 - return new TriMesh(vs, indices, tri_flags); 6906 - case RawShapeType.HeightField: 6907 - const scale = rawSet.coHeightfieldScale(handle); 6908 - const heights = rawSet.coHeightfieldHeights(handle); 6909 - return new Heightfield(heights, scale); 6910 - case RawShapeType.ConvexPolygon: 6911 - vs = rawSet.coVertices(handle); 6912 - return new ConvexPolygon(vs, false); 6913 - case RawShapeType.RoundConvexPolygon: 6914 - vs = rawSet.coVertices(handle); 6915 - borderRadius = rawSet.coRoundRadius(handle); 6916 - return new RoundConvexPolygon(vs, borderRadius, false); 6917 - default: 6918 - throw new Error("unknown shape type: " + rawType); 6919 - } 6920 - } 6921 - /** 6922 - * Computes the time of impact between two moving shapes. 6923 - * @param shapePos1 - The initial position of this sahpe. 6924 - * @param shapeRot1 - The rotation of this shape. 6925 - * @param shapeVel1 - The velocity of this shape. 6926 - * @param shape2 - The second moving shape. 6927 - * @param shapePos2 - The initial position of the second shape. 6928 - * @param shapeRot2 - The rotation of the second shape. 6929 - * @param shapeVel2 - The velocity of the second shape. 6930 - * @param targetDistance − If the shape moves closer to this distance from a collider, a hit 6931 - * will be returned. 6932 - * @param maxToi - The maximum time when the impact can happen. 6933 - * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if 6934 - * the shape is penetrating another shape at its starting point **and** its trajectory is such 6935 - * that it’s on a path to exist that penetration state. 6936 - * @returns If the two moving shapes collider at some point along their trajectories, this returns the 6937 - * time at which the two shape collider as well as the contact information during the impact. Returns 6938 - * `null`if the two shapes never collide along their paths. 6939 - */ 6940 - castShape(shapePos1, shapeRot1, shapeVel1, shape2, shapePos2, shapeRot2, shapeVel2, targetDistance, maxToi, stopAtPenetration) { 6941 - let rawPos1 = VectorOps.intoRaw(shapePos1); 6942 - let rawRot1 = RotationOps.intoRaw(shapeRot1); 6943 - let rawVel1 = VectorOps.intoRaw(shapeVel1); 6944 - let rawPos2 = VectorOps.intoRaw(shapePos2); 6945 - let rawRot2 = RotationOps.intoRaw(shapeRot2); 6946 - let rawVel2 = VectorOps.intoRaw(shapeVel2); 6947 - let rawShape1 = this.intoRaw(); 6948 - let rawShape2 = shape2.intoRaw(); 6949 - let result = ShapeCastHit.fromRaw(null, rawShape1.castShape(rawPos1, rawRot1, rawVel1, rawShape2, rawPos2, rawRot2, rawVel2, targetDistance, maxToi, stopAtPenetration)); 6950 - rawPos1.free(); 6951 - rawRot1.free(); 6952 - rawVel1.free(); 6953 - rawPos2.free(); 6954 - rawRot2.free(); 6955 - rawVel2.free(); 6956 - rawShape1.free(); 6957 - rawShape2.free(); 6958 - return result; 6959 - } 6960 - /** 6961 - * Tests if this shape intersects another shape. 6962 - * 6963 - * @param shapePos1 - The position of this shape. 6964 - * @param shapeRot1 - The rotation of this shape. 6965 - * @param shape2 - The second shape to test. 6966 - * @param shapePos2 - The position of the second shape. 6967 - * @param shapeRot2 - The rotation of the second shape. 6968 - * @returns `true` if the two shapes intersect, `false` if they don’t. 6969 - */ 6970 - intersectsShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2) { 6971 - let rawPos1 = VectorOps.intoRaw(shapePos1); 6972 - let rawRot1 = RotationOps.intoRaw(shapeRot1); 6973 - let rawPos2 = VectorOps.intoRaw(shapePos2); 6974 - let rawRot2 = RotationOps.intoRaw(shapeRot2); 6975 - let rawShape1 = this.intoRaw(); 6976 - let rawShape2 = shape2.intoRaw(); 6977 - let result = rawShape1.intersectsShape(rawPos1, rawRot1, rawShape2, rawPos2, rawRot2); 6978 - rawPos1.free(); 6979 - rawRot1.free(); 6980 - rawPos2.free(); 6981 - rawRot2.free(); 6982 - rawShape1.free(); 6983 - rawShape2.free(); 6984 - return result; 6985 - } 6986 - /** 6987 - * Computes one pair of contact points between two shapes. 6988 - * 6989 - * @param shapePos1 - The initial position of this sahpe. 6990 - * @param shapeRot1 - The rotation of this shape. 6991 - * @param shape2 - The second shape. 6992 - * @param shapePos2 - The initial position of the second shape. 6993 - * @param shapeRot2 - The rotation of the second shape. 6994 - * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail. 6995 - * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space. 6996 - */ 6997 - contactShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2, prediction) { 6998 - let rawPos1 = VectorOps.intoRaw(shapePos1); 6999 - let rawRot1 = RotationOps.intoRaw(shapeRot1); 7000 - let rawPos2 = VectorOps.intoRaw(shapePos2); 7001 - let rawRot2 = RotationOps.intoRaw(shapeRot2); 7002 - let rawShape1 = this.intoRaw(); 7003 - let rawShape2 = shape2.intoRaw(); 7004 - let result = ShapeContact.fromRaw(rawShape1.contactShape(rawPos1, rawRot1, rawShape2, rawPos2, rawRot2, prediction)); 7005 - rawPos1.free(); 7006 - rawRot1.free(); 7007 - rawPos2.free(); 7008 - rawRot2.free(); 7009 - rawShape1.free(); 7010 - rawShape2.free(); 7011 - return result; 7012 - } 7013 - containsPoint(shapePos, shapeRot, point) { 7014 - let rawPos = VectorOps.intoRaw(shapePos); 7015 - let rawRot = RotationOps.intoRaw(shapeRot); 7016 - let rawPoint = VectorOps.intoRaw(point); 7017 - let rawShape = this.intoRaw(); 7018 - let result = rawShape.containsPoint(rawPos, rawRot, rawPoint); 7019 - rawPos.free(); 7020 - rawRot.free(); 7021 - rawPoint.free(); 7022 - rawShape.free(); 7023 - return result; 7024 - } 7025 - projectPoint(shapePos, shapeRot, point, solid) { 7026 - let rawPos = VectorOps.intoRaw(shapePos); 7027 - let rawRot = RotationOps.intoRaw(shapeRot); 7028 - let rawPoint = VectorOps.intoRaw(point); 7029 - let rawShape = this.intoRaw(); 7030 - let result = PointProjection.fromRaw(rawShape.projectPoint(rawPos, rawRot, rawPoint, solid)); 7031 - rawPos.free(); 7032 - rawRot.free(); 7033 - rawPoint.free(); 7034 - rawShape.free(); 7035 - return result; 7036 - } 7037 - intersectsRay(ray, shapePos, shapeRot, maxToi) { 7038 - let rawPos = VectorOps.intoRaw(shapePos); 7039 - let rawRot = RotationOps.intoRaw(shapeRot); 7040 - let rawRayOrig = VectorOps.intoRaw(ray.origin); 7041 - let rawRayDir = VectorOps.intoRaw(ray.dir); 7042 - let rawShape = this.intoRaw(); 7043 - let result = rawShape.intersectsRay(rawPos, rawRot, rawRayOrig, rawRayDir, maxToi); 7044 - rawPos.free(); 7045 - rawRot.free(); 7046 - rawRayOrig.free(); 7047 - rawRayDir.free(); 7048 - rawShape.free(); 7049 - return result; 7050 - } 7051 - castRay(ray, shapePos, shapeRot, maxToi, solid) { 7052 - let rawPos = VectorOps.intoRaw(shapePos); 7053 - let rawRot = RotationOps.intoRaw(shapeRot); 7054 - let rawRayOrig = VectorOps.intoRaw(ray.origin); 7055 - let rawRayDir = VectorOps.intoRaw(ray.dir); 7056 - let rawShape = this.intoRaw(); 7057 - let result = rawShape.castRay(rawPos, rawRot, rawRayOrig, rawRayDir, maxToi, solid); 7058 - rawPos.free(); 7059 - rawRot.free(); 7060 - rawRayOrig.free(); 7061 - rawRayDir.free(); 7062 - rawShape.free(); 7063 - return result; 7064 - } 7065 - castRayAndGetNormal(ray, shapePos, shapeRot, maxToi, solid) { 7066 - let rawPos = VectorOps.intoRaw(shapePos); 7067 - let rawRot = RotationOps.intoRaw(shapeRot); 7068 - let rawRayOrig = VectorOps.intoRaw(ray.origin); 7069 - let rawRayDir = VectorOps.intoRaw(ray.dir); 7070 - let rawShape = this.intoRaw(); 7071 - let result = RayIntersection.fromRaw(rawShape.castRayAndGetNormal(rawPos, rawRot, rawRayOrig, rawRayDir, maxToi, solid)); 7072 - rawPos.free(); 7073 - rawRot.free(); 7074 - rawRayOrig.free(); 7075 - rawRayDir.free(); 7076 - rawShape.free(); 7077 - return result; 7078 - } 7079 - }; 7080 - var ShapeType; 7081 - (function(ShapeType2) { 7082 - ShapeType2[ShapeType2["Ball"] = 0] = "Ball"; 7083 - ShapeType2[ShapeType2["Cuboid"] = 1] = "Cuboid"; 7084 - ShapeType2[ShapeType2["Capsule"] = 2] = "Capsule"; 7085 - ShapeType2[ShapeType2["Segment"] = 3] = "Segment"; 7086 - ShapeType2[ShapeType2["Polyline"] = 4] = "Polyline"; 7087 - ShapeType2[ShapeType2["Triangle"] = 5] = "Triangle"; 7088 - ShapeType2[ShapeType2["TriMesh"] = 6] = "TriMesh"; 7089 - ShapeType2[ShapeType2["HeightField"] = 7] = "HeightField"; 7090 - ShapeType2[ShapeType2["ConvexPolygon"] = 9] = "ConvexPolygon"; 7091 - ShapeType2[ShapeType2["RoundCuboid"] = 10] = "RoundCuboid"; 7092 - ShapeType2[ShapeType2["RoundTriangle"] = 11] = "RoundTriangle"; 7093 - ShapeType2[ShapeType2["RoundConvexPolygon"] = 12] = "RoundConvexPolygon"; 7094 - ShapeType2[ShapeType2["HalfSpace"] = 13] = "HalfSpace"; 7095 - })(ShapeType || (ShapeType = {})); 7096 - var TriMeshFlags; 7097 - (function(TriMeshFlags2) { 7098 - TriMeshFlags2[TriMeshFlags2["DELETE_BAD_TOPOLOGY_TRIANGLES"] = 4] = "DELETE_BAD_TOPOLOGY_TRIANGLES"; 7099 - TriMeshFlags2[TriMeshFlags2["ORIENTED"] = 8] = "ORIENTED"; 7100 - TriMeshFlags2[TriMeshFlags2["MERGE_DUPLICATE_VERTICES"] = 16] = "MERGE_DUPLICATE_VERTICES"; 7101 - TriMeshFlags2[TriMeshFlags2["DELETE_DEGENERATE_TRIANGLES"] = 32] = "DELETE_DEGENERATE_TRIANGLES"; 7102 - TriMeshFlags2[TriMeshFlags2["DELETE_DUPLICATE_TRIANGLES"] = 64] = "DELETE_DUPLICATE_TRIANGLES"; 7103 - TriMeshFlags2[TriMeshFlags2["FIX_INTERNAL_EDGES"] = 152] = "FIX_INTERNAL_EDGES"; 7104 - })(TriMeshFlags || (TriMeshFlags = {})); 7105 - var Ball = class extends Shape { 7106 - /** 7107 - * Creates a new ball with the given radius. 7108 - * @param radius - The balls radius. 7109 - */ 7110 - constructor(radius) { 7111 - super(); 7112 - this.type = ShapeType.Ball; 7113 - this.radius = radius; 7114 - } 7115 - intoRaw() { 7116 - return RawShape.ball(this.radius); 7117 - } 7118 - }; 7119 - var HalfSpace = class extends Shape { 7120 - /** 7121 - * Creates a new halfspace delimited by an infinite plane. 7122 - * 7123 - * @param normal - The outward normal of the plane. 7124 - */ 7125 - constructor(normal) { 7126 - super(); 7127 - this.type = ShapeType.HalfSpace; 7128 - this.normal = normal; 7129 - } 7130 - intoRaw() { 7131 - let n = VectorOps.intoRaw(this.normal); 7132 - let result = RawShape.halfspace(n); 7133 - n.free(); 7134 - return result; 7135 - } 7136 - }; 7137 - var Cuboid = class extends Shape { 7138 - // #if DIM2 7139 - /** 7140 - * Creates a new 2D rectangle. 7141 - * @param hx - The half width of the rectangle. 7142 - * @param hy - The helf height of the rectangle. 7143 - */ 7144 - constructor(hx, hy) { 7145 - super(); 7146 - this.type = ShapeType.Cuboid; 7147 - this.halfExtents = VectorOps.new(hx, hy); 7148 - } 7149 - // #endif 7150 - intoRaw() { 7151 - return RawShape.cuboid(this.halfExtents.x, this.halfExtents.y); 7152 - } 7153 - }; 7154 - var RoundCuboid = class extends Shape { 7155 - // #if DIM2 7156 - /** 7157 - * Creates a new 2D rectangle. 7158 - * @param hx - The half width of the rectangle. 7159 - * @param hy - The helf height of the rectangle. 7160 - * @param borderRadius - The radius of the borders of this cuboid. This will 7161 - * effectively increase the half-extents of the cuboid by this radius. 7162 - */ 7163 - constructor(hx, hy, borderRadius) { 7164 - super(); 7165 - this.type = ShapeType.RoundCuboid; 7166 - this.halfExtents = VectorOps.new(hx, hy); 7167 - this.borderRadius = borderRadius; 7168 - } 7169 - // #endif 7170 - intoRaw() { 7171 - return RawShape.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius); 7172 - } 7173 - }; 7174 - var Capsule = class extends Shape { 7175 - /** 7176 - * Creates a new capsule with the given radius and half-height. 7177 - * @param halfHeight - The balls half-height along the `y` axis. 7178 - * @param radius - The balls radius. 7179 - */ 7180 - constructor(halfHeight, radius) { 7181 - super(); 7182 - this.type = ShapeType.Capsule; 7183 - this.halfHeight = halfHeight; 7184 - this.radius = radius; 7185 - } 7186 - intoRaw() { 7187 - return RawShape.capsule(this.halfHeight, this.radius); 7188 - } 7189 - }; 7190 - var Segment = class extends Shape { 7191 - /** 7192 - * Creates a new segment shape. 7193 - * @param a - The first point of the segment. 7194 - * @param b - The second point of the segment. 7195 - */ 7196 - constructor(a, b) { 7197 - super(); 7198 - this.type = ShapeType.Segment; 7199 - this.a = a; 7200 - this.b = b; 7201 - } 7202 - intoRaw() { 7203 - let ra = VectorOps.intoRaw(this.a); 7204 - let rb = VectorOps.intoRaw(this.b); 7205 - let result = RawShape.segment(ra, rb); 7206 - ra.free(); 7207 - rb.free(); 7208 - return result; 7209 - } 7210 - }; 7211 - var Triangle = class extends Shape { 7212 - /** 7213 - * Creates a new triangle shape. 7214 - * 7215 - * @param a - The first point of the triangle. 7216 - * @param b - The second point of the triangle. 7217 - * @param c - The third point of the triangle. 7218 - */ 7219 - constructor(a, b, c) { 7220 - super(); 7221 - this.type = ShapeType.Triangle; 7222 - this.a = a; 7223 - this.b = b; 7224 - this.c = c; 7225 - } 7226 - intoRaw() { 7227 - let ra = VectorOps.intoRaw(this.a); 7228 - let rb = VectorOps.intoRaw(this.b); 7229 - let rc = VectorOps.intoRaw(this.c); 7230 - let result = RawShape.triangle(ra, rb, rc); 7231 - ra.free(); 7232 - rb.free(); 7233 - rc.free(); 7234 - return result; 7235 - } 7236 - }; 7237 - var RoundTriangle = class extends Shape { 7238 - /** 7239 - * Creates a new triangle shape with round corners. 7240 - * 7241 - * @param a - The first point of the triangle. 7242 - * @param b - The second point of the triangle. 7243 - * @param c - The third point of the triangle. 7244 - * @param borderRadius - The radius of the borders of this triangle. In 3D, 7245 - * this is also equal to half the thickness of the triangle. 7246 - */ 7247 - constructor(a, b, c, borderRadius) { 7248 - super(); 7249 - this.type = ShapeType.RoundTriangle; 7250 - this.a = a; 7251 - this.b = b; 7252 - this.c = c; 7253 - this.borderRadius = borderRadius; 7254 - } 7255 - intoRaw() { 7256 - let ra = VectorOps.intoRaw(this.a); 7257 - let rb = VectorOps.intoRaw(this.b); 7258 - let rc = VectorOps.intoRaw(this.c); 7259 - let result = RawShape.roundTriangle(ra, rb, rc, this.borderRadius); 7260 - ra.free(); 7261 - rb.free(); 7262 - rc.free(); 7263 - return result; 7264 - } 7265 - }; 7266 - var Polyline = class extends Shape { 7267 - /** 7268 - * Creates a new polyline shape. 7269 - * 7270 - * @param vertices - The coordinates of the polyline's vertices. 7271 - * @param indices - The indices of the polyline's segments. If this is `null` or not provided, then 7272 - * the vertices are assumed to form a line strip. 7273 - */ 7274 - constructor(vertices, indices) { 7275 - super(); 7276 - this.type = ShapeType.Polyline; 7277 - this.vertices = vertices; 7278 - this.indices = indices !== null && indices !== void 0 ? indices : new Uint32Array(0); 7279 - } 7280 - intoRaw() { 7281 - return RawShape.polyline(this.vertices, this.indices); 7282 - } 7283 - }; 7284 - var TriMesh = class extends Shape { 7285 - /** 7286 - * Creates a new triangle mesh shape. 7287 - * 7288 - * @param vertices - The coordinates of the triangle mesh's vertices. 7289 - * @param indices - The indices of the triangle mesh's triangles. 7290 - */ 7291 - constructor(vertices, indices, flags) { 7292 - super(); 7293 - this.type = ShapeType.TriMesh; 7294 - this.vertices = vertices; 7295 - this.indices = indices; 7296 - this.flags = flags; 7297 - } 7298 - intoRaw() { 7299 - return RawShape.trimesh(this.vertices, this.indices, this.flags); 7300 - } 7301 - }; 7302 - var ConvexPolygon = class extends Shape { 7303 - /** 7304 - * Creates a new convex polygon shape. 7305 - * 7306 - * @param vertices - The coordinates of the convex polygon's vertices. 7307 - * @param skipConvexHullComputation - If set to `true`, the input points will 7308 - * be assumed to form a convex polyline and no convex-hull computation will 7309 - * be done automatically. 7310 - */ 7311 - constructor(vertices, skipConvexHullComputation) { 7312 - super(); 7313 - this.type = ShapeType.ConvexPolygon; 7314 - this.vertices = vertices; 7315 - this.skipConvexHullComputation = !!skipConvexHullComputation; 7316 - } 7317 - intoRaw() { 7318 - if (this.skipConvexHullComputation) { 7319 - return RawShape.convexPolyline(this.vertices); 7320 - } else { 7321 - return RawShape.convexHull(this.vertices); 7322 - } 7323 - } 7324 - }; 7325 - var RoundConvexPolygon = class extends Shape { 7326 - /** 7327 - * Creates a new convex polygon shape. 7328 - * 7329 - * @param vertices - The coordinates of the convex polygon's vertices. 7330 - * @param borderRadius - The radius of the borders of this convex polygon. 7331 - * @param skipConvexHullComputation - If set to `true`, the input points will 7332 - * be assumed to form a convex polyline and no convex-hull computation will 7333 - * be done automatically. 7334 - */ 7335 - constructor(vertices, borderRadius, skipConvexHullComputation) { 7336 - super(); 7337 - this.type = ShapeType.RoundConvexPolygon; 7338 - this.vertices = vertices; 7339 - this.borderRadius = borderRadius; 7340 - this.skipConvexHullComputation = !!skipConvexHullComputation; 7341 - } 7342 - intoRaw() { 7343 - if (this.skipConvexHullComputation) { 7344 - return RawShape.roundConvexPolyline(this.vertices, this.borderRadius); 7345 - } else { 7346 - return RawShape.roundConvexHull(this.vertices, this.borderRadius); 7347 - } 7348 - } 7349 - }; 7350 - var Heightfield = class extends Shape { 7351 - /** 7352 - * Creates a new heightfield shape. 7353 - * 7354 - * @param heights - The heights of the heightfield, along its local `y` axis. 7355 - * @param scale - The scale factor applied to the heightfield. 7356 - */ 7357 - constructor(heights, scale) { 7358 - super(); 7359 - this.type = ShapeType.HeightField; 7360 - this.heights = heights; 7361 - this.scale = scale; 7362 - } 7363 - intoRaw() { 7364 - let rawScale = VectorOps.intoRaw(this.scale); 7365 - let rawShape = RawShape.heightfield(this.heights, rawScale); 7366 - rawScale.free(); 7367 - return rawShape; 7368 - } 7369 - }; 7370 - 7371 - // ../node_modules/@dimforge/rapier2d/pipeline/physics_pipeline.js 7372 - var PhysicsPipeline = class { 7373 - constructor(raw) { 7374 - this.raw = raw || new RawPhysicsPipeline(); 7375 - } 7376 - free() { 7377 - if (!!this.raw) { 7378 - this.raw.free(); 7379 - } 7380 - this.raw = void 0; 7381 - } 7382 - step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulseJoints, multibodyJoints, ccdSolver, eventQueue, hooks) { 7383 - let rawG = VectorOps.intoRaw(gravity); 7384 - if (!!eventQueue) { 7385 - 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); 7386 - } else { 7387 - this.raw.step(rawG, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw, ccdSolver.raw); 7388 - } 7389 - rawG.free(); 7390 - } 7391 - }; 7392 - 7393 - // ../node_modules/@dimforge/rapier2d/pipeline/query_pipeline.js 7394 - var QueryFilterFlags; 7395 - (function(QueryFilterFlags2) { 7396 - QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_FIXED"] = 1] = "EXCLUDE_FIXED"; 7397 - QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_KINEMATIC"] = 2] = "EXCLUDE_KINEMATIC"; 7398 - QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_DYNAMIC"] = 4] = "EXCLUDE_DYNAMIC"; 7399 - QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_SENSORS"] = 8] = "EXCLUDE_SENSORS"; 7400 - QueryFilterFlags2[QueryFilterFlags2["EXCLUDE_SOLIDS"] = 16] = "EXCLUDE_SOLIDS"; 7401 - QueryFilterFlags2[QueryFilterFlags2["ONLY_DYNAMIC"] = 3] = "ONLY_DYNAMIC"; 7402 - QueryFilterFlags2[QueryFilterFlags2["ONLY_KINEMATIC"] = 5] = "ONLY_KINEMATIC"; 7403 - QueryFilterFlags2[QueryFilterFlags2["ONLY_FIXED"] = 6] = "ONLY_FIXED"; 7404 - })(QueryFilterFlags || (QueryFilterFlags = {})); 7405 - var QueryPipeline = class { 7406 - constructor(raw) { 7407 - this.raw = raw || new RawQueryPipeline(); 7408 - } 7409 - /** 7410 - * Release the WASM memory occupied by this query pipeline. 7411 - */ 7412 - free() { 7413 - if (!!this.raw) { 7414 - this.raw.free(); 7415 - } 7416 - this.raw = void 0; 7417 - } 7418 - /** 7419 - * Updates the acceleration structure of the query pipeline. 7420 - * @param bodies - The set of rigid-bodies taking part in this pipeline. 7421 - * @param colliders - The set of colliders taking part in this pipeline. 7422 - */ 7423 - update(bodies, colliders) { 7424 - this.raw.update(bodies.raw, colliders.raw); 7425 - } 7426 - /** 7427 - * Find the closest intersection between a ray and a set of collider. 7428 - * 7429 - * @param colliders - The set of colliders taking part in this pipeline. 7430 - * @param ray - The ray to cast. 7431 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 7432 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 7433 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 7434 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 7435 - * whereas `false` implies that all shapes are hollow for this ray-cast. 7436 - * @param groups - Used to filter the colliders that can or cannot be hit by the ray. 7437 - * @param filter - The callback to filter out which collider will be hit. 7438 - */ 7439 - castRay(bodies, colliders, ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7440 - let rawOrig = VectorOps.intoRaw(ray.origin); 7441 - let rawDir = VectorOps.intoRaw(ray.dir); 7442 - let result = RayColliderHit.fromRaw(colliders, this.raw.castRay(bodies.raw, colliders.raw, rawOrig, rawDir, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate)); 7443 - rawOrig.free(); 7444 - rawDir.free(); 7445 - return result; 7446 - } 7447 - /** 7448 - * Find the closest intersection between a ray and a set of collider. 7449 - * 7450 - * This also computes the normal at the hit point. 7451 - * @param colliders - The set of colliders taking part in this pipeline. 7452 - * @param ray - The ray to cast. 7453 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 7454 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 7455 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 7456 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 7457 - * whereas `false` implies that all shapes are hollow for this ray-cast. 7458 - * @param groups - Used to filter the colliders that can or cannot be hit by the ray. 7459 - */ 7460 - castRayAndGetNormal(bodies, colliders, ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7461 - let rawOrig = VectorOps.intoRaw(ray.origin); 7462 - let rawDir = VectorOps.intoRaw(ray.dir); 7463 - let result = RayColliderIntersection.fromRaw(colliders, this.raw.castRayAndGetNormal(bodies.raw, colliders.raw, rawOrig, rawDir, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate)); 7464 - rawOrig.free(); 7465 - rawDir.free(); 7466 - return result; 7467 - } 7468 - /** 7469 - * Cast a ray and collects all the intersections between a ray and the scene. 7470 - * 7471 - * @param colliders - The set of colliders taking part in this pipeline. 7472 - * @param ray - The ray to cast. 7473 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 7474 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 7475 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 7476 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 7477 - * whereas `false` implies that all shapes are hollow for this ray-cast. 7478 - * @param groups - Used to filter the colliders that can or cannot be hit by the ray. 7479 - * @param callback - The callback called once per hit (in no particular order) between a ray and a collider. 7480 - * If this callback returns `false`, then the cast will stop and no further hits will be detected/reported. 7481 - */ 7482 - intersectionsWithRay(bodies, colliders, ray, maxToi, solid, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7483 - let rawOrig = VectorOps.intoRaw(ray.origin); 7484 - let rawDir = VectorOps.intoRaw(ray.dir); 7485 - let rawCallback = (rawInter) => { 7486 - return callback(RayColliderIntersection.fromRaw(colliders, rawInter)); 7487 - }; 7488 - this.raw.intersectionsWithRay(bodies.raw, colliders.raw, rawOrig, rawDir, maxToi, solid, rawCallback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate); 7489 - rawOrig.free(); 7490 - rawDir.free(); 7491 - } 7492 - /** 7493 - * Gets the handle of up to one collider intersecting the given shape. 7494 - * 7495 - * @param colliders - The set of colliders taking part in this pipeline. 7496 - * @param shapePos - The position of the shape used for the intersection test. 7497 - * @param shapeRot - The orientation of the shape used for the intersection test. 7498 - * @param shape - The shape used for the intersection test. 7499 - * @param groups - The bit groups and filter associated to the ray, in order to only 7500 - * hit the colliders with collision groups compatible with the ray's group. 7501 - */ 7502 - intersectionWithShape(bodies, colliders, shapePos, shapeRot, shape, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7503 - let rawPos = VectorOps.intoRaw(shapePos); 7504 - let rawRot = RotationOps.intoRaw(shapeRot); 7505 - let rawShape = shape.intoRaw(); 7506 - let result = this.raw.intersectionWithShape(bodies.raw, colliders.raw, rawPos, rawRot, rawShape, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate); 7507 - rawPos.free(); 7508 - rawRot.free(); 7509 - rawShape.free(); 7510 - return result; 7511 - } 7512 - /** 7513 - * Find the projection of a point on the closest collider. 7514 - * 7515 - * @param colliders - The set of colliders taking part in this pipeline. 7516 - * @param point - The point to project. 7517 - * @param solid - If this is set to `true` then the collider shapes are considered to 7518 - * be plain (if the point is located inside of a plain shape, its projection is the point 7519 - * itself). If it is set to `false` the collider shapes are considered to be hollow 7520 - * (if the point is located inside of an hollow shape, it is projected on the shape's 7521 - * boundary). 7522 - * @param groups - The bit groups and filter associated to the point to project, in order to only 7523 - * project on colliders with collision groups compatible with the ray's group. 7524 - */ 7525 - projectPoint(bodies, colliders, point, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7526 - let rawPoint = VectorOps.intoRaw(point); 7527 - let result = PointColliderProjection.fromRaw(colliders, this.raw.projectPoint(bodies.raw, colliders.raw, rawPoint, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate)); 7528 - rawPoint.free(); 7529 - return result; 7530 - } 7531 - /** 7532 - * Find the projection of a point on the closest collider. 7533 - * 7534 - * @param colliders - The set of colliders taking part in this pipeline. 7535 - * @param point - The point to project. 7536 - * @param groups - The bit groups and filter associated to the point to project, in order to only 7537 - * project on colliders with collision groups compatible with the ray's group. 7538 - */ 7539 - projectPointAndGetFeature(bodies, colliders, point, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7540 - let rawPoint = VectorOps.intoRaw(point); 7541 - let result = PointColliderProjection.fromRaw(colliders, this.raw.projectPointAndGetFeature(bodies.raw, colliders.raw, rawPoint, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate)); 7542 - rawPoint.free(); 7543 - return result; 7544 - } 7545 - /** 7546 - * Find all the colliders containing the given point. 7547 - * 7548 - * @param colliders - The set of colliders taking part in this pipeline. 7549 - * @param point - The point used for the containment test. 7550 - * @param groups - The bit groups and filter associated to the point to test, in order to only 7551 - * test on colliders with collision groups compatible with the ray's group. 7552 - * @param callback - A function called with the handles of each collider with a shape 7553 - * containing the `point`. 7554 - */ 7555 - intersectionsWithPoint(bodies, colliders, point, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7556 - let rawPoint = VectorOps.intoRaw(point); 7557 - this.raw.intersectionsWithPoint(bodies.raw, colliders.raw, rawPoint, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate); 7558 - rawPoint.free(); 7559 - } 7560 - /** 7561 - * Casts a shape at a constant linear velocity and retrieve the first collider it hits. 7562 - * This is similar to ray-casting except that we are casting a whole shape instead of 7563 - * just a point (the ray origin). 7564 - * 7565 - * @param colliders - The set of colliders taking part in this pipeline. 7566 - * @param shapePos - The initial position of the shape to cast. 7567 - * @param shapeRot - The initial rotation of the shape to cast. 7568 - * @param shapeVel - The constant velocity of the shape to cast (i.e. the cast direction). 7569 - * @param shape - The shape to cast. 7570 - * @param targetDistance − If the shape moves closer to this distance from a collider, a hit 7571 - * will be returned. 7572 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 7573 - * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`. 7574 - * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if 7575 - * the shape is penetrating another shape at its starting point **and** its trajectory is such 7576 - * that it’s on a path to exist that penetration state. 7577 - * @param groups - The bit groups and filter associated to the shape to cast, in order to only 7578 - * test on colliders with collision groups compatible with this group. 7579 - */ 7580 - castShape(bodies, colliders, shapePos, shapeRot, shapeVel, shape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7581 - let rawPos = VectorOps.intoRaw(shapePos); 7582 - let rawRot = RotationOps.intoRaw(shapeRot); 7583 - let rawVel = VectorOps.intoRaw(shapeVel); 7584 - let rawShape = shape.intoRaw(); 7585 - let result = ColliderShapeCastHit.fromRaw(colliders, this.raw.castShape(bodies.raw, colliders.raw, rawPos, rawRot, rawVel, rawShape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate)); 7586 - rawPos.free(); 7587 - rawRot.free(); 7588 - rawVel.free(); 7589 - rawShape.free(); 7590 - return result; 7591 - } 7592 - /** 7593 - * Retrieve all the colliders intersecting the given shape. 7594 - * 7595 - * @param colliders - The set of colliders taking part in this pipeline. 7596 - * @param shapePos - The position of the shape to test. 7597 - * @param shapeRot - The orientation of the shape to test. 7598 - * @param shape - The shape to test. 7599 - * @param groups - The bit groups and filter associated to the shape to test, in order to only 7600 - * test on colliders with collision groups compatible with this group. 7601 - * @param callback - A function called with the handles of each collider intersecting the `shape`. 7602 - */ 7603 - intersectionsWithShape(bodies, colliders, shapePos, shapeRot, shape, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 7604 - let rawPos = VectorOps.intoRaw(shapePos); 7605 - let rawRot = RotationOps.intoRaw(shapeRot); 7606 - let rawShape = shape.intoRaw(); 7607 - this.raw.intersectionsWithShape(bodies.raw, colliders.raw, rawPos, rawRot, rawShape, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate); 7608 - rawPos.free(); 7609 - rawRot.free(); 7610 - rawShape.free(); 7611 - } 7612 - /** 7613 - * Finds the handles of all the colliders with an AABB intersecting the given AABB. 7614 - * 7615 - * @param aabbCenter - The center of the AABB to test. 7616 - * @param aabbHalfExtents - The half-extents of the AABB to test. 7617 - * @param callback - The callback that will be called with the handles of all the colliders 7618 - * currently intersecting the given AABB. 7619 - */ 7620 - collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) { 7621 - let rawCenter = VectorOps.intoRaw(aabbCenter); 7622 - let rawHalfExtents = VectorOps.intoRaw(aabbHalfExtents); 7623 - this.raw.collidersWithAabbIntersectingAabb(rawCenter, rawHalfExtents, callback); 7624 - rawCenter.free(); 7625 - rawHalfExtents.free(); 7626 - } 7627 - }; 7628 - 7629 - // ../node_modules/@dimforge/rapier2d/pipeline/serialization_pipeline.js 7630 - var SerializationPipeline = class { 7631 - constructor(raw) { 7632 - this.raw = raw || new RawSerializationPipeline(); 7633 - } 7634 - /** 7635 - * Release the WASM memory occupied by this serialization pipeline. 7636 - */ 7637 - free() { 7638 - if (!!this.raw) { 7639 - this.raw.free(); 7640 - } 7641 - this.raw = void 0; 7642 - } 7643 - /** 7644 - * Serialize a complete physics state into a single byte array. 7645 - * @param gravity - The current gravity affecting the simulation. 7646 - * @param integrationParameters - The integration parameters of the simulation. 7647 - * @param broadPhase - The broad-phase of the simulation. 7648 - * @param narrowPhase - The narrow-phase of the simulation. 7649 - * @param bodies - The rigid-bodies taking part into the simulation. 7650 - * @param colliders - The colliders taking part into the simulation. 7651 - * @param impulseJoints - The impulse joints taking part into the simulation. 7652 - * @param multibodyJoints - The multibody joints taking part into the simulation. 7653 - */ 7654 - serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulseJoints, multibodyJoints) { 7655 - let rawGra = VectorOps.intoRaw(gravity); 7656 - const res = this.raw.serializeAll(rawGra, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw); 7657 - rawGra.free(); 7658 - return res; 7659 - } 7660 - /** 7661 - * Deserialize the complete physics state from a single byte array. 7662 - * 7663 - * @param data - The byte array to deserialize. 7664 - */ 7665 - deserializeAll(data) { 7666 - return World.fromRaw(this.raw.deserializeAll(data)); 7667 - } 7668 - }; 7669 - 7670 - // ../node_modules/@dimforge/rapier2d/pipeline/debug_render_pipeline.js 7671 - var DebugRenderBuffers = class { 7672 - constructor(vertices, colors) { 7673 - this.vertices = vertices; 7674 - this.colors = colors; 7675 - } 7676 - }; 7677 - var DebugRenderPipeline = class { 7678 - constructor(raw) { 7679 - this.raw = raw || new RawDebugRenderPipeline(); 7680 - } 7681 - /** 7682 - * Release the WASM memory occupied by this serialization pipeline. 7683 - */ 7684 - free() { 7685 - if (!!this.raw) { 7686 - this.raw.free(); 7687 - } 7688 - this.raw = void 0; 7689 - this.vertices = void 0; 7690 - this.colors = void 0; 7691 - } 7692 - render(bodies, colliders, impulse_joints, multibody_joints, narrow_phase) { 7693 - this.raw.render(bodies.raw, colliders.raw, impulse_joints.raw, multibody_joints.raw, narrow_phase.raw); 7694 - this.vertices = this.raw.vertices(); 7695 - this.colors = this.raw.colors(); 7696 - } 7697 - }; 7698 - 7699 - // ../node_modules/@dimforge/rapier2d/control/character_controller.js 7700 - var CharacterCollision = class { 7701 - }; 7702 - var KinematicCharacterController = class { 7703 - constructor(offset, params, bodies, colliders, queries) { 7704 - this.params = params; 7705 - this.bodies = bodies; 7706 - this.colliders = colliders; 7707 - this.queries = queries; 7708 - this.raw = new RawKinematicCharacterController(offset); 7709 - this.rawCharacterCollision = new RawCharacterCollision(); 7710 - this._applyImpulsesToDynamicBodies = false; 7711 - this._characterMass = null; 7712 - } 7713 - /** @internal */ 7714 - free() { 7715 - if (!!this.raw) { 7716 - this.raw.free(); 7717 - this.rawCharacterCollision.free(); 7718 - } 7719 - this.raw = void 0; 7720 - this.rawCharacterCollision = void 0; 7721 - } 7722 - /** 7723 - * The direction that goes "up". Used to determine where the floor is, and the floor’s angle. 7724 - */ 7725 - up() { 7726 - return this.raw.up(); 7727 - } 7728 - /** 7729 - * Sets the direction that goes "up". Used to determine where the floor is, and the floor’s angle. 7730 - */ 7731 - setUp(vector) { 7732 - let rawVect = VectorOps.intoRaw(vector); 7733 - return this.raw.setUp(rawVect); 7734 - rawVect.free(); 7735 - } 7736 - applyImpulsesToDynamicBodies() { 7737 - return this._applyImpulsesToDynamicBodies; 7738 - } 7739 - setApplyImpulsesToDynamicBodies(enabled) { 7740 - this._applyImpulsesToDynamicBodies = enabled; 7741 - } 7742 - /** 7743 - * Returns the custom value of the character mass, if it was set by `this.setCharacterMass`. 7744 - */ 7745 - characterMass() { 7746 - return this._characterMass; 7747 - } 7748 - /** 7749 - * Set the mass of the character to be used for impulse resolution if `self.applyImpulsesToDynamicBodies` 7750 - * is set to `true`. 7751 - * 7752 - * If no character mass is set explicitly (or if it is set to `null`) it is automatically assumed to be equal 7753 - * to the mass of the rigid-body the character collider is attached to; or equal to 0 if the character collider 7754 - * isn’t attached to any rigid-body. 7755 - * 7756 - * @param mass - The mass to set. 7757 - */ 7758 - setCharacterMass(mass) { 7759 - this._characterMass = mass; 7760 - } 7761 - /** 7762 - * A small gap to preserve between the character and its surroundings. 7763 - * 7764 - * This value should not be too large to avoid visual artifacts, but shouldn’t be too small 7765 - * (must not be zero) to improve numerical stability of the character controller. 7766 - */ 7767 - offset() { 7768 - return this.raw.offset(); 7769 - } 7770 - /** 7771 - * Sets a small gap to preserve between the character and its surroundings. 7772 - * 7773 - * This value should not be too large to avoid visual artifacts, but shouldn’t be too small 7774 - * (must not be zero) to improve numerical stability of the character controller. 7775 - */ 7776 - setOffset(value) { 7777 - this.raw.setOffset(value); 7778 - } 7779 - /// Increase this number if your character appears to get stuck when sliding against surfaces. 7780 - /// 7781 - /// This is a small distance applied to the movement toward the contact normals of shapes hit 7782 - /// by the character controller. This helps shape-casting not getting stuck in an always-penetrating 7783 - /// state during the sliding calculation. 7784 - /// 7785 - /// This value should remain fairly small since it can introduce artificial "bumps" when sliding 7786 - /// along a flat surface. 7787 - normalNudgeFactor() { 7788 - return this.raw.normalNudgeFactor(); 7789 - } 7790 - /// Increase this number if your character appears to get stuck when sliding against surfaces. 7791 - /// 7792 - /// This is a small distance applied to the movement toward the contact normals of shapes hit 7793 - /// by the character controller. This helps shape-casting not getting stuck in an always-penetrating 7794 - /// state during the sliding calculation. 7795 - /// 7796 - /// This value should remain fairly small since it can introduce artificial "bumps" when sliding 7797 - /// along a flat surface. 7798 - setNormalNudgeFactor(value) { 7799 - this.raw.setNormalNudgeFactor(value); 7800 - } 7801 - /** 7802 - * Is sliding against obstacles enabled? 7803 - */ 7804 - slideEnabled() { 7805 - return this.raw.slideEnabled(); 7806 - } 7807 - /** 7808 - * Enable or disable sliding against obstacles. 7809 - */ 7810 - setSlideEnabled(enabled) { 7811 - this.raw.setSlideEnabled(enabled); 7812 - } 7813 - /** 7814 - * The maximum step height a character can automatically step over. 7815 - */ 7816 - autostepMaxHeight() { 7817 - return this.raw.autostepMaxHeight(); 7818 - } 7819 - /** 7820 - * The minimum width of free space that must be available after stepping on a stair. 7821 - */ 7822 - autostepMinWidth() { 7823 - return this.raw.autostepMinWidth(); 7824 - } 7825 - /** 7826 - * Can the character automatically step over dynamic bodies too? 7827 - */ 7828 - autostepIncludesDynamicBodies() { 7829 - return this.raw.autostepIncludesDynamicBodies(); 7830 - } 7831 - /** 7832 - * Is automatically stepping over small objects enabled? 7833 - */ 7834 - autostepEnabled() { 7835 - return this.raw.autostepEnabled(); 7836 - } 7837 - /** 7838 - * Enabled automatically stepping over small objects. 7839 - * 7840 - * @param maxHeight - The maximum step height a character can automatically step over. 7841 - * @param minWidth - The minimum width of free space that must be available after stepping on a stair. 7842 - * @param includeDynamicBodies - Can the character automatically step over dynamic bodies too? 7843 - */ 7844 - enableAutostep(maxHeight, minWidth, includeDynamicBodies) { 7845 - this.raw.enableAutostep(maxHeight, minWidth, includeDynamicBodies); 7846 - } 7847 - /** 7848 - * Disable automatically stepping over small objects. 7849 - */ 7850 - disableAutostep() { 7851 - return this.raw.disableAutostep(); 7852 - } 7853 - /** 7854 - * The maximum angle (radians) between the floor’s normal and the `up` vector that the 7855 - * character is able to climb. 7856 - */ 7857 - maxSlopeClimbAngle() { 7858 - return this.raw.maxSlopeClimbAngle(); 7859 - } 7860 - /** 7861 - * Sets the maximum angle (radians) between the floor’s normal and the `up` vector that the 7862 - * character is able to climb. 7863 - */ 7864 - setMaxSlopeClimbAngle(angle) { 7865 - this.raw.setMaxSlopeClimbAngle(angle); 7866 - } 7867 - /** 7868 - * The minimum angle (radians) between the floor’s normal and the `up` vector before the 7869 - * character starts to slide down automatically. 7870 - */ 7871 - minSlopeSlideAngle() { 7872 - return this.raw.minSlopeSlideAngle(); 7873 - } 7874 - /** 7875 - * Sets the minimum angle (radians) between the floor’s normal and the `up` vector before the 7876 - * character starts to slide down automatically. 7877 - */ 7878 - setMinSlopeSlideAngle(angle) { 7879 - this.raw.setMinSlopeSlideAngle(angle); 7880 - } 7881 - /** 7882 - * If snap-to-ground is enabled, should the character be automatically snapped to the ground if 7883 - * the distance between the ground and its feet are smaller than the specified threshold? 7884 - */ 7885 - snapToGroundDistance() { 7886 - return this.raw.snapToGroundDistance(); 7887 - } 7888 - /** 7889 - * Enables automatically snapping the character to the ground if the distance between 7890 - * the ground and its feet are smaller than the specified threshold. 7891 - */ 7892 - enableSnapToGround(distance) { 7893 - this.raw.enableSnapToGround(distance); 7894 - } 7895 - /** 7896 - * Disables automatically snapping the character to the ground. 7897 - */ 7898 - disableSnapToGround() { 7899 - this.raw.disableSnapToGround(); 7900 - } 7901 - /** 7902 - * Is automatically snapping the character to the ground enabled? 7903 - */ 7904 - snapToGroundEnabled() { 7905 - return this.raw.snapToGroundEnabled(); 7906 - } 7907 - /** 7908 - * Computes the movement the given collider is able to execute after hitting and sliding on obstacles. 7909 - * 7910 - * @param collider - The collider to move. 7911 - * @param desiredTranslationDelta - The desired collider movement. 7912 - * @param filterFlags - Flags for excluding whole subsets of colliders from the obstacles taken into account. 7913 - * @param filterGroups - Groups for excluding colliders with incompatible collision groups from the obstacles 7914 - * taken into account. 7915 - * @param filterPredicate - Any collider for which this closure returns `false` will be excluded from the 7916 - * obstacles taken into account. 7917 - */ 7918 - computeColliderMovement(collider, desiredTranslationDelta, filterFlags, filterGroups, filterPredicate) { 7919 - let rawTranslationDelta = VectorOps.intoRaw(desiredTranslationDelta); 7920 - 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)); 7921 - rawTranslationDelta.free(); 7922 - } 7923 - /** 7924 - * The movement computed by the last call to `this.computeColliderMovement`. 7925 - */ 7926 - computedMovement() { 7927 - return VectorOps.fromRaw(this.raw.computedMovement()); 7928 - } 7929 - /** 7930 - * The result of ground detection computed by the last call to `this.computeColliderMovement`. 7931 - */ 7932 - computedGrounded() { 7933 - return this.raw.computedGrounded(); 7934 - } 7935 - /** 7936 - * The number of collisions against obstacles detected along the path of the last call 7937 - * to `this.computeColliderMovement`. 7938 - */ 7939 - numComputedCollisions() { 7940 - return this.raw.numComputedCollisions(); 7941 - } 7942 - /** 7943 - * Returns the collision against one of the obstacles detected along the path of the last 7944 - * call to `this.computeColliderMovement`. 7945 - * 7946 - * @param i - The i-th collision will be returned. 7947 - * @param out - If this argument is set, it will be filled with the collision information. 7948 - */ 7949 - computedCollision(i, out) { 7950 - if (!this.raw.computedCollision(i, this.rawCharacterCollision)) { 7951 - return null; 7952 - } else { 7953 - let c = this.rawCharacterCollision; 7954 - out = out !== null && out !== void 0 ? out : new CharacterCollision(); 7955 - out.translationDeltaApplied = VectorOps.fromRaw(c.translationDeltaApplied()); 7956 - out.translationDeltaRemaining = VectorOps.fromRaw(c.translationDeltaRemaining()); 7957 - out.toi = c.toi(); 7958 - out.witness1 = VectorOps.fromRaw(c.worldWitness1()); 7959 - out.witness2 = VectorOps.fromRaw(c.worldWitness2()); 7960 - out.normal1 = VectorOps.fromRaw(c.worldNormal1()); 7961 - out.normal2 = VectorOps.fromRaw(c.worldNormal2()); 7962 - out.collider = this.colliders.get(c.handle()); 7963 - return out; 7964 - } 7965 - } 7966 - }; 7967 - 7968 - // ../node_modules/@dimforge/rapier2d/pipeline/world.js 7969 - var World = class _World { 7970 - constructor(gravity, rawIntegrationParameters, rawIslands, rawBroadPhase, rawNarrowPhase, rawBodies, rawColliders, rawImpulseJoints, rawMultibodyJoints, rawCCDSolver, rawQueryPipeline, rawPhysicsPipeline, rawSerializationPipeline, rawDebugRenderPipeline) { 7971 - this.gravity = gravity; 7972 - this.integrationParameters = new IntegrationParameters(rawIntegrationParameters); 7973 - this.islands = new IslandManager(rawIslands); 7974 - this.broadPhase = new BroadPhase(rawBroadPhase); 7975 - this.narrowPhase = new NarrowPhase(rawNarrowPhase); 7976 - this.bodies = new RigidBodySet(rawBodies); 7977 - this.colliders = new ColliderSet(rawColliders); 7978 - this.impulseJoints = new ImpulseJointSet(rawImpulseJoints); 7979 - this.multibodyJoints = new MultibodyJointSet(rawMultibodyJoints); 7980 - this.ccdSolver = new CCDSolver(rawCCDSolver); 7981 - this.queryPipeline = new QueryPipeline(rawQueryPipeline); 7982 - this.physicsPipeline = new PhysicsPipeline(rawPhysicsPipeline); 7983 - this.serializationPipeline = new SerializationPipeline(rawSerializationPipeline); 7984 - this.debugRenderPipeline = new DebugRenderPipeline(rawDebugRenderPipeline); 7985 - this.characterControllers = /* @__PURE__ */ new Set(); 7986 - this.impulseJoints.finalizeDeserialization(this.bodies); 7987 - this.bodies.finalizeDeserialization(this.colliders); 7988 - this.colliders.finalizeDeserialization(this.bodies); 7989 - } 7990 - /** 7991 - * Release the WASM memory occupied by this physics world. 7992 - * 7993 - * All the fields of this physics world will be freed as well, 7994 - * so there is no need to call their `.free()` methods individually. 7995 - */ 7996 - free() { 7997 - this.integrationParameters.free(); 7998 - this.islands.free(); 7999 - this.broadPhase.free(); 8000 - this.narrowPhase.free(); 8001 - this.bodies.free(); 8002 - this.colliders.free(); 8003 - this.impulseJoints.free(); 8004 - this.multibodyJoints.free(); 8005 - this.ccdSolver.free(); 8006 - this.queryPipeline.free(); 8007 - this.physicsPipeline.free(); 8008 - this.serializationPipeline.free(); 8009 - this.debugRenderPipeline.free(); 8010 - this.characterControllers.forEach((controller) => controller.free()); 8011 - this.integrationParameters = void 0; 8012 - this.islands = void 0; 8013 - this.broadPhase = void 0; 8014 - this.narrowPhase = void 0; 8015 - this.bodies = void 0; 8016 - this.colliders = void 0; 8017 - this.ccdSolver = void 0; 8018 - this.impulseJoints = void 0; 8019 - this.multibodyJoints = void 0; 8020 - this.queryPipeline = void 0; 8021 - this.physicsPipeline = void 0; 8022 - this.serializationPipeline = void 0; 8023 - this.debugRenderPipeline = void 0; 8024 - this.characterControllers = void 0; 8025 - } 8026 - static fromRaw(raw) { 8027 - if (!raw) 8028 - return null; 8029 - return new _World(VectorOps.fromRaw(raw.takeGravity()), raw.takeIntegrationParameters(), raw.takeIslandManager(), raw.takeBroadPhase(), raw.takeNarrowPhase(), raw.takeBodies(), raw.takeColliders(), raw.takeImpulseJoints(), raw.takeMultibodyJoints()); 8030 - } 8031 - /** 8032 - * Takes a snapshot of this world. 8033 - * 8034 - * Use `World.restoreSnapshot` to create a new physics world with a state identical to 8035 - * the state when `.takeSnapshot()` is called. 8036 - */ 8037 - takeSnapshot() { 8038 - return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints); 8039 - } 8040 - /** 8041 - * Creates a new physics world from a snapshot. 8042 - * 8043 - * This new physics world will be an identical copy of the snapshoted physics world. 8044 - */ 8045 - static restoreSnapshot(data) { 8046 - let deser = new SerializationPipeline(); 8047 - return deser.deserializeAll(data); 8048 - } 8049 - /** 8050 - * Computes all the lines (and their colors) needed to render the scene. 8051 - */ 8052 - debugRender() { 8053 - this.debugRenderPipeline.render(this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints, this.narrowPhase); 8054 - return new DebugRenderBuffers(this.debugRenderPipeline.vertices, this.debugRenderPipeline.colors); 8055 - } 8056 - /** 8057 - * Advance the simulation by one time step. 8058 - * 8059 - * All events generated by the physics engine are ignored. 8060 - * 8061 - * @param EventQueue - (optional) structure responsible for collecting 8062 - * events generated by the physics engine. 8063 - */ 8064 - step(eventQueue, hooks) { 8065 - 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); 8066 - this.queryPipeline.update(this.bodies, this.colliders); 8067 - } 8068 - /** 8069 - * Update colliders positions after rigid-bodies moved. 8070 - * 8071 - * When a rigid-body moves, the positions of the colliders attached to it need to be updated. This update is 8072 - * generally automatically done at the beginning and the end of each simulation step with World.step. 8073 - * If the positions need to be updated without running a simulation step this method can be called manually. 8074 - */ 8075 - propagateModifiedBodyPositionsToColliders() { 8076 - this.bodies.raw.propagateModifiedBodyPositionsToColliders(this.colliders.raw); 8077 - } 8078 - /** 8079 - * Ensure subsequent scene queries take into account the collider positions set before this method is called. 8080 - * 8081 - * This does not step the physics simulation forward. 8082 - */ 8083 - updateSceneQueries() { 8084 - this.propagateModifiedBodyPositionsToColliders(); 8085 - this.queryPipeline.update(this.bodies, this.colliders); 8086 - } 8087 - /** 8088 - * The current simulation timestep. 8089 - */ 8090 - get timestep() { 8091 - return this.integrationParameters.dt; 8092 - } 8093 - /** 8094 - * Sets the new simulation timestep. 8095 - * 8096 - * The simulation timestep governs by how much the physics state of the world will 8097 - * be integrated. A simulation timestep should: 8098 - * - be as small as possible. Typical values evolve around 0.016 (assuming the chosen unit is milliseconds, 8099 - * corresponds to the time between two frames of a game running at 60FPS). 8100 - * - not vary too much during the course of the simulation. A timestep with large variations may 8101 - * cause instabilities in the simulation. 8102 - * 8103 - * @param dt - The timestep length, in seconds. 8104 - */ 8105 - set timestep(dt) { 8106 - this.integrationParameters.dt = dt; 8107 - } 8108 - /** 8109 - * The approximate size of most dynamic objects in the scene. 8110 - * 8111 - * See the documentation of the `World.lengthUnit` setter for further details. 8112 - */ 8113 - get lengthUnit() { 8114 - return this.integrationParameters.lengthUnit; 8115 - } 8116 - /** 8117 - * The approximate size of most dynamic objects in the scene. 8118 - * 8119 - * This value is used internally to estimate some length-based tolerance. In particular, the 8120 - * values `IntegrationParameters.allowedLinearError`, 8121 - * `IntegrationParameters.maxPenetrationCorrection`, 8122 - * `IntegrationParameters.predictionDistance`, `RigidBodyActivation.linearThreshold` 8123 - * are scaled by this value implicitly. 8124 - * 8125 - * This value can be understood as the number of units-per-meter in your physical world compared 8126 - * to a human-sized world in meter. For example, in a 2d game, if your typical object size is 100 8127 - * pixels, set the `[`Self::length_unit`]` parameter to 100.0. The physics engine will interpret 8128 - * it as if 100 pixels is equivalent to 1 meter in its various internal threshold. 8129 - * (default `1.0`). 8130 - */ 8131 - set lengthUnit(unitsPerMeter) { 8132 - this.integrationParameters.lengthUnit = unitsPerMeter; 8133 - } 8134 - /** 8135 - * The number of solver iterations run by the constraints solver for calculating forces (default: `4`). 8136 - */ 8137 - get numSolverIterations() { 8138 - return this.integrationParameters.numSolverIterations; 8139 - } 8140 - /** 8141 - * Sets the number of solver iterations run by the constraints solver for calculating forces (default: `4`). 8142 - * 8143 - * The greater this value is, the most rigid and realistic the physics simulation will be. 8144 - * However a greater number of iterations is more computationally intensive. 8145 - * 8146 - * @param niter - The new number of solver iterations. 8147 - */ 8148 - set numSolverIterations(niter) { 8149 - this.integrationParameters.numSolverIterations = niter; 8150 - } 8151 - /** 8152 - * Number of addition friction resolution iteration run during the last solver sub-step (default: `4`). 8153 - */ 8154 - get numAdditionalFrictionIterations() { 8155 - return this.integrationParameters.numAdditionalFrictionIterations; 8156 - } 8157 - /** 8158 - * Sets the number of addition friction resolution iteration run during the last solver sub-step (default: `4`). 8159 - * 8160 - * The greater this value is, the most realistic friction will be. 8161 - * However a greater number of iterations is more computationally intensive. 8162 - * 8163 - * @param niter - The new number of additional friction iterations. 8164 - */ 8165 - set numAdditionalFrictionIterations(niter) { 8166 - this.integrationParameters.numAdditionalFrictionIterations = niter; 8167 - } 8168 - /** 8169 - * Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`). 8170 - */ 8171 - get numInternalPgsIterations() { 8172 - return this.integrationParameters.numInternalPgsIterations; 8173 - } 8174 - /** 8175 - * Sets the Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`). 8176 - * 8177 - * Increasing this parameter will improve stability of the simulation. It will have a lesser effect than 8178 - * increasing `numSolverIterations` but is also less computationally expensive. 8179 - * 8180 - * @param niter - The new number of internal PGS iterations. 8181 - */ 8182 - set numInternalPgsIterations(niter) { 8183 - this.integrationParameters.numInternalPgsIterations = niter; 8184 - } 8185 - /// Configures the integration parameters to match the old PGS solver 8186 - /// from Rapier JS version <= 0.11. 8187 - /// 8188 - /// This solver was slightly faster than the new one but resulted 8189 - /// in less stable joints and worse convergence rates. 8190 - /// 8191 - /// This should only be used for comparison purpose or if you are 8192 - /// experiencing problems with the new solver. 8193 - /// 8194 - /// NOTE: this does not affect any `RigidBody.additional_solver_iterations` that will 8195 - /// still create solver iterations based on the new "small-steps" PGS solver. 8196 - switchToStandardPgsSolver() { 8197 - this.integrationParameters.switchToStandardPgsSolver(); 8198 - } 8199 - /// Configures the integration parameters to match the new "small-steps" PGS solver 8200 - /// from Rapier version >= 0.12. 8201 - /// 8202 - /// The "small-steps" PGS solver is the default one when creating the physics world. So 8203 - /// calling this function is generally not needed unless `World.switch_to_standard_pgs_solver` 8204 - /// was called. 8205 - /// 8206 - /// This solver results in more stable joints and significantly better convergence 8207 - /// rates but is slightly slower in its default settings. 8208 - switchToSmallStepsPgsSolver() { 8209 - this.integrationParameters.switchToSmallStepsPgsSolver(); 8210 - } 8211 - /// Configures the integration parameters to match the new "small-steps" PGS solver 8212 - /// from Rapier version >= 0.12. Warmstarting is disabled. 8213 - /// 8214 - /// The "small-steps" PGS solver is the default one when creating the physics world. So 8215 - /// calling this function is generally not needed unless `World.switch_to_standard_pgs_solver` 8216 - /// was called. 8217 - /// 8218 - /// This solver results in more stable joints and significantly better convergence 8219 - /// rates but is slightly slower in its default settings. 8220 - switchToSmallStepsPgsSolverWithoutWarmstart() { 8221 - this.integrationParameters.switchToSmallStepsPgsSolverWithoutWarmstart(); 8222 - } 8223 - /** 8224 - * Creates a new rigid-body from the given rigid-body descriptor. 8225 - * 8226 - * @param body - The description of the rigid-body to create. 8227 - */ 8228 - createRigidBody(body) { 8229 - return this.bodies.createRigidBody(this.colliders, body); 8230 - } 8231 - /** 8232 - * Creates a new character controller. 8233 - * 8234 - * @param offset - The artificial gap added between the character’s chape and its environment. 8235 - */ 8236 - createCharacterController(offset) { 8237 - let controller = new KinematicCharacterController(offset, this.integrationParameters, this.bodies, this.colliders, this.queryPipeline); 8238 - this.characterControllers.add(controller); 8239 - return controller; 8240 - } 8241 - /** 8242 - * Removes a character controller from this world. 8243 - * 8244 - * @param controller - The character controller to remove. 8245 - */ 8246 - removeCharacterController(controller) { 8247 - this.characterControllers.delete(controller); 8248 - controller.free(); 8249 - } 8250 - /** 8251 - * Creates a new collider. 8252 - * 8253 - * @param desc - The description of the collider. 8254 - * @param parent - The rigid-body this collider is attached to. 8255 - */ 8256 - createCollider(desc, parent) { 8257 - let parentHandle = parent ? parent.handle : void 0; 8258 - return this.colliders.createCollider(this.bodies, desc, parentHandle); 8259 - } 8260 - /** 8261 - * Creates a new impulse joint from the given joint descriptor. 8262 - * 8263 - * @param params - The description of the joint to create. 8264 - * @param parent1 - The first rigid-body attached to this joint. 8265 - * @param parent2 - The second rigid-body attached to this joint. 8266 - * @param wakeUp - Should the attached rigid-bodies be awakened? 8267 - */ 8268 - createImpulseJoint(params, parent1, parent2, wakeUp) { 8269 - return this.impulseJoints.createJoint(this.bodies, params, parent1.handle, parent2.handle, wakeUp); 8270 - } 8271 - /** 8272 - * Creates a new multibody joint from the given joint descriptor. 8273 - * 8274 - * @param params - The description of the joint to create. 8275 - * @param parent1 - The first rigid-body attached to this joint. 8276 - * @param parent2 - The second rigid-body attached to this joint. 8277 - * @param wakeUp - Should the attached rigid-bodies be awakened? 8278 - */ 8279 - createMultibodyJoint(params, parent1, parent2, wakeUp) { 8280 - return this.multibodyJoints.createJoint(params, parent1.handle, parent2.handle, wakeUp); 8281 - } 8282 - /** 8283 - * Retrieves a rigid-body from its handle. 8284 - * 8285 - * @param handle - The integer handle of the rigid-body to retrieve. 8286 - */ 8287 - getRigidBody(handle) { 8288 - return this.bodies.get(handle); 8289 - } 8290 - /** 8291 - * Retrieves a collider from its handle. 8292 - * 8293 - * @param handle - The integer handle of the collider to retrieve. 8294 - */ 8295 - getCollider(handle) { 8296 - return this.colliders.get(handle); 8297 - } 8298 - /** 8299 - * Retrieves an impulse joint from its handle. 8300 - * 8301 - * @param handle - The integer handle of the impulse joint to retrieve. 8302 - */ 8303 - getImpulseJoint(handle) { 8304 - return this.impulseJoints.get(handle); 8305 - } 8306 - /** 8307 - * Retrieves an multibody joint from its handle. 8308 - * 8309 - * @param handle - The integer handle of the multibody joint to retrieve. 8310 - */ 8311 - getMultibodyJoint(handle) { 8312 - return this.multibodyJoints.get(handle); 8313 - } 8314 - /** 8315 - * Removes the given rigid-body from this physics world. 8316 - * 8317 - * This will remove this rigid-body as well as all its attached colliders and joints. 8318 - * Every other bodies touching or attached by joints to this rigid-body will be woken-up. 8319 - * 8320 - * @param body - The rigid-body to remove. 8321 - */ 8322 - removeRigidBody(body) { 8323 - if (this.bodies) { 8324 - this.bodies.remove(body.handle, this.islands, this.colliders, this.impulseJoints, this.multibodyJoints); 8325 - } 8326 - } 8327 - /** 8328 - * Removes the given collider from this physics world. 8329 - * 8330 - * @param collider - The collider to remove. 8331 - * @param wakeUp - If set to `true`, the rigid-body this collider is attached to will be awaken. 8332 - */ 8333 - removeCollider(collider, wakeUp) { 8334 - if (this.colliders) { 8335 - this.colliders.remove(collider.handle, this.islands, this.bodies, wakeUp); 8336 - } 8337 - } 8338 - /** 8339 - * Removes the given impulse joint from this physics world. 8340 - * 8341 - * @param joint - The impulse joint to remove. 8342 - * @param wakeUp - If set to `true`, the rigid-bodies attached by this joint will be awaken. 8343 - */ 8344 - removeImpulseJoint(joint, wakeUp) { 8345 - if (this.impulseJoints) { 8346 - this.impulseJoints.remove(joint.handle, wakeUp); 8347 - } 8348 - } 8349 - /** 8350 - * Removes the given multibody joint from this physics world. 8351 - * 8352 - * @param joint - The multibody joint to remove. 8353 - * @param wakeUp - If set to `true`, the rigid-bodies attached by this joint will be awaken. 8354 - */ 8355 - removeMultibodyJoint(joint, wakeUp) { 8356 - if (this.impulseJoints) { 8357 - this.multibodyJoints.remove(joint.handle, wakeUp); 8358 - } 8359 - } 8360 - /** 8361 - * Applies the given closure to each collider managed by this physics world. 8362 - * 8363 - * @param f(collider) - The function to apply to each collider managed by this physics world. Called as `f(collider)`. 8364 - */ 8365 - forEachCollider(f) { 8366 - this.colliders.forEach(f); 8367 - } 8368 - /** 8369 - * Applies the given closure to each rigid-body managed by this physics world. 8370 - * 8371 - * @param f(body) - The function to apply to each rigid-body managed by this physics world. Called as `f(collider)`. 8372 - */ 8373 - forEachRigidBody(f) { 8374 - this.bodies.forEach(f); 8375 - } 8376 - /** 8377 - * Applies the given closure to each active rigid-body managed by this physics world. 8378 - * 8379 - * After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by 8380 - * the physics engine in order to save computational power. A sleeping rigid-body never moves 8381 - * unless it is moved manually by the user. 8382 - * 8383 - * @param f - The function to apply to each active rigid-body managed by this physics world. Called as `f(collider)`. 8384 - */ 8385 - forEachActiveRigidBody(f) { 8386 - this.bodies.forEachActiveRigidBody(this.islands, f); 8387 - } 8388 - /** 8389 - * Find the closest intersection between a ray and the physics world. 8390 - * 8391 - * @param ray - The ray to cast. 8392 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 8393 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 8394 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 8395 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 8396 - * whereas `false` implies that all shapes are hollow for this ray-cast. 8397 - * @param groups - Used to filter the colliders that can or cannot be hit by the ray. 8398 - * @param filter - The callback to filter out which collider will be hit. 8399 - */ 8400 - castRay(ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8401 - 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)); 8402 - } 8403 - /** 8404 - * Find the closest intersection between a ray and the physics world. 8405 - * 8406 - * This also computes the normal at the hit point. 8407 - * @param ray - The ray to cast. 8408 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 8409 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 8410 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 8411 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 8412 - * whereas `false` implies that all shapes are hollow for this ray-cast. 8413 - * @param groups - Used to filter the colliders that can or cannot be hit by the ray. 8414 - */ 8415 - castRayAndGetNormal(ray, maxToi, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8416 - 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)); 8417 - } 8418 - /** 8419 - * Cast a ray and collects all the intersections between a ray and the scene. 8420 - * 8421 - * @param ray - The ray to cast. 8422 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 8423 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 8424 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 8425 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 8426 - * whereas `false` implies that all shapes are hollow for this ray-cast. 8427 - * @param groups - Used to filter the colliders that can or cannot be hit by the ray. 8428 - * @param callback - The callback called once per hit (in no particular order) between a ray and a collider. 8429 - * If this callback returns `false`, then the cast will stop and no further hits will be detected/reported. 8430 - */ 8431 - intersectionsWithRay(ray, maxToi, solid, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8432 - 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)); 8433 - } 8434 - /** 8435 - * Gets the handle of up to one collider intersecting the given shape. 8436 - * 8437 - * @param shapePos - The position of the shape used for the intersection test. 8438 - * @param shapeRot - The orientation of the shape used for the intersection test. 8439 - * @param shape - The shape used for the intersection test. 8440 - * @param groups - The bit groups and filter associated to the ray, in order to only 8441 - * hit the colliders with collision groups compatible with the ray's group. 8442 - */ 8443 - intersectionWithShape(shapePos, shapeRot, shape, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8444 - 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)); 8445 - return handle != null ? this.colliders.get(handle) : null; 8446 - } 8447 - /** 8448 - * Find the projection of a point on the closest collider. 8449 - * 8450 - * @param point - The point to project. 8451 - * @param solid - If this is set to `true` then the collider shapes are considered to 8452 - * be plain (if the point is located inside of a plain shape, its projection is the point 8453 - * itself). If it is set to `false` the collider shapes are considered to be hollow 8454 - * (if the point is located inside of an hollow shape, it is projected on the shape's 8455 - * boundary). 8456 - * @param groups - The bit groups and filter associated to the point to project, in order to only 8457 - * project on colliders with collision groups compatible with the ray's group. 8458 - */ 8459 - projectPoint(point, solid, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8460 - return this.queryPipeline.projectPoint(this.bodies, this.colliders, point, solid, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate)); 8461 - } 8462 - /** 8463 - * Find the projection of a point on the closest collider. 8464 - * 8465 - * @param point - The point to project. 8466 - * @param groups - The bit groups and filter associated to the point to project, in order to only 8467 - * project on colliders with collision groups compatible with the ray's group. 8468 - */ 8469 - projectPointAndGetFeature(point, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8470 - return this.queryPipeline.projectPointAndGetFeature(this.bodies, this.colliders, point, filterFlags, filterGroups, filterExcludeCollider ? filterExcludeCollider.handle : null, filterExcludeRigidBody ? filterExcludeRigidBody.handle : null, this.colliders.castClosure(filterPredicate)); 8471 - } 8472 - /** 8473 - * Find all the colliders containing the given point. 8474 - * 8475 - * @param point - The point used for the containment test. 8476 - * @param groups - The bit groups and filter associated to the point to test, in order to only 8477 - * test on colliders with collision groups compatible with the ray's group. 8478 - * @param callback - A function called with the handles of each collider with a shape 8479 - * containing the `point`. 8480 - */ 8481 - intersectionsWithPoint(point, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8482 - 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)); 8483 - } 8484 - /** 8485 - * Casts a shape at a constant linear velocity and retrieve the first collider it hits. 8486 - * This is similar to ray-casting except that we are casting a whole shape instead of 8487 - * just a point (the ray origin). 8488 - * 8489 - * @param shapePos - The initial position of the shape to cast. 8490 - * @param shapeRot - The initial rotation of the shape to cast. 8491 - * @param shapeVel - The constant velocity of the shape to cast (i.e. the cast direction). 8492 - * @param shape - The shape to cast. 8493 - * @param targetDistance − If the shape moves closer to this distance from a collider, a hit 8494 - * will be returned. 8495 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 8496 - * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`. 8497 - * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if 8498 - * the shape is penetrating another shape at its starting point **and** its trajectory is such 8499 - * that it’s on a path to exist that penetration state. 8500 - * @param groups - The bit groups and filter associated to the shape to cast, in order to only 8501 - * test on colliders with collision groups compatible with this group. 8502 - */ 8503 - castShape(shapePos, shapeRot, shapeVel, shape, targetDistance, maxToi, stopAtPenetration, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8504 - 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)); 8505 - } 8506 - /** 8507 - * Retrieve all the colliders intersecting the given shape. 8508 - * 8509 - * @param shapePos - The position of the shape to test. 8510 - * @param shapeRot - The orientation of the shape to test. 8511 - * @param shape - The shape to test. 8512 - * @param groups - The bit groups and filter associated to the shape to test, in order to only 8513 - * test on colliders with collision groups compatible with this group. 8514 - * @param callback - A function called with the handles of each collider intersecting the `shape`. 8515 - */ 8516 - intersectionsWithShape(shapePos, shapeRot, shape, callback, filterFlags, filterGroups, filterExcludeCollider, filterExcludeRigidBody, filterPredicate) { 8517 - 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)); 8518 - } 8519 - /** 8520 - * Finds the handles of all the colliders with an AABB intersecting the given AABB. 8521 - * 8522 - * @param aabbCenter - The center of the AABB to test. 8523 - * @param aabbHalfExtents - The half-extents of the AABB to test. 8524 - * @param callback - The callback that will be called with the handles of all the colliders 8525 - * currently intersecting the given AABB. 8526 - */ 8527 - collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, callback) { 8528 - this.queryPipeline.collidersWithAabbIntersectingAabb(aabbCenter, aabbHalfExtents, this.colliders.castClosure(callback)); 8529 - } 8530 - /** 8531 - * Enumerates all the colliders potentially in contact with the given collider. 8532 - * 8533 - * @param collider1 - The second collider involved in the contact. 8534 - * @param f - Closure that will be called on each collider that is in contact with `collider1`. 8535 - */ 8536 - contactPairsWith(collider1, f) { 8537 - this.narrowPhase.contactPairsWith(collider1.handle, this.colliders.castClosure(f)); 8538 - } 8539 - /** 8540 - * Enumerates all the colliders intersecting the given colliders, assuming one of them 8541 - * is a sensor. 8542 - */ 8543 - intersectionPairsWith(collider1, f) { 8544 - this.narrowPhase.intersectionPairsWith(collider1.handle, this.colliders.castClosure(f)); 8545 - } 8546 - /** 8547 - * Iterates through all the contact manifolds between the given pair of colliders. 8548 - * 8549 - * @param collider1 - The first collider involved in the contact. 8550 - * @param collider2 - The second collider involved in the contact. 8551 - * @param f - Closure that will be called on each contact manifold between the two colliders. If the second argument 8552 - * passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1` 8553 - * actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`. 8554 - */ 8555 - contactPair(collider1, collider2, f) { 8556 - this.narrowPhase.contactPair(collider1.handle, collider2.handle, f); 8557 - } 8558 - /** 8559 - * Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor. 8560 - * @param collider1 − The first collider involved in the intersection. 8561 - * @param collider2 − The second collider involved in the intersection. 8562 - */ 8563 - intersectionPair(collider1, collider2) { 8564 - return this.narrowPhase.intersectionPair(collider1.handle, collider2.handle); 8565 - } 8566 - }; 8567 - 8568 - // ../node_modules/@dimforge/rapier2d/pipeline/event_queue.js 8569 - var ActiveEvents; 8570 - (function(ActiveEvents2) { 8571 - ActiveEvents2[ActiveEvents2["NONE"] = 0] = "NONE"; 8572 - ActiveEvents2[ActiveEvents2["COLLISION_EVENTS"] = 1] = "COLLISION_EVENTS"; 8573 - ActiveEvents2[ActiveEvents2["CONTACT_FORCE_EVENTS"] = 2] = "CONTACT_FORCE_EVENTS"; 8574 - })(ActiveEvents || (ActiveEvents = {})); 8575 - var TempContactForceEvent = class { 8576 - free() { 8577 - if (!!this.raw) { 8578 - this.raw.free(); 8579 - } 8580 - this.raw = void 0; 8581 - } 8582 - /** 8583 - * The first collider involved in the contact. 8584 - */ 8585 - collider1() { 8586 - return this.raw.collider1(); 8587 - } 8588 - /** 8589 - * The second collider involved in the contact. 8590 - */ 8591 - collider2() { 8592 - return this.raw.collider2(); 8593 - } 8594 - /** 8595 - * The sum of all the forces between the two colliders. 8596 - */ 8597 - totalForce() { 8598 - return VectorOps.fromRaw(this.raw.total_force()); 8599 - } 8600 - /** 8601 - * The sum of the magnitudes of each force between the two colliders. 8602 - * 8603 - * Note that this is **not** the same as the magnitude of `self.total_force`. 8604 - * Here we are summing the magnitude of all the forces, instead of taking 8605 - * the magnitude of their sum. 8606 - */ 8607 - totalForceMagnitude() { 8608 - return this.raw.total_force_magnitude(); 8609 - } 8610 - /** 8611 - * The world-space (unit) direction of the force with strongest magnitude. 8612 - */ 8613 - maxForceDirection() { 8614 - return VectorOps.fromRaw(this.raw.max_force_direction()); 8615 - } 8616 - /** 8617 - * The magnitude of the largest force at a contact point of this contact pair. 8618 - */ 8619 - maxForceMagnitude() { 8620 - return this.raw.max_force_magnitude(); 8621 - } 8622 - }; 8623 - var EventQueue = class { 8624 - /** 8625 - * Creates a new event collector. 8626 - * 8627 - * @param autoDrain -setting this to `true` is strongly recommended. If true, the collector will 8628 - * be automatically drained before each `world.step(collector)`. If false, the collector will 8629 - * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of 8630 - * RAM if no drain is performed. 8631 - */ 8632 - constructor(autoDrain, raw) { 8633 - this.raw = raw || new RawEventQueue(autoDrain); 8634 - } 8635 - /** 8636 - * Release the WASM memory occupied by this event-queue. 8637 - */ 8638 - free() { 8639 - if (!!this.raw) { 8640 - this.raw.free(); 8641 - } 8642 - this.raw = void 0; 8643 - } 8644 - /** 8645 - * Applies the given javascript closure on each collision event of this collector, then clear 8646 - * the internal collision event buffer. 8647 - * 8648 - * @param f - JavaScript closure applied to each collision event. The 8649 - * closure must take three arguments: two integers representing the handles of the colliders 8650 - * involved in the collision, and a boolean indicating if the collision started (true) or stopped 8651 - * (false). 8652 - */ 8653 - drainCollisionEvents(f) { 8654 - this.raw.drainCollisionEvents(f); 8655 - } 8656 - /** 8657 - * Applies the given javascript closure on each contact force event of this collector, then clear 8658 - * the internal collision event buffer. 8659 - * 8660 - * @param f - JavaScript closure applied to each collision event. The 8661 - * closure must take one `TempContactForceEvent` argument. 8662 - */ 8663 - drainContactForceEvents(f) { 8664 - let event = new TempContactForceEvent(); 8665 - this.raw.drainContactForceEvents((raw) => { 8666 - event.raw = raw; 8667 - f(event); 8668 - event.free(); 8669 - }); 8670 - } 8671 - /** 8672 - * Removes all events contained by this collector 8673 - */ 8674 - clear() { 8675 - this.raw.clear(); 8676 - } 8677 - }; 8678 - 8679 - // ../node_modules/@dimforge/rapier2d/pipeline/physics_hooks.js 8680 - var ActiveHooks; 8681 - (function(ActiveHooks2) { 8682 - ActiveHooks2[ActiveHooks2["NONE"] = 0] = "NONE"; 8683 - ActiveHooks2[ActiveHooks2["FILTER_CONTACT_PAIRS"] = 1] = "FILTER_CONTACT_PAIRS"; 8684 - ActiveHooks2[ActiveHooks2["FILTER_INTERSECTION_PAIRS"] = 2] = "FILTER_INTERSECTION_PAIRS"; 8685 - })(ActiveHooks || (ActiveHooks = {})); 8686 - var SolverFlags; 8687 - (function(SolverFlags2) { 8688 - SolverFlags2[SolverFlags2["EMPTY"] = 0] = "EMPTY"; 8689 - SolverFlags2[SolverFlags2["COMPUTE_IMPULSE"] = 1] = "COMPUTE_IMPULSE"; 8690 - })(SolverFlags || (SolverFlags = {})); 8691 - 8692 - // ../node_modules/@dimforge/rapier2d/geometry/collider.js 8693 - var ActiveCollisionTypes; 8694 - (function(ActiveCollisionTypes2) { 8695 - ActiveCollisionTypes2[ActiveCollisionTypes2["DYNAMIC_DYNAMIC"] = 1] = "DYNAMIC_DYNAMIC"; 8696 - ActiveCollisionTypes2[ActiveCollisionTypes2["DYNAMIC_KINEMATIC"] = 12] = "DYNAMIC_KINEMATIC"; 8697 - ActiveCollisionTypes2[ActiveCollisionTypes2["DYNAMIC_FIXED"] = 2] = "DYNAMIC_FIXED"; 8698 - ActiveCollisionTypes2[ActiveCollisionTypes2["KINEMATIC_KINEMATIC"] = 52224] = "KINEMATIC_KINEMATIC"; 8699 - ActiveCollisionTypes2[ActiveCollisionTypes2["KINEMATIC_FIXED"] = 8704] = "KINEMATIC_FIXED"; 8700 - ActiveCollisionTypes2[ActiveCollisionTypes2["FIXED_FIXED"] = 32] = "FIXED_FIXED"; 8701 - ActiveCollisionTypes2[ActiveCollisionTypes2["DEFAULT"] = 15] = "DEFAULT"; 8702 - ActiveCollisionTypes2[ActiveCollisionTypes2["ALL"] = 60943] = "ALL"; 8703 - })(ActiveCollisionTypes || (ActiveCollisionTypes = {})); 8704 - var Collider = class { 8705 - constructor(colliderSet, handle, parent, shape) { 8706 - this.colliderSet = colliderSet; 8707 - this.handle = handle; 8708 - this._parent = parent; 8709 - this._shape = shape; 8710 - } 8711 - /** @internal */ 8712 - finalizeDeserialization(bodies) { 8713 - if (this.handle != null) { 8714 - this._parent = bodies.get(this.colliderSet.raw.coParent(this.handle)); 8715 - } 8716 - } 8717 - ensureShapeIsCached() { 8718 - if (!this._shape) 8719 - this._shape = Shape.fromRaw(this.colliderSet.raw, this.handle); 8720 - } 8721 - /** 8722 - * The shape of this collider. 8723 - */ 8724 - get shape() { 8725 - this.ensureShapeIsCached(); 8726 - return this._shape; 8727 - } 8728 - /** 8729 - * Checks if this collider is still valid (i.e. that it has 8730 - * not been deleted from the collider set yet). 8731 - */ 8732 - isValid() { 8733 - return this.colliderSet.raw.contains(this.handle); 8734 - } 8735 - /** 8736 - * The world-space translation of this rigid-body. 8737 - */ 8738 - translation() { 8739 - return VectorOps.fromRaw(this.colliderSet.raw.coTranslation(this.handle)); 8740 - } 8741 - /** 8742 - * The world-space orientation of this rigid-body. 8743 - */ 8744 - rotation() { 8745 - return RotationOps.fromRaw(this.colliderSet.raw.coRotation(this.handle)); 8746 - } 8747 - /** 8748 - * Is this collider a sensor? 8749 - */ 8750 - isSensor() { 8751 - return this.colliderSet.raw.coIsSensor(this.handle); 8752 - } 8753 - /** 8754 - * Sets whether or not this collider is a sensor. 8755 - * @param isSensor - If `true`, the collider will be a sensor. 8756 - */ 8757 - setSensor(isSensor) { 8758 - this.colliderSet.raw.coSetSensor(this.handle, isSensor); 8759 - } 8760 - /** 8761 - * Sets the new shape of the collider. 8762 - * @param shape - The collider’s new shape. 8763 - */ 8764 - setShape(shape) { 8765 - let rawShape = shape.intoRaw(); 8766 - this.colliderSet.raw.coSetShape(this.handle, rawShape); 8767 - rawShape.free(); 8768 - this._shape = shape; 8769 - } 8770 - /** 8771 - * Sets whether this collider is enabled or not. 8772 - * 8773 - * @param enabled - Set to `false` to disable this collider (its parent rigid-body won’t be disabled automatically by this). 8774 - */ 8775 - setEnabled(enabled) { 8776 - this.colliderSet.raw.coSetEnabled(this.handle, enabled); 8777 - } 8778 - /** 8779 - * Is this collider enabled? 8780 - */ 8781 - isEnabled() { 8782 - return this.colliderSet.raw.coIsEnabled(this.handle); 8783 - } 8784 - /** 8785 - * Sets the restitution coefficient of the collider to be created. 8786 - * 8787 - * @param restitution - The restitution coefficient in `[0, 1]`. A value of 0 (the default) means no bouncing behavior 8788 - * while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the 8789 - * constraints solver). 8790 - */ 8791 - setRestitution(restitution) { 8792 - this.colliderSet.raw.coSetRestitution(this.handle, restitution); 8793 - } 8794 - /** 8795 - * Sets the friction coefficient of the collider to be created. 8796 - * 8797 - * @param friction - The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The 8798 - * higher the coefficient, the stronger friction forces will be for contacts with the collider 8799 - * being built. 8800 - */ 8801 - setFriction(friction) { 8802 - this.colliderSet.raw.coSetFriction(this.handle, friction); 8803 - } 8804 - /** 8805 - * Gets the rule used to combine the friction coefficients of two colliders 8806 - * colliders involved in a contact. 8807 - */ 8808 - frictionCombineRule() { 8809 - return this.colliderSet.raw.coFrictionCombineRule(this.handle); 8810 - } 8811 - /** 8812 - * Sets the rule used to combine the friction coefficients of two colliders 8813 - * colliders involved in a contact. 8814 - * 8815 - * @param rule − The combine rule to apply. 8816 - */ 8817 - setFrictionCombineRule(rule) { 8818 - this.colliderSet.raw.coSetFrictionCombineRule(this.handle, rule); 8819 - } 8820 - /** 8821 - * Gets the rule used to combine the restitution coefficients of two colliders 8822 - * colliders involved in a contact. 8823 - */ 8824 - restitutionCombineRule() { 8825 - return this.colliderSet.raw.coRestitutionCombineRule(this.handle); 8826 - } 8827 - /** 8828 - * Sets the rule used to combine the restitution coefficients of two colliders 8829 - * colliders involved in a contact. 8830 - * 8831 - * @param rule − The combine rule to apply. 8832 - */ 8833 - setRestitutionCombineRule(rule) { 8834 - this.colliderSet.raw.coSetRestitutionCombineRule(this.handle, rule); 8835 - } 8836 - /** 8837 - * Sets the collision groups used by this collider. 8838 - * 8839 - * Two colliders will interact iff. their collision groups are compatible. 8840 - * See the documentation of `InteractionGroups` for details on teh used bit pattern. 8841 - * 8842 - * @param groups - The collision groups used for the collider being built. 8843 - */ 8844 - setCollisionGroups(groups) { 8845 - this.colliderSet.raw.coSetCollisionGroups(this.handle, groups); 8846 - } 8847 - /** 8848 - * Sets the solver groups used by this collider. 8849 - * 8850 - * Forces between two colliders in contact will be computed iff their solver 8851 - * groups are compatible. 8852 - * See the documentation of `InteractionGroups` for details on the used bit pattern. 8853 - * 8854 - * @param groups - The solver groups used for the collider being built. 8855 - */ 8856 - setSolverGroups(groups) { 8857 - this.colliderSet.raw.coSetSolverGroups(this.handle, groups); 8858 - } 8859 - /** 8860 - * Sets the contact skin for this collider. 8861 - * 8862 - * See the documentation of `ColliderDesc.setContactSkin` for additional details. 8863 - */ 8864 - contactSkin() { 8865 - return this.colliderSet.raw.coContactSkin(this.handle); 8866 - } 8867 - /** 8868 - * Sets the contact skin for this collider. 8869 - * 8870 - * See the documentation of `ColliderDesc.setContactSkin` for additional details. 8871 - * 8872 - * @param thickness - The contact skin thickness. 8873 - */ 8874 - setContactSkin(thickness) { 8875 - return this.colliderSet.raw.coSetContactSkin(this.handle, thickness); 8876 - } 8877 - /** 8878 - * Get the physics hooks active for this collider. 8879 - */ 8880 - activeHooks() { 8881 - return this.colliderSet.raw.coActiveHooks(this.handle); 8882 - } 8883 - /** 8884 - * Set the physics hooks active for this collider. 8885 - * 8886 - * Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider. 8887 - * 8888 - * @param activeHooks - The hooks active for contact/intersection pairs involving this collider. 8889 - */ 8890 - setActiveHooks(activeHooks) { 8891 - this.colliderSet.raw.coSetActiveHooks(this.handle, activeHooks); 8892 - } 8893 - /** 8894 - * The events active for this collider. 8895 - */ 8896 - activeEvents() { 8897 - return this.colliderSet.raw.coActiveEvents(this.handle); 8898 - } 8899 - /** 8900 - * Set the events active for this collider. 8901 - * 8902 - * Use this to enable contact and/or intersection event reporting for this collider. 8903 - * 8904 - * @param activeEvents - The events active for contact/intersection pairs involving this collider. 8905 - */ 8906 - setActiveEvents(activeEvents) { 8907 - this.colliderSet.raw.coSetActiveEvents(this.handle, activeEvents); 8908 - } 8909 - /** 8910 - * Gets the collision types active for this collider. 8911 - */ 8912 - activeCollisionTypes() { 8913 - return this.colliderSet.raw.coActiveCollisionTypes(this.handle); 8914 - } 8915 - /** 8916 - * Sets the total force magnitude beyond which a contact force event can be emitted. 8917 - * 8918 - * @param threshold - The new force threshold. 8919 - */ 8920 - setContactForceEventThreshold(threshold) { 8921 - return this.colliderSet.raw.coSetContactForceEventThreshold(this.handle, threshold); 8922 - } 8923 - /** 8924 - * The total force magnitude beyond which a contact force event can be emitted. 8925 - */ 8926 - contactForceEventThreshold() { 8927 - return this.colliderSet.raw.coContactForceEventThreshold(this.handle); 8928 - } 8929 - /** 8930 - * Set the collision types active for this collider. 8931 - * 8932 - * @param activeCollisionTypes - The hooks active for contact/intersection pairs involving this collider. 8933 - */ 8934 - setActiveCollisionTypes(activeCollisionTypes) { 8935 - this.colliderSet.raw.coSetActiveCollisionTypes(this.handle, activeCollisionTypes); 8936 - } 8937 - /** 8938 - * Sets the uniform density of this collider. 8939 - * 8940 - * This will override any previous mass-properties set by `this.setDensity`, 8941 - * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`, 8942 - * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider. 8943 - * 8944 - * The mass and angular inertia of this collider will be computed automatically based on its 8945 - * shape. 8946 - */ 8947 - setDensity(density) { 8948 - this.colliderSet.raw.coSetDensity(this.handle, density); 8949 - } 8950 - /** 8951 - * Sets the mass of this collider. 8952 - * 8953 - * This will override any previous mass-properties set by `this.setDensity`, 8954 - * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`, 8955 - * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider. 8956 - * 8957 - * The angular inertia of this collider will be computed automatically based on its shape 8958 - * and this mass value. 8959 - */ 8960 - setMass(mass) { 8961 - this.colliderSet.raw.coSetMass(this.handle, mass); 8962 - } 8963 - // #if DIM2 8964 - /** 8965 - * Sets the mass of this collider. 8966 - * 8967 - * This will override any previous mass-properties set by `this.setDensity`, 8968 - * `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`, 8969 - * `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider. 8970 - */ 8971 - setMassProperties(mass, centerOfMass, principalAngularInertia) { 8972 - let rawCom = VectorOps.intoRaw(centerOfMass); 8973 - this.colliderSet.raw.coSetMassProperties(this.handle, mass, rawCom, principalAngularInertia); 8974 - rawCom.free(); 8975 - } 8976 - // #endif 8977 - /** 8978 - * Sets the translation of this collider. 8979 - * 8980 - * @param tra - The world-space position of the collider. 8981 - */ 8982 - setTranslation(tra) { 8983 - this.colliderSet.raw.coSetTranslation(this.handle, tra.x, tra.y); 8984 - } 8985 - /** 8986 - * Sets the translation of this collider relative to its parent rigid-body. 8987 - * 8988 - * Does nothing if this collider isn't attached to a rigid-body. 8989 - * 8990 - * @param tra - The new translation of the collider relative to its parent. 8991 - */ 8992 - setTranslationWrtParent(tra) { 8993 - this.colliderSet.raw.coSetTranslationWrtParent(this.handle, tra.x, tra.y); 8994 - } 8995 - // #if DIM2 8996 - /** 8997 - * Sets the rotation angle of this collider. 8998 - * 8999 - * @param angle - The rotation angle, in radians. 9000 - */ 9001 - setRotation(angle) { 9002 - this.colliderSet.raw.coSetRotation(this.handle, angle); 9003 - } 9004 - /** 9005 - * Sets the rotation angle of this collider relative to its parent rigid-body. 9006 - * 9007 - * Does nothing if this collider isn't attached to a rigid-body. 9008 - * 9009 - * @param angle - The rotation angle, in radians. 9010 - */ 9011 - setRotationWrtParent(angle) { 9012 - this.colliderSet.raw.coSetRotationWrtParent(this.handle, angle); 9013 - } 9014 - // #endif 9015 - /** 9016 - * The type of the shape of this collider. 9017 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9018 - */ 9019 - shapeType() { 9020 - return this.colliderSet.raw.coShapeType(this.handle); 9021 - } 9022 - /** 9023 - * The half-extents of this collider if it is a cuboid shape. 9024 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9025 - */ 9026 - halfExtents() { 9027 - return VectorOps.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle)); 9028 - } 9029 - /** 9030 - * Sets the half-extents of this collider if it is a cuboid shape. 9031 - * 9032 - * @param newHalfExtents - desired half extents. 9033 - */ 9034 - setHalfExtents(newHalfExtents) { 9035 - const rawPoint = VectorOps.intoRaw(newHalfExtents); 9036 - this.colliderSet.raw.coSetHalfExtents(this.handle, rawPoint); 9037 - } 9038 - /** 9039 - * The radius of this collider if it is a ball, cylinder, capsule, or cone shape. 9040 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9041 - */ 9042 - radius() { 9043 - return this.colliderSet.raw.coRadius(this.handle); 9044 - } 9045 - /** 9046 - * Sets the radius of this collider if it is a ball, cylinder, capsule, or cone shape. 9047 - * 9048 - * @param newRadius - desired radius. 9049 - */ 9050 - setRadius(newRadius) { 9051 - this.colliderSet.raw.coSetRadius(this.handle, newRadius); 9052 - } 9053 - /** 9054 - * The radius of the round edges of this collider if it is a round cylinder. 9055 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9056 - */ 9057 - roundRadius() { 9058 - return this.colliderSet.raw.coRoundRadius(this.handle); 9059 - } 9060 - /** 9061 - * Sets the radius of the round edges of this collider if it has round edges. 9062 - * 9063 - * @param newBorderRadius - desired round edge radius. 9064 - */ 9065 - setRoundRadius(newBorderRadius) { 9066 - this.colliderSet.raw.coSetRoundRadius(this.handle, newBorderRadius); 9067 - } 9068 - /** 9069 - * The half height of this collider if it is a cylinder, capsule, or cone shape. 9070 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9071 - */ 9072 - halfHeight() { 9073 - return this.colliderSet.raw.coHalfHeight(this.handle); 9074 - } 9075 - /** 9076 - * Sets the half height of this collider if it is a cylinder, capsule, or cone shape. 9077 - * 9078 - * @param newHalfheight - desired half height. 9079 - */ 9080 - setHalfHeight(newHalfheight) { 9081 - this.colliderSet.raw.coSetHalfHeight(this.handle, newHalfheight); 9082 - } 9083 - /** 9084 - * If this collider has a triangle mesh, polyline, convex polygon, or convex polyhedron shape, 9085 - * this returns the vertex buffer of said shape. 9086 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9087 - */ 9088 - vertices() { 9089 - return this.colliderSet.raw.coVertices(this.handle); 9090 - } 9091 - /** 9092 - * If this collider has a triangle mesh, polyline, or convex polyhedron shape, 9093 - * this returns the index buffer of said shape. 9094 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9095 - */ 9096 - indices() { 9097 - return this.colliderSet.raw.coIndices(this.handle); 9098 - } 9099 - /** 9100 - * If this collider has a heightfield shape, this returns the heights buffer of 9101 - * the heightfield. 9102 - * In 3D, the returned height matrix is provided in column-major order. 9103 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9104 - */ 9105 - heightfieldHeights() { 9106 - return this.colliderSet.raw.coHeightfieldHeights(this.handle); 9107 - } 9108 - /** 9109 - * If this collider has a heightfield shape, this returns the scale 9110 - * applied to it. 9111 - * @deprecated this field will be removed in the future, please access this field on `shape` member instead. 9112 - */ 9113 - heightfieldScale() { 9114 - let scale = this.colliderSet.raw.coHeightfieldScale(this.handle); 9115 - return VectorOps.fromRaw(scale); 9116 - } 9117 - /** 9118 - * The rigid-body this collider is attached to. 9119 - */ 9120 - parent() { 9121 - return this._parent; 9122 - } 9123 - /** 9124 - * The friction coefficient of this collider. 9125 - */ 9126 - friction() { 9127 - return this.colliderSet.raw.coFriction(this.handle); 9128 - } 9129 - /** 9130 - * The restitution coefficient of this collider. 9131 - */ 9132 - restitution() { 9133 - return this.colliderSet.raw.coRestitution(this.handle); 9134 - } 9135 - /** 9136 - * The density of this collider. 9137 - */ 9138 - density() { 9139 - return this.colliderSet.raw.coDensity(this.handle); 9140 - } 9141 - /** 9142 - * The mass of this collider. 9143 - */ 9144 - mass() { 9145 - return this.colliderSet.raw.coMass(this.handle); 9146 - } 9147 - /** 9148 - * The volume of this collider. 9149 - */ 9150 - volume() { 9151 - return this.colliderSet.raw.coVolume(this.handle); 9152 - } 9153 - /** 9154 - * The collision groups of this collider. 9155 - */ 9156 - collisionGroups() { 9157 - return this.colliderSet.raw.coCollisionGroups(this.handle); 9158 - } 9159 - /** 9160 - * The solver groups of this collider. 9161 - */ 9162 - solverGroups() { 9163 - return this.colliderSet.raw.coSolverGroups(this.handle); 9164 - } 9165 - /** 9166 - * Tests if this collider contains a point. 9167 - * 9168 - * @param point - The point to test. 9169 - */ 9170 - containsPoint(point) { 9171 - let rawPoint = VectorOps.intoRaw(point); 9172 - let result = this.colliderSet.raw.coContainsPoint(this.handle, rawPoint); 9173 - rawPoint.free(); 9174 - return result; 9175 - } 9176 - /** 9177 - * Find the projection of a point on this collider. 9178 - * 9179 - * @param point - The point to project. 9180 - * @param solid - If this is set to `true` then the collider shapes are considered to 9181 - * be plain (if the point is located inside of a plain shape, its projection is the point 9182 - * itself). If it is set to `false` the collider shapes are considered to be hollow 9183 - * (if the point is located inside of an hollow shape, it is projected on the shape's 9184 - * boundary). 9185 - */ 9186 - projectPoint(point, solid) { 9187 - let rawPoint = VectorOps.intoRaw(point); 9188 - let result = PointProjection.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, rawPoint, solid)); 9189 - rawPoint.free(); 9190 - return result; 9191 - } 9192 - /** 9193 - * Tests if this collider intersects the given ray. 9194 - * 9195 - * @param ray - The ray to cast. 9196 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 9197 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 9198 - */ 9199 - intersectsRay(ray, maxToi) { 9200 - let rawOrig = VectorOps.intoRaw(ray.origin); 9201 - let rawDir = VectorOps.intoRaw(ray.dir); 9202 - let result = this.colliderSet.raw.coIntersectsRay(this.handle, rawOrig, rawDir, maxToi); 9203 - rawOrig.free(); 9204 - rawDir.free(); 9205 - return result; 9206 - } 9207 - /* 9208 - * Computes the smallest time between this and the given shape under translational movement are separated by a distance smaller or equal to distance. 9209 - * 9210 - * @param collider1Vel - The constant velocity of the current shape to cast (i.e. the cast direction). 9211 - * @param shape2 - The shape to cast against. 9212 - * @param shape2Pos - The position of the second shape. 9213 - * @param shape2Rot - The rotation of the second shape. 9214 - * @param shape2Vel - The constant velocity of the second shape. 9215 - * @param targetDistance − If the shape moves closer to this distance from a collider, a hit 9216 - * will be returned. 9217 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 9218 - * limits the distance traveled by the shape to `collider1Vel.norm() * maxToi`. 9219 - * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if 9220 - * the shape is penetrating another shape at its starting point **and** its trajectory is such 9221 - * that it’s on a path to exist that penetration state. 9222 - */ 9223 - castShape(collider1Vel, shape2, shape2Pos, shape2Rot, shape2Vel, targetDistance, maxToi, stopAtPenetration) { 9224 - let rawCollider1Vel = VectorOps.intoRaw(collider1Vel); 9225 - let rawShape2Pos = VectorOps.intoRaw(shape2Pos); 9226 - let rawShape2Rot = RotationOps.intoRaw(shape2Rot); 9227 - let rawShape2Vel = VectorOps.intoRaw(shape2Vel); 9228 - let rawShape2 = shape2.intoRaw(); 9229 - let result = ShapeCastHit.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, rawCollider1Vel, rawShape2, rawShape2Pos, rawShape2Rot, rawShape2Vel, targetDistance, maxToi, stopAtPenetration)); 9230 - rawCollider1Vel.free(); 9231 - rawShape2Pos.free(); 9232 - rawShape2Rot.free(); 9233 - rawShape2Vel.free(); 9234 - rawShape2.free(); 9235 - return result; 9236 - } 9237 - /* 9238 - * Computes the smallest time between this and the given collider under translational movement are separated by a distance smaller or equal to distance. 9239 - * 9240 - * @param collider1Vel - The constant velocity of the current collider to cast (i.e. the cast direction). 9241 - * @param collider2 - The collider to cast against. 9242 - * @param collider2Vel - The constant velocity of the second collider. 9243 - * @param targetDistance − If the shape moves closer to this distance from a collider, a hit 9244 - * will be returned. 9245 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 9246 - * limits the distance traveled by the shape to `shapeVel.norm() * maxToi`. 9247 - * @param stopAtPenetration - If set to `false`, the linear shape-cast won’t immediately stop if 9248 - * the shape is penetrating another shape at its starting point **and** its trajectory is such 9249 - * that it’s on a path to exist that penetration state. 9250 - */ 9251 - castCollider(collider1Vel, collider2, collider2Vel, targetDistance, maxToi, stopAtPenetration) { 9252 - let rawCollider1Vel = VectorOps.intoRaw(collider1Vel); 9253 - let rawCollider2Vel = VectorOps.intoRaw(collider2Vel); 9254 - let result = ColliderShapeCastHit.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, rawCollider1Vel, collider2.handle, rawCollider2Vel, targetDistance, maxToi, stopAtPenetration)); 9255 - rawCollider1Vel.free(); 9256 - rawCollider2Vel.free(); 9257 - return result; 9258 - } 9259 - intersectsShape(shape2, shapePos2, shapeRot2) { 9260 - let rawPos2 = VectorOps.intoRaw(shapePos2); 9261 - let rawRot2 = RotationOps.intoRaw(shapeRot2); 9262 - let rawShape2 = shape2.intoRaw(); 9263 - let result = this.colliderSet.raw.coIntersectsShape(this.handle, rawShape2, rawPos2, rawRot2); 9264 - rawPos2.free(); 9265 - rawRot2.free(); 9266 - rawShape2.free(); 9267 - return result; 9268 - } 9269 - /** 9270 - * Computes one pair of contact points between the shape owned by this collider and the given shape. 9271 - * 9272 - * @param shape2 - The second shape. 9273 - * @param shape2Pos - The initial position of the second shape. 9274 - * @param shape2Rot - The rotation of the second shape. 9275 - * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail. 9276 - * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space. 9277 - */ 9278 - contactShape(shape2, shape2Pos, shape2Rot, prediction) { 9279 - let rawPos2 = VectorOps.intoRaw(shape2Pos); 9280 - let rawRot2 = RotationOps.intoRaw(shape2Rot); 9281 - let rawShape2 = shape2.intoRaw(); 9282 - let result = ShapeContact.fromRaw(this.colliderSet.raw.coContactShape(this.handle, rawShape2, rawPos2, rawRot2, prediction)); 9283 - rawPos2.free(); 9284 - rawRot2.free(); 9285 - rawShape2.free(); 9286 - return result; 9287 - } 9288 - /** 9289 - * Computes one pair of contact points between the collider and the given collider. 9290 - * 9291 - * @param collider2 - The second collider. 9292 - * @param prediction - The prediction value, if the shapes are separated by a distance greater than this value, test will fail. 9293 - * @returns `null` if the shapes are separated by a distance greater than prediction, otherwise contact details. The result is given in world-space. 9294 - */ 9295 - contactCollider(collider2, prediction) { 9296 - let result = ShapeContact.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, collider2.handle, prediction)); 9297 - return result; 9298 - } 9299 - /** 9300 - * Find the closest intersection between a ray and this collider. 9301 - * 9302 - * This also computes the normal at the hit point. 9303 - * @param ray - The ray to cast. 9304 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 9305 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 9306 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 9307 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 9308 - * whereas `false` implies that all shapes are hollow for this ray-cast. 9309 - * @returns The time-of-impact between this collider and the ray, or `-1` if there is no intersection. 9310 - */ 9311 - castRay(ray, maxToi, solid) { 9312 - let rawOrig = VectorOps.intoRaw(ray.origin); 9313 - let rawDir = VectorOps.intoRaw(ray.dir); 9314 - let result = this.colliderSet.raw.coCastRay(this.handle, rawOrig, rawDir, maxToi, solid); 9315 - rawOrig.free(); 9316 - rawDir.free(); 9317 - return result; 9318 - } 9319 - /** 9320 - * Find the closest intersection between a ray and this collider. 9321 - * 9322 - * This also computes the normal at the hit point. 9323 - * @param ray - The ray to cast. 9324 - * @param maxToi - The maximum time-of-impact that can be reported by this cast. This effectively 9325 - * limits the length of the ray to `ray.dir.norm() * maxToi`. 9326 - * @param solid - If `false` then the ray will attempt to hit the boundary of a shape, even if its 9327 - * origin already lies inside of a shape. In other terms, `true` implies that all shapes are plain, 9328 - * whereas `false` implies that all shapes are hollow for this ray-cast. 9329 - */ 9330 - castRayAndGetNormal(ray, maxToi, solid) { 9331 - let rawOrig = VectorOps.intoRaw(ray.origin); 9332 - let rawDir = VectorOps.intoRaw(ray.dir); 9333 - let result = RayIntersection.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, rawOrig, rawDir, maxToi, solid)); 9334 - rawOrig.free(); 9335 - rawDir.free(); 9336 - return result; 9337 - } 9338 - }; 9339 - var MassPropsMode; 9340 - (function(MassPropsMode2) { 9341 - MassPropsMode2[MassPropsMode2["Density"] = 0] = "Density"; 9342 - MassPropsMode2[MassPropsMode2["Mass"] = 1] = "Mass"; 9343 - MassPropsMode2[MassPropsMode2["MassProps"] = 2] = "MassProps"; 9344 - })(MassPropsMode || (MassPropsMode = {})); 9345 - var ColliderDesc = class _ColliderDesc { 9346 - /** 9347 - * Initializes a collider descriptor from the collision shape. 9348 - * 9349 - * @param shape - The shape of the collider being built. 9350 - */ 9351 - constructor(shape) { 9352 - this.enabled = true; 9353 - this.shape = shape; 9354 - this.massPropsMode = MassPropsMode.Density; 9355 - this.density = 1; 9356 - this.friction = 0.5; 9357 - this.restitution = 0; 9358 - this.rotation = RotationOps.identity(); 9359 - this.translation = VectorOps.zeros(); 9360 - this.isSensor = false; 9361 - this.collisionGroups = 4294967295; 9362 - this.solverGroups = 4294967295; 9363 - this.frictionCombineRule = CoefficientCombineRule.Average; 9364 - this.restitutionCombineRule = CoefficientCombineRule.Average; 9365 - this.activeCollisionTypes = ActiveCollisionTypes.DEFAULT; 9366 - this.activeEvents = ActiveEvents.NONE; 9367 - this.activeHooks = ActiveHooks.NONE; 9368 - this.mass = 0; 9369 - this.centerOfMass = VectorOps.zeros(); 9370 - this.contactForceEventThreshold = 0; 9371 - this.contactSkin = 0; 9372 - this.principalAngularInertia = 0; 9373 - this.rotationsEnabled = true; 9374 - } 9375 - /** 9376 - * Create a new collider descriptor with a ball shape. 9377 - * 9378 - * @param radius - The radius of the ball. 9379 - */ 9380 - static ball(radius) { 9381 - const shape = new Ball(radius); 9382 - return new _ColliderDesc(shape); 9383 - } 9384 - /** 9385 - * Create a new collider descriptor with a capsule shape. 9386 - * 9387 - * @param halfHeight - The half-height of the capsule, along the `y` axis. 9388 - * @param radius - The radius of the capsule basis. 9389 - */ 9390 - static capsule(halfHeight, radius) { 9391 - const shape = new Capsule(halfHeight, radius); 9392 - return new _ColliderDesc(shape); 9393 - } 9394 - /** 9395 - * Creates a new segment shape. 9396 - * 9397 - * @param a - The first point of the segment. 9398 - * @param b - The second point of the segment. 9399 - */ 9400 - static segment(a, b) { 9401 - const shape = new Segment(a, b); 9402 - return new _ColliderDesc(shape); 9403 - } 9404 - /** 9405 - * Creates a new triangle shape. 9406 - * 9407 - * @param a - The first point of the triangle. 9408 - * @param b - The second point of the triangle. 9409 - * @param c - The third point of the triangle. 9410 - */ 9411 - static triangle(a, b, c) { 9412 - const shape = new Triangle(a, b, c); 9413 - return new _ColliderDesc(shape); 9414 - } 9415 - /** 9416 - * Creates a new triangle shape with round corners. 9417 - * 9418 - * @param a - The first point of the triangle. 9419 - * @param b - The second point of the triangle. 9420 - * @param c - The third point of the triangle. 9421 - * @param borderRadius - The radius of the borders of this triangle. In 3D, 9422 - * this is also equal to half the thickness of the triangle. 9423 - */ 9424 - static roundTriangle(a, b, c, borderRadius) { 9425 - const shape = new RoundTriangle(a, b, c, borderRadius); 9426 - return new _ColliderDesc(shape); 9427 - } 9428 - /** 9429 - * Creates a new collider descriptor with a polyline shape. 9430 - * 9431 - * @param vertices - The coordinates of the polyline's vertices. 9432 - * @param indices - The indices of the polyline's segments. If this is `undefined` or `null`, 9433 - * the vertices are assumed to describe a line strip. 9434 - */ 9435 - static polyline(vertices, indices) { 9436 - const shape = new Polyline(vertices, indices); 9437 - return new _ColliderDesc(shape); 9438 - } 9439 - /** 9440 - * Creates a new collider descriptor with a triangle mesh shape. 9441 - * 9442 - * @param vertices - The coordinates of the triangle mesh's vertices. 9443 - * @param indices - The indices of the triangle mesh's triangles. 9444 - */ 9445 - static trimesh(vertices, indices, flags) { 9446 - const shape = new TriMesh(vertices, indices, flags); 9447 - return new _ColliderDesc(shape); 9448 - } 9449 - // #if DIM2 9450 - /** 9451 - * Creates a new collider descriptor with a rectangular shape. 9452 - * 9453 - * @param hx - The half-width of the rectangle along its local `x` axis. 9454 - * @param hy - The half-width of the rectangle along its local `y` axis. 9455 - */ 9456 - static cuboid(hx, hy) { 9457 - const shape = new Cuboid(hx, hy); 9458 - return new _ColliderDesc(shape); 9459 - } 9460 - /** 9461 - * Creates a new collider descriptor with a rectangular shape with round borders. 9462 - * 9463 - * @param hx - The half-width of the rectangle along its local `x` axis. 9464 - * @param hy - The half-width of the rectangle along its local `y` axis. 9465 - * @param borderRadius - The radius of the cuboid's borders. 9466 - */ 9467 - static roundCuboid(hx, hy, borderRadius) { 9468 - const shape = new RoundCuboid(hx, hy, borderRadius); 9469 - return new _ColliderDesc(shape); 9470 - } 9471 - /** 9472 - * Creates a new collider description with a halfspace (infinite plane) shape. 9473 - * 9474 - * @param normal - The outward normal of the plane. 9475 - */ 9476 - static halfspace(normal) { 9477 - const shape = new HalfSpace(normal); 9478 - return new _ColliderDesc(shape); 9479 - } 9480 - /** 9481 - * Creates a new collider descriptor with a heightfield shape. 9482 - * 9483 - * @param heights - The heights of the heightfield, along its local `y` axis. 9484 - * @param scale - The scale factor applied to the heightfield. 9485 - */ 9486 - static heightfield(heights, scale) { 9487 - const shape = new Heightfield(heights, scale); 9488 - return new _ColliderDesc(shape); 9489 - } 9490 - /** 9491 - * Computes the convex-hull of the given points and use the resulting 9492 - * convex polygon as the shape for this new collider descriptor. 9493 - * 9494 - * @param points - The point that will be used to compute the convex-hull. 9495 - */ 9496 - static convexHull(points) { 9497 - const shape = new ConvexPolygon(points, false); 9498 - return new _ColliderDesc(shape); 9499 - } 9500 - /** 9501 - * Creates a new collider descriptor that uses the given set of points assumed 9502 - * to form a convex polyline (no convex-hull computation will be done). 9503 - * 9504 - * @param vertices - The vertices of the convex polyline. 9505 - */ 9506 - static convexPolyline(vertices) { 9507 - const shape = new ConvexPolygon(vertices, true); 9508 - return new _ColliderDesc(shape); 9509 - } 9510 - /** 9511 - * Computes the convex-hull of the given points and use the resulting 9512 - * convex polygon as the shape for this new collider descriptor. A 9513 - * border is added to that convex polygon to give it round corners. 9514 - * 9515 - * @param points - The point that will be used to compute the convex-hull. 9516 - * @param borderRadius - The radius of the round border added to the convex polygon. 9517 - */ 9518 - static roundConvexHull(points, borderRadius) { 9519 - const shape = new RoundConvexPolygon(points, borderRadius, false); 9520 - return new _ColliderDesc(shape); 9521 - } 9522 - /** 9523 - * Creates a new collider descriptor that uses the given set of points assumed 9524 - * to form a round convex polyline (no convex-hull computation will be done). 9525 - * 9526 - * @param vertices - The vertices of the convex polyline. 9527 - * @param borderRadius - The radius of the round border added to the convex polyline. 9528 - */ 9529 - static roundConvexPolyline(vertices, borderRadius) { 9530 - const shape = new RoundConvexPolygon(vertices, borderRadius, true); 9531 - return new _ColliderDesc(shape); 9532 - } 9533 - // #endif 9534 - // #if DIM2 9535 - /** 9536 - * Sets the position of the collider to be created relative to the rigid-body it is attached to. 9537 - */ 9538 - setTranslation(x, y) { 9539 - if (typeof x != "number" || typeof y != "number") 9540 - throw TypeError("The translation components must be numbers."); 9541 - this.translation = { x, y }; 9542 - return this; 9543 - } 9544 - // #endif 9545 - /** 9546 - * Sets the rotation of the collider to be created relative to the rigid-body it is attached to. 9547 - * 9548 - * @param rot - The rotation of the collider to be created relative to the rigid-body it is attached to. 9549 - */ 9550 - setRotation(rot) { 9551 - this.rotation = rot; 9552 - return this; 9553 - } 9554 - /** 9555 - * Sets whether or not the collider being created is a sensor. 9556 - * 9557 - * A sensor collider does not take part of the physics simulation, but generates 9558 - * proximity events. 9559 - * 9560 - * @param sensor - Set to `true` of the collider built is to be a sensor. 9561 - */ 9562 - setSensor(sensor) { 9563 - this.isSensor = sensor; 9564 - return this; 9565 - } 9566 - /** 9567 - * Sets whether the created collider will be enabled or disabled. 9568 - * @param enabled − If set to `false` the collider will be disabled at creation. 9569 - */ 9570 - setEnabled(enabled) { 9571 - this.enabled = enabled; 9572 - return this; 9573 - } 9574 - /** 9575 - * Sets the contact skin of the collider. 9576 - * 9577 - * The contact skin acts as if the collider was enlarged with a skin of width `skin_thickness` 9578 - * around it, keeping objects further apart when colliding. 9579 - * 9580 - * A non-zero contact skin can increase performance, and in some cases, stability. However 9581 - * it creates a small gap between colliding object (equal to the sum of their skin). If the 9582 - * skin is sufficiently small, this might not be visually significant or can be hidden by the 9583 - * rendering assets. 9584 - */ 9585 - setContactSkin(thickness) { 9586 - this.contactSkin = thickness; 9587 - return this; 9588 - } 9589 - /** 9590 - * Sets the density of the collider being built. 9591 - * 9592 - * The mass and angular inertia tensor will be computed automatically based on this density and the collider’s shape. 9593 - * 9594 - * @param density - The density to set, must be greater or equal to 0. A density of 0 means that this collider 9595 - * will not affect the mass or angular inertia of the rigid-body it is attached to. 9596 - */ 9597 - setDensity(density) { 9598 - this.massPropsMode = MassPropsMode.Density; 9599 - this.density = density; 9600 - return this; 9601 - } 9602 - /** 9603 - * Sets the mass of the collider being built. 9604 - * 9605 - * The angular inertia tensor will be computed automatically based on this mass and the collider’s shape. 9606 - * 9607 - * @param mass - The mass to set, must be greater or equal to 0. 9608 - */ 9609 - setMass(mass) { 9610 - this.massPropsMode = MassPropsMode.Mass; 9611 - this.mass = mass; 9612 - return this; 9613 - } 9614 - // #if DIM2 9615 - /** 9616 - * Sets the mass properties of the collider being built. 9617 - * 9618 - * This replaces the mass-properties automatically computed from the collider's density and shape. 9619 - * These mass-properties will be added to the mass-properties of the rigid-body this collider will be attached to. 9620 - * 9621 - * @param mass − The mass of the collider to create. 9622 - * @param centerOfMass − The center-of-mass of the collider to create. 9623 - * @param principalAngularInertia − The principal angular inertia of the collider to create. 9624 - */ 9625 - setMassProperties(mass, centerOfMass, principalAngularInertia) { 9626 - this.massPropsMode = MassPropsMode.MassProps; 9627 - this.mass = mass; 9628 - VectorOps.copy(this.centerOfMass, centerOfMass); 9629 - this.principalAngularInertia = principalAngularInertia; 9630 - return this; 9631 - } 9632 - // #endif 9633 - /** 9634 - * Sets the restitution coefficient of the collider to be created. 9635 - * 9636 - * @param restitution - The restitution coefficient in `[0, 1]`. A value of 0 (the default) means no bouncing behavior 9637 - * while 1 means perfect bouncing (though energy may still be lost due to numerical errors of the 9638 - * constraints solver). 9639 - */ 9640 - setRestitution(restitution) { 9641 - this.restitution = restitution; 9642 - return this; 9643 - } 9644 - /** 9645 - * Sets the friction coefficient of the collider to be created. 9646 - * 9647 - * @param friction - The friction coefficient. Must be greater or equal to 0. This is generally smaller than 1. The 9648 - * higher the coefficient, the stronger friction forces will be for contacts with the collider 9649 - * being built. 9650 - */ 9651 - setFriction(friction) { 9652 - this.friction = friction; 9653 - return this; 9654 - } 9655 - /** 9656 - * Sets the rule used to combine the friction coefficients of two colliders 9657 - * colliders involved in a contact. 9658 - * 9659 - * @param rule − The combine rule to apply. 9660 - */ 9661 - setFrictionCombineRule(rule) { 9662 - this.frictionCombineRule = rule; 9663 - return this; 9664 - } 9665 - /** 9666 - * Sets the rule used to combine the restitution coefficients of two colliders 9667 - * colliders involved in a contact. 9668 - * 9669 - * @param rule − The combine rule to apply. 9670 - */ 9671 - setRestitutionCombineRule(rule) { 9672 - this.restitutionCombineRule = rule; 9673 - return this; 9674 - } 9675 - /** 9676 - * Sets the collision groups used by this collider. 9677 - * 9678 - * Two colliders will interact iff. their collision groups are compatible. 9679 - * See the documentation of `InteractionGroups` for details on teh used bit pattern. 9680 - * 9681 - * @param groups - The collision groups used for the collider being built. 9682 - */ 9683 - setCollisionGroups(groups) { 9684 - this.collisionGroups = groups; 9685 - return this; 9686 - } 9687 - /** 9688 - * Sets the solver groups used by this collider. 9689 - * 9690 - * Forces between two colliders in contact will be computed iff their solver 9691 - * groups are compatible. 9692 - * See the documentation of `InteractionGroups` for details on the used bit pattern. 9693 - * 9694 - * @param groups - The solver groups used for the collider being built. 9695 - */ 9696 - setSolverGroups(groups) { 9697 - this.solverGroups = groups; 9698 - return this; 9699 - } 9700 - /** 9701 - * Set the physics hooks active for this collider. 9702 - * 9703 - * Use this to enable custom filtering rules for contact/intersecstion pairs involving this collider. 9704 - * 9705 - * @param activeHooks - The hooks active for contact/intersection pairs involving this collider. 9706 - */ 9707 - setActiveHooks(activeHooks) { 9708 - this.activeHooks = activeHooks; 9709 - return this; 9710 - } 9711 - /** 9712 - * Set the events active for this collider. 9713 - * 9714 - * Use this to enable contact and/or intersection event reporting for this collider. 9715 - * 9716 - * @param activeEvents - The events active for contact/intersection pairs involving this collider. 9717 - */ 9718 - setActiveEvents(activeEvents) { 9719 - this.activeEvents = activeEvents; 9720 - return this; 9721 - } 9722 - /** 9723 - * Set the collision types active for this collider. 9724 - * 9725 - * @param activeCollisionTypes - The hooks active for contact/intersection pairs involving this collider. 9726 - */ 9727 - setActiveCollisionTypes(activeCollisionTypes) { 9728 - this.activeCollisionTypes = activeCollisionTypes; 9729 - return this; 9730 - } 9731 - /** 9732 - * Sets the total force magnitude beyond which a contact force event can be emitted. 9733 - * 9734 - * @param threshold - The force threshold to set. 9735 - */ 9736 - setContactForceEventThreshold(threshold) { 9737 - this.contactForceEventThreshold = threshold; 9738 - return this; 9739 - } 9740 - }; 9741 - 9742 - // ../node_modules/@dimforge/rapier2d/geometry/collider_set.js 9743 - var ColliderSet = class { 9744 - constructor(raw) { 9745 - this.raw = raw || new RawColliderSet(); 9746 - this.map = new Coarena(); 9747 - if (raw) { 9748 - raw.forEachColliderHandle((handle) => { 9749 - this.map.set(handle, new Collider(this, handle, null)); 9750 - }); 9751 - } 9752 - } 9753 - /** 9754 - * Release the WASM memory occupied by this collider set. 9755 - */ 9756 - free() { 9757 - if (!!this.raw) { 9758 - this.raw.free(); 9759 - } 9760 - this.raw = void 0; 9761 - if (!!this.map) { 9762 - this.map.clear(); 9763 - } 9764 - this.map = void 0; 9765 - } 9766 - /** @internal */ 9767 - castClosure(f) { 9768 - return (handle) => { 9769 - if (!!f) { 9770 - return f(this.get(handle)); 9771 - } else { 9772 - return void 0; 9773 - } 9774 - }; 9775 - } 9776 - /** @internal */ 9777 - finalizeDeserialization(bodies) { 9778 - this.map.forEach((collider) => collider.finalizeDeserialization(bodies)); 9779 - } 9780 - /** 9781 - * Creates a new collider and return its integer handle. 9782 - * 9783 - * @param bodies - The set of bodies where the collider's parent can be found. 9784 - * @param desc - The collider's description. 9785 - * @param parentHandle - The integer handle of the rigid-body this collider is attached to. 9786 - */ 9787 - createCollider(bodies, desc, parentHandle) { 9788 - let hasParent = parentHandle != void 0 && parentHandle != null; 9789 - if (hasParent && isNaN(parentHandle)) 9790 - throw Error("Cannot create a collider with a parent rigid-body handle that is not a number."); 9791 - let rawShape = desc.shape.intoRaw(); 9792 - let rawTra = VectorOps.intoRaw(desc.translation); 9793 - let rawRot = RotationOps.intoRaw(desc.rotation); 9794 - let rawCom = VectorOps.intoRaw(desc.centerOfMass); 9795 - let handle = this.raw.createCollider( 9796 - desc.enabled, 9797 - rawShape, 9798 - rawTra, 9799 - rawRot, 9800 - desc.massPropsMode, 9801 - desc.mass, 9802 - rawCom, 9803 - // #if DIM2 9804 - desc.principalAngularInertia, 9805 - // #endif 9806 - desc.density, 9807 - desc.friction, 9808 - desc.restitution, 9809 - desc.frictionCombineRule, 9810 - desc.restitutionCombineRule, 9811 - desc.isSensor, 9812 - desc.collisionGroups, 9813 - desc.solverGroups, 9814 - desc.activeCollisionTypes, 9815 - desc.activeHooks, 9816 - desc.activeEvents, 9817 - desc.contactForceEventThreshold, 9818 - desc.contactSkin, 9819 - hasParent, 9820 - hasParent ? parentHandle : 0, 9821 - bodies.raw 9822 - ); 9823 - rawShape.free(); 9824 - rawTra.free(); 9825 - rawRot.free(); 9826 - rawCom.free(); 9827 - let parent = hasParent ? bodies.get(parentHandle) : null; 9828 - let collider = new Collider(this, handle, parent, desc.shape); 9829 - this.map.set(handle, collider); 9830 - return collider; 9831 - } 9832 - /** 9833 - * Remove a collider from this set. 9834 - * 9835 - * @param handle - The integer handle of the collider to remove. 9836 - * @param bodies - The set of rigid-body containing the rigid-body the collider is attached to. 9837 - * @param wakeUp - If `true`, the rigid-body the removed collider is attached to will be woken-up automatically. 9838 - */ 9839 - remove(handle, islands, bodies, wakeUp) { 9840 - this.raw.remove(handle, islands.raw, bodies.raw, wakeUp); 9841 - this.unmap(handle); 9842 - } 9843 - /** 9844 - * Internal function, do not call directly. 9845 - * @param handle 9846 - */ 9847 - unmap(handle) { 9848 - this.map.delete(handle); 9849 - } 9850 - /** 9851 - * Gets the rigid-body with the given handle. 9852 - * 9853 - * @param handle - The handle of the rigid-body to retrieve. 9854 - */ 9855 - get(handle) { 9856 - return this.map.get(handle); 9857 - } 9858 - /** 9859 - * The number of colliders on this set. 9860 - */ 9861 - len() { 9862 - return this.map.len(); 9863 - } 9864 - /** 9865 - * Does this set contain a collider with the given handle? 9866 - * 9867 - * @param handle - The collider handle to check. 9868 - */ 9869 - contains(handle) { 9870 - return this.get(handle) != null; 9871 - } 9872 - /** 9873 - * Applies the given closure to each collider contained by this set. 9874 - * 9875 - * @param f - The closure to apply. 9876 - */ 9877 - forEach(f) { 9878 - this.map.forEach(f); 9879 - } 9880 - /** 9881 - * Gets all colliders in the list. 9882 - * 9883 - * @returns collider list. 9884 - */ 9885 - getAll() { 9886 - return this.map.getAll(); 9887 - } 9888 - }; 9889 - 9890 - // ../node_modules/@dimforge/rapier2d/exports.js 9891 - function version2() { 9892 - return version(); 9893 - } 9894 - 9895 - // ../node_modules/@dimforge/rapier2d/rapier.js 9896 - var rapier_default = exports_exports; 9897 - export { 9898 - ActiveCollisionTypes, 9899 - ActiveEvents, 9900 - ActiveHooks, 9901 - Ball, 9902 - BroadPhase, 9903 - CCDSolver, 9904 - Capsule, 9905 - CharacterCollision, 9906 - CoefficientCombineRule, 9907 - Collider, 9908 - ColliderDesc, 9909 - ColliderSet, 9910 - ColliderShapeCastHit, 9911 - ConvexPolygon, 9912 - Cuboid, 9913 - DebugRenderBuffers, 9914 - DebugRenderPipeline, 9915 - EventQueue, 9916 - FeatureType, 9917 - FixedImpulseJoint, 9918 - FixedMultibodyJoint, 9919 - HalfSpace, 9920 - Heightfield, 9921 - ImpulseJoint, 9922 - ImpulseJointSet, 9923 - IntegrationParameters, 9924 - IslandManager, 9925 - JointAxesMask, 9926 - JointData, 9927 - JointType, 9928 - KinematicCharacterController, 9929 - MassPropsMode, 9930 - MotorModel, 9931 - MultibodyJoint, 9932 - MultibodyJointSet, 9933 - NarrowPhase, 9934 - PhysicsPipeline, 9935 - PointColliderProjection, 9936 - PointProjection, 9937 - Polyline, 9938 - PrismaticImpulseJoint, 9939 - PrismaticMultibodyJoint, 9940 - QueryFilterFlags, 9941 - QueryPipeline, 9942 - Ray, 9943 - RayColliderHit, 9944 - RayColliderIntersection, 9945 - RayIntersection, 9946 - RevoluteImpulseJoint, 9947 - RevoluteMultibodyJoint, 9948 - RigidBody, 9949 - RigidBodyDesc, 9950 - RigidBodySet, 9951 - RigidBodyType, 9952 - RopeImpulseJoint, 9953 - RotationOps, 9954 - RoundConvexPolygon, 9955 - RoundCuboid, 9956 - RoundTriangle, 9957 - Segment, 9958 - SerializationPipeline, 9959 - Shape, 9960 - ShapeCastHit, 9961 - ShapeContact, 9962 - ShapeType, 9963 - SolverFlags, 9964 - SpringImpulseJoint, 9965 - TempContactForceEvent, 9966 - TempContactManifold, 9967 - TriMesh, 9968 - TriMeshFlags, 9969 - Triangle, 9970 - UnitImpulseJoint, 9971 - UnitMultibodyJoint, 9972 - Vector2, 9973 - VectorOps, 9974 - World, 9975 - rapier_default as default, 9976 - version2 as version 9977 - }; 9978 - //# sourceMappingURL=@dimforge_rapier2d.js.map
-7
.vite/deps/@dimforge_rapier2d.js.map
··· 1 - { 2 - "version": 3, 3 - "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"], 4 - "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"], 5 - "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,KAAK;AACxB,MAAI,cAAc,KAAK,OAAQ,MAAK,KAAK,KAAK,SAAS,CAAC;AACxD,QAAM,MAAM;AACZ,cAAY,KAAK,GAAG;AAEpB,OAAK,GAAG,IAAI;AACZ,SAAO;AACX;AAEA,SAAS,UAAU,KAAK;AAAE,SAAO,KAAK,GAAG;AAAG;AAE5C,SAAS,WAAW,KAAK;AACrB,MAAI,MAAM,IAAK;AACf,OAAK,GAAG,IAAI;AACZ,cAAY;AAChB;AAEA,SAAS,WAAW,KAAK;AACrB,QAAM,MAAM,UAAU,GAAG;AACzB,aAAW,GAAG;AACd,SAAO;AACX;AAEA,SAAS,WAAW,GAAG;AACnB,SAAO,MAAM,UAAa,M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;AAGhD,QAAI,SAAS,KAAK,IAAI;MAClB,KAAK;MACL;MACA;MACA;MACA,KAAK;MACL,KAAK;MACL;;MAEA,KAAK;;MAEL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL;MACA,YAAY,eAAe;MAC3B,OAAO;IAAG;AAGd,aAAS,KAAI;AACb,WAAO,KAAI;AACX,WAAO,KAAI;AACX,WAAO,KAAI;AAGX,QAAI,SAAS,YAAY,OAAO,IAAI,YAAY,IAAI;AACpD,QAAI,WAAW,IAAI,SAAS,MAAM,QAAQ,QAAQ,KAAK,KAAK;AAC5D,SAAK,IAAI,IAAI,QAAQ,QAAQ;AAC7B,WAAO;EACX;;;;;;;;EASO,OACH,QACA,SACA,QACA,QAAe;AAEf,SAAK,IAAI,OAAO,QAAQ,QAAQ,KAAK,OAAO,KAAK,MAAM;AACvD,SAAK,MAAM,MAAM;EACrB;;;;;EAMO,MAAM,QAA0B;AACnC,SAAK,IAAI,OAAO,MAAM;EAC1B;;;;;;EAOO,IAAI,QAAsB;AAC7B,WAAO,KAAK,IAAI,IAAI,MAAM;EAC9B;;;;EAKO,MAAG;AACN,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;", 6 - "names": ["version", "wasm", "wasm", "RigidBodyType", "handle", "JointType", "MotorModel", "JointAxesMask", "CoefficientCombineRule", "FeatureType", "ShapeType", "TriMeshFlags", "QueryFilterFlags", "ActiveEvents", "ActiveHooks", "SolverFlags", "ActiveCollisionTypes", "MassPropsMode", "version"] 7 - }
-15
.vite/deps/_metadata.json
··· 1 - { 2 - "hash": "d0485ddc", 3 - "configHash": "985705a5", 4 - "lockfileHash": "b5d138d8", 5 - "browserHash": "38595cdb", 6 - "optimized": { 7 - "@dimforge/rapier2d": { 8 - "src": "../../../node_modules/@dimforge/rapier2d/rapier.js", 9 - "file": "@dimforge_rapier2d.js", 10 - "fileHash": "6f166c03", 11 - "needsInterop": false 12 - } 13 - }, 14 - "chunks": {} 15 - }
-3
.vite/deps/package.json
··· 1 - { 2 - "type": "module" 3 - }
light.png public/light.png
+3 -3
src/app.ts
··· 123 123 } 124 124 125 125 if (enemy && projectile) { 126 - this.spawnParticles(projectile.shape.x, projectile.shape.y, 10); 126 + this.spawnParticles(projectile.shape.x, projectile.shape.y, 10, this.player?.color); 127 127 128 128 enemy.takeDamage(projectile.damage); 129 129 projectile.destroy(); ··· 131 131 }); 132 132 } 133 133 134 - spawnParticles(x: number, y: number, num: number) { 134 + spawnParticles(x: number, y: number, num: number, color: number = 0xffffff) { 135 135 for (let i = 0; i < num; i++) { 136 136 this.particleSystem?.createParticle( 137 137 x, 138 138 y, 139 139 Math.random() * 5 + 5, // size 140 - this.player?.color ?? 0xffffff, // color 140 + color, // color 141 141 Math.random() * 0.5 + 0.5, // alpha 142 142 (Math.random() - 0.5) * 0.3, // speedX 143 143 (Math.random() - 0.5) * 0.3, // speedY
+12 -2
src/enemy-manager.ts
··· 29 29 }); 30 30 } 31 31 32 - getClosestEnemy(position: { x: number; y: number }): Enemy | undefined { 32 + getClosestEnemy(position: { x: number; y: number }, maxDist: number): Enemy | undefined { 33 33 let point = { x: position.x, y: -position.y }; 34 34 let solid = true; 35 35 ··· 37 37 38 38 if (proj) { 39 39 let enemy = proj.collider.parent()?.userData as Enemy; 40 - return enemy; 40 + 41 + if (!enemy) return; 42 + 43 + // check if enemy is within max distance 44 + const dist = Math.sqrt( 45 + (enemy.enemyContainer.x - position.x) ** 2 + (enemy.enemyContainer.y - position.y) ** 2 46 + ); 47 + 48 + if (dist < maxDist) { 49 + return enemy; 50 + } 41 51 } 42 52 } 43 53 }
+22 -5
src/enemy.ts
··· 37 37 this.size = 30; 38 38 39 39 this.enemyContainer = new PIXI.Container(); 40 + 41 + 40 42 this.enemyContainer.x = Math.random() * 800 - 400; 41 43 this.enemyContainer.y = Math.random() * 800 - 400; 42 44 45 + // get player position 46 + let position = this.game.player?.position; 47 + if (position) { 48 + // create random direction vector 49 + let point = { x: Math.random() - 0.5, y: Math.random() - 0.5 }; 50 + // set length to 600 (normalize and mutliply) 51 + let length = 600; 52 + let norm = Math.sqrt(point.x * point.x + point.y * point.y); 53 + point.x = (point.x / norm) * length; 54 + point.y = (point.y / norm) * length; 55 + 56 + this.enemyContainer.x = position.x + point.x; 57 + this.enemyContainer.y = position.y + point.y; 58 + } 59 + 43 60 game.container.addChild(this.enemyContainer); 44 61 45 62 this.shape = new PIXI.Graphics().circle(0, 0, this.size / 2).fill(0x070707); 46 - //this.shape.pivot.set(this.size / 2, this.size / 2); 47 63 this.enemyContainer.addChild(this.shape); 48 64 49 65 this.maxHealth = 100; ··· 141 157 142 158 // Only move if not too close to the player and not exploding 143 159 if (distance > this.size + 10 && !this.exploding) { 144 - // this.x += (dx / distance) * this.speed * deltaTime; 145 - // this.y += (dy / distance) * this.speed * deltaTime; 146 - 147 160 // lets add some force instead of moving it directly, the further away the player, the more force 148 161 const force = 500; 149 162 ··· 152 165 153 166 this.rigidBody?.applyImpulse({ x: x * force, y: -y * force }, true); 154 167 } else if (!this.exploding) { 155 - //this.exploding = true; 168 + this.exploding = true; 156 169 this.destroyTime = 2000; 157 170 } else { 158 171 this.destroyTime -= deltaTime; ··· 162 175 if (distance < this.size + 20) { 163 176 player.takeDamage(20); 164 177 } 178 + return; 165 179 } 166 180 } 167 181 ··· 169 183 } 170 184 171 185 destroy() { 186 + this.game.spawnParticles(this.x, this.y, 50, 0); 187 + 172 188 this.destroyed = true; 173 189 // remove the square 190 + this.enemyContainer.destroy(); 174 191 this.shape.destroy(); 175 192 if (this.rigidBody) this.game.world.removeRigidBody(this.rigidBody); 176 193 }
-1
src/particles.ts
··· 75 75 } 76 76 77 77 update(delta: number): void { 78 - console.log('update particles', this.particles.length); 79 78 for (let i = this.particles.length - 1; i >= 0; i--) { 80 79 const particle = this.particles[i]; 81 80 particle.x += particle.speedX * delta;
+3 -13
src/player.ts
··· 4 4 import Game from './app'; 5 5 import { RAPIER } from './rapier'; 6 6 import { type RigidBody } from '@dimforge/rapier2d'; 7 - import EnemyManager from './enemy-manager.js'; 8 7 9 8 /** 10 9 * Player class ··· 73 72 } 74 73 75 74 async createLight() { 76 - // const light = new PIXI.Graphics(); 77 - 78 - // // make a light source by drawing a circle with some opacity and getting smaller and smaller 79 - // for (let i = 0; i < 100; i++) { 80 - // const alpha = 0.1 * Math.pow(1 - i / 100, 4); 81 - // const radius = i * 4; 82 - // light.circle(0, 0, radius).fill({ color: 0xffffff, alpha }); 83 - // } 84 - 85 - // this.playerContainer.addChild(light); 86 - 87 75 const texture = await PIXI.Assets.load('/light.png'); 88 76 const light = PIXI.Sprite.from(texture); 89 77 light.anchor.set(0.5); ··· 168 156 this.y += dy * this.speed * deltaTime; 169 157 170 158 // get closest enemy 171 - const closestEnemy = this.game.enemyManager?.getClosestEnemy(this.position); 159 + const closestEnemy = this.game.enemyManager?.getClosestEnemy(this.position, 200); 160 + 161 + // 172 162 173 163 if (closestEnemy) { 174 164 this.weapon.fire(this.position, closestEnemy.position);
+2 -3
src/weapon.ts
··· 1 - import * as PIXI from 'pixi.js'; 2 1 import Game from './app'; 3 2 import { Projectile } from './projectile'; 4 3 ··· 76 75 77 76 if (distanceSquared > 1000000) { 78 77 // 1000 units squared 79 - projectile.destroy(this.game); 78 + projectile.destroy(); 80 79 this.projectiles.splice(i, 1); 81 80 } 82 81 } ··· 84 83 85 84 clearAllProjectiles() { 86 85 for (let projectile of this.projectiles) { 87 - projectile.destroy(this.game); 86 + projectile.destroy(); 88 87 } 89 88 this.projectiles = []; 90 89 }
+4 -1
vite.config.js
··· 3 3 4 4 // https://vitejs.dev/config/ 5 5 export default defineConfig({ 6 - plugins: [wasm()] 6 + plugins: [wasm()], 7 + build: { 8 + target: 'esnext' 9 + } 7 10 });