diff --git a/packages/engine/src/math/color.rs b/packages/engine/src/math/color.rs index ed181b9a..b344a833 100644 --- a/packages/engine/src/math/color.rs +++ b/packages/engine/src/math/color.rs @@ -12,6 +12,7 @@ use bytemuck::{Pod, Zeroable}; /// /// # Examples | 示例 /// ```rust +/// use es_engine::math::Color; /// let red = Color::RED; /// let custom = Color::new(0.5, 0.7, 0.3, 1.0); /// let packed = custom.to_packed(); // For GPU diff --git a/packages/engine/src/math/rect.rs b/packages/engine/src/math/rect.rs index d1382019..73e7acb0 100644 --- a/packages/engine/src/math/rect.rs +++ b/packages/engine/src/math/rect.rs @@ -8,6 +8,7 @@ use super::Vec2; /// /// # Examples | 示例 /// ```rust +/// use es_engine::math::{Rect, Vec2}; /// let rect = Rect::new(10.0, 20.0, 100.0, 50.0); /// let point = Vec2::new(50.0, 40.0); /// assert!(rect.contains_point(point)); diff --git a/packages/engine/src/math/transform.rs b/packages/engine/src/math/transform.rs index ea6d3969..37183faf 100644 --- a/packages/engine/src/math/transform.rs +++ b/packages/engine/src/math/transform.rs @@ -9,6 +9,7 @@ use glam::Mat3; /// /// # Examples | 示例 /// ```rust +/// use es_engine::math::{Transform2D, Vec2}; /// let mut transform = Transform2D::new(); /// transform.position = Vec2::new(100.0, 200.0); /// transform.rotation = std::f32::consts::PI / 4.0; // 45 degrees diff --git a/packages/engine/src/math/vec2.rs b/packages/engine/src/math/vec2.rs index 254a3e9f..991af15b 100644 --- a/packages/engine/src/math/vec2.rs +++ b/packages/engine/src/math/vec2.rs @@ -8,6 +8,7 @@ use bytemuck::{Pod, Zeroable}; /// /// # Examples | 示例 /// ```rust +/// use es_engine::math::Vec2; /// let pos = Vec2::new(100.0, 200.0); /// let velocity = Vec2::new(1.0, 0.0); /// let new_pos = pos + velocity * 16.0; diff --git a/packages/rapier2d/pkg/.gitignore b/packages/rapier2d/pkg/.gitignore new file mode 100644 index 00000000..f59ec20a --- /dev/null +++ b/packages/rapier2d/pkg/.gitignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/packages/rapier2d/pkg/LICENSE b/packages/rapier2d/pkg/LICENSE new file mode 100644 index 00000000..e579674d --- /dev/null +++ b/packages/rapier2d/pkg/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Dimforge EURL + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/rapier2d/pkg/README.md b/packages/rapier2d/pkg/README.md new file mode 100644 index 00000000..013aa34d --- /dev/null +++ b/packages/rapier2d/pkg/README.md @@ -0,0 +1,70 @@ +

+ crates.io +

+

+ + + + + Build status + + + crates.io + + + npm version + + + + +

+

+ + Website | Documentation + +

+ +--- + +

+2D physics engine +for the JavaScript programming language (official bindings). +

+ +--- + +## Feature selection + +Multiple NPM packages exist for Rapier, depending on your needs: +- [`@dimforge/rapier2d`](https://www.npmjs.com/package/@dimforge/rapier2d) or + [`@dimforge/rapier3d`](https://www.npmjs.com/package/@dimforge/rapier3d): + The main build of the Rapier physics engine for 2D or 3D physics simulation. This should have wide browser + support while offering great performances. This does **not** guarantee cross-platform determinism of the physics + simulation (but it is still locally deterministic, on the same machine). +- [`@dimforge/rapier2d-simd`](https://www.npmjs.com/package/@dimforge/rapier2d-simd) or + [`@dimforge/rapier3d-simd`](https://www.npmjs.com/package/@dimforge/rapier3d-simd): + A build with internal SIMD optimizations enabled. More limited browser support (requires support for [simd128](https://caniuse.com/?search=simd)). +- [`@dimforge/rapier2d-deterministic`](https://www.npmjs.com/package/@dimforge/rapier2d-deterministic) or + [`@dimforge/rapier3d-deterministic`](https://www.npmjs.com/package/@dimforge/rapier3d-deterministic): + A less optimized build but with a guarantee of a cross-platform deterministic execution of the physics simulation. + +## Bundler support + +Some bundlers will struggle with the `.wasm` file package into the builds above. Alternative `-compat` versions exist +which embed the `.wasm` file into the `.js` sources encoded with base64. This results in a bigger package size, but +much wider bundler support. + +Just append `-compat` to the build you are interested in: +[`rapier2d-compat`](https://www.npmjs.com/package/@dimforge/rapier2d-compat), +[`rapier2d-simd-compat`](https://www.npmjs.com/package/@dimforge/rapier2d-simd-compat), +[`rapier2d-deterministic-compat`](https://www.npmjs.com/package/@dimforge/rapier2d-deterministic-compat), +[`rapier3d-compat`](https://www.npmjs.com/package/@dimforge/rapier3d-compat), +[`rapier3d-simd-compat`](https://www.npmjs.com/package/@dimforge/rapier3d-simd-compat), +[`rapier3d-deterministic-compat`](https://www.npmjs.com/package/@dimforge/rapier3d-deterministic-compat). + +## Nightly builds + +Each time a new Pull Request is merged to the `main` branch of the [`rapier.js` repository](https://github.com/dimforge/rapier.js), +an automatic _canary_ build is triggered. Builds published to npmjs under the _canary_ tag does not come with any +stability guarantee and does not follow semver versioning. But it can be a useful solution to try out the latest +features until a proper release is cut. \ No newline at end of file diff --git a/packages/rapier2d/pkg/package.json b/packages/rapier2d/pkg/package.json new file mode 100644 index 00000000..471a17c7 --- /dev/null +++ b/packages/rapier2d/pkg/package.json @@ -0,0 +1,32 @@ +{ + "name": "dimforge_rapier2d-deterministic", + "type": "module", + "collaborators": [ + "Sébastien Crozet " + ], + "description": "2-dimensional physics engine in Rust - official JS bindings.", + "version": "0.19.3", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/dimforge/rapier.js" + }, + "files": [ + "rapier_wasm2d_bg.wasm", + "rapier_wasm2d.js", + "rapier_wasm2d.d.ts" + ], + "main": "rapier_wasm2d.js", + "homepage": "https://rapier.rs", + "types": "rapier_wasm2d.d.ts", + "sideEffects": [ + "./snippets/*" + ], + "keywords": [ + "physics", + "dynamics", + "rigid", + "real-time", + "joints" + ] +} \ No newline at end of file diff --git a/packages/rapier2d/pkg/rapier_wasm2d.d.ts b/packages/rapier2d/pkg/rapier_wasm2d.d.ts new file mode 100644 index 00000000..2c3438aa --- /dev/null +++ b/packages/rapier2d/pkg/rapier_wasm2d.d.ts @@ -0,0 +1,1666 @@ +/* tslint:disable */ +/* eslint-disable */ +export function reserve_memory(extra_bytes_count: number): void; +export function version(): string; +export enum RawFeatureType { + Vertex = 0, + Face = 1, + Unknown = 2, +} +export enum RawJointAxis { + LinX = 0, + LinY = 1, + AngX = 2, +} +export enum RawJointType { + Revolute = 0, + Fixed = 1, + Prismatic = 2, + Rope = 3, + Spring = 4, + Generic = 5, +} +export enum RawMotorModel { + AccelerationBased = 0, + ForceBased = 1, +} +export enum RawRigidBodyType { + Dynamic = 0, + Fixed = 1, + KinematicPositionBased = 2, + KinematicVelocityBased = 3, +} +export enum RawShapeType { + Ball = 0, + Cuboid = 1, + Capsule = 2, + Segment = 3, + Polyline = 4, + Triangle = 5, + TriMesh = 6, + HeightField = 7, + Compound = 8, + ConvexPolygon = 9, + RoundCuboid = 10, + RoundTriangle = 11, + RoundConvexPolygon = 12, + HalfSpace = 13, + Voxels = 14, +} +export class RawBroadPhase { + free(): void; + projectPoint(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, point: RawVector, solid: boolean, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): RawPointColliderProjection | undefined; + castRayAndGetNormal(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): RawRayColliderIntersection | undefined; + intersectionsWithRay(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean, callback: Function, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): void; + intersectionWithShape(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, shapePos: RawVector, shapeRot: RawRotation, shape: RawShape, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): number | undefined; + intersectionsWithPoint(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, point: RawVector, callback: Function, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): void; + intersectionsWithShape(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, shapePos: RawVector, shapeRot: RawRotation, shape: RawShape, callback: Function, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): void; + projectPointAndGetFeature(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, point: RawVector, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): RawPointColliderProjection | undefined; + collidersWithAabbIntersectingAabb(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, aabbCenter: RawVector, aabbHalfExtents: RawVector, callback: Function): void; + constructor(); + castRay(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): RawRayColliderHit | undefined; + castShape(narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, shapePos: RawVector, shapeRot: RawRotation, shapeVel: RawVector, shape: RawShape, target_distance: number, maxToi: number, stop_at_penetration: boolean, filter_flags: number, filter_groups: number | null | undefined, filter_exclude_collider: number | null | undefined, filter_exclude_rigid_body: number | null | undefined, filter_predicate: Function): RawColliderShapeCastHit | undefined; +} +export class RawCCDSolver { + free(): void; + constructor(); +} +export class RawCharacterCollision { + free(): void; + worldNormal1(): RawVector; + worldNormal2(): RawVector; + worldWitness1(): RawVector; + worldWitness2(): RawVector; + translationDeltaApplied(): RawVector; + translationDeltaRemaining(): RawVector; + constructor(); + toi(): number; + handle(): number; +} +export class RawColliderSet { + free(): void; + /** + * Checks if a collider with the given integer handle exists. + */ + isHandleValid(handle: number): boolean; + createCollider(enabled: boolean, shape: RawShape, translation: RawVector, rotation: RawRotation, massPropsMode: number, mass: number, centerOfMass: RawVector, principalAngularInertia: number, density: number, friction: number, restitution: number, frictionCombineRule: number, restitutionCombineRule: number, isSensor: boolean, collisionGroups: number, solverGroups: number, activeCollisionTypes: number, activeHooks: number, activeEvents: number, contactForceEventThreshold: number, contactSkin: number, hasParent: boolean, parent: number, bodies: RawRigidBodySet): number | undefined; + /** + * Applies the given JavaScript function to the integer handle of each collider managed by this collider set. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each collider managed by this collider set. Called as `f(handle)`. + */ + forEachColliderHandle(f: Function): void; + len(): number; + constructor(); + /** + * Removes a collider from this set and wake-up the rigid-body it is attached to. + */ + remove(handle: number, islands: RawIslandManager, bodies: RawRigidBodySet, wakeUp: boolean): void; + contains(handle: number): boolean; + /** + * The friction coefficient of this collider. + */ + coFriction(handle: number): number; + /** + * Is this collider a sensor? + */ + coIsSensor(handle: number): boolean; + /** + * The world-space orientation of this collider. + */ + coRotation(handle: number): RawRotation; + coSetShape(handle: number, shape: RawShape): void; + coSetVoxel(handle: number, ix: number, iy: number, filled: boolean): void; + /** + * The vertices of this triangle mesh, polyline, convex polyhedron, segment, triangle or convex polyhedron, if it is one. + */ + coVertices(handle: number): Float32Array | undefined; + coCastShape(handle: number, colliderVel: RawVector, shape2: RawShape, shape2Pos: RawVector, shape2Rot: RawRotation, shape2Vel: RawVector, target_distance: number, maxToi: number, stop_at_penetration: boolean): RawShapeCastHit | undefined; + coIsEnabled(handle: number): boolean; + /** + * Set the radius of this collider if it is a ball, capsule, cylinder, or cone shape. + */ + coSetRadius(handle: number, newRadius: number): void; + coSetSensor(handle: number, is_sensor: boolean): void; + /** + * The type of the shape of this collider. + */ + coShapeType(handle: number): RawShapeType; + coVoxelData(handle: number): Int32Array | undefined; + coVoxelSize(handle: number): RawVector | undefined; + /** + * The half height of this collider if it is a capsule, cylinder, or cone shape. + */ + coHalfHeight(handle: number): number | undefined; + coSetDensity(handle: number, density: number): void; + coSetEnabled(handle: number, enabled: boolean): void; + /** + * The physics hooks enabled for this collider. + */ + coActiveHooks(handle: number): number; + coContactSkin(handle: number): number; + /** + * The half-extents of this collider if it is has a cuboid shape. + */ + coHalfExtents(handle: number): RawVector | undefined; + /** + * The restitution coefficient of this collider. + */ + coRestitution(handle: number): number; + /** + * The radius of the round edges of this collider. + */ + coRoundRadius(handle: number): number | undefined; + coSetFriction(handle: number, friction: number): void; + /** + * Sets the rotation angle of this collider. + * + * # Parameters + * - `angle`: the rotation angle, in radians. + * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + */ + coSetRotation(handle: number, angle: number): void; + /** + * The world-space translation of this collider. + */ + coTranslation(handle: number): RawVector; + /** + * The events enabled for this collider. + */ + coActiveEvents(handle: number): number; + coCastCollider(handle: number, collider1Vel: RawVector, collider2handle: number, collider2Vel: RawVector, target_distance: number, max_toi: number, stop_at_penetration: boolean): RawColliderShapeCastHit | undefined; + coContactShape(handle: number, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation, prediction: number): RawShapeContact | undefined; + coProjectPoint(handle: number, point: RawVector, solid: boolean): RawPointProjection; + /** + * The solver groups of this collider. + */ + coSolverGroups(handle: number): number; + coTriMeshFlags(handle: number): number | undefined; + coContainsPoint(handle: number, point: RawVector): boolean; + coIntersectsRay(handle: number, rayOrig: RawVector, rayDir: RawVector, maxToi: number): boolean; + /** + * Set the half height of this collider if it is a capsule, cylinder, or cone shape. + */ + coSetHalfHeight(handle: number, newHalfheight: number): void; + coSetActiveHooks(handle: number, hooks: number): void; + coSetContactSkin(handle: number, contact_skin: number): void; + /** + * Set the half-extents of this collider if it has a cuboid shape. + */ + coSetHalfExtents(handle: number, newHalfExtents: RawVector): void; + coSetRestitution(handle: number, restitution: number): void; + /** + * Set the radius of the round edges of this collider. + */ + coSetRoundRadius(handle: number, newBorderRadius: number): void; + /** + * Sets the translation of this collider. + * + * # Parameters + * - `x`: the world-space position of the collider along the `x` axis. + * - `y`: the world-space position of the collider along the `y` axis. + * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + */ + coSetTranslation(handle: number, x: number, y: number): void; + /** + * The collision groups of this collider. + */ + coCollisionGroups(handle: number): number; + coContactCollider(handle: number, collider2handle: number, prediction: number): RawShapeContact | undefined; + coHalfspaceNormal(handle: number): RawVector | undefined; + coIntersectsShape(handle: number, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation): boolean; + coSetActiveEvents(handle: number, events: number): void; + coSetSolverGroups(handle: number, groups: number): void; + /** + * The scaling factor applied of this heightfield if it is one. + */ + coHeightfieldScale(handle: number): RawVector | undefined; + /** + * The orientation of this collider relative to its parent rigid-body. + * + * Returns the `None` if it doesn’t have a parent. + */ + coRotationWrtParent(handle: number): RawRotation | undefined; + coSetMassProperties(handle: number, mass: number, centerOfMass: RawVector, principalAngularInertia: number): void; + coCombineVoxelStates(handle1: number, handle2: number, shift_x: number, shift_y: number): void; + /** + * The height of this heightfield if it is one. + */ + coHeightfieldHeights(handle: number): Float32Array | undefined; + coSetCollisionGroups(handle: number, groups: number): void; + coCastRayAndGetNormal(handle: number, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): RawRayIntersection | undefined; + coFrictionCombineRule(handle: number): number; + /** + * The collision types enabled for this collider. + */ + coActiveCollisionTypes(handle: number): number; + coPropagateVoxelChange(handle1: number, handle2: number, ix: number, iy: number, shift_x: number, shift_y: number): void; + coSetRotationWrtParent(handle: number, angle: number): void; + /** + * The translation of this collider relative to its parent rigid-body. + * + * Returns the `None` if it doesn’t have a parent. + */ + coTranslationWrtParent(handle: number): RawVector | undefined; + coRestitutionCombineRule(handle: number): number; + coSetFrictionCombineRule(handle: number, rule: number): void; + coSetActiveCollisionTypes(handle: number, types: number): void; + coSetTranslationWrtParent(handle: number, x: number, y: number): void; + coSetRestitutionCombineRule(handle: number, rule: number): void; + /** + * The total force magnitude beyond which a contact force event can be emitted. + */ + coContactForceEventThreshold(handle: number): number; + coSetContactForceEventThreshold(handle: number, threshold: number): void; + /** + * The mass of this collider. + */ + coMass(handle: number): number; + /** + * The unique integer identifier of the collider this collider is attached to. + */ + coParent(handle: number): number | undefined; + /** + * The radius of this collider if it is a ball, capsule, cylinder, or cone shape. + */ + coRadius(handle: number): number | undefined; + /** + * The volume of this collider. + */ + coVolume(handle: number): number; + coCastRay(handle: number, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): number; + /** + * The density of this collider. + */ + coDensity(handle: number): number; + /** + * The indices of this triangle mesh, polyline, or convex polyhedron, if it is one. + */ + coIndices(handle: number): Uint32Array | undefined; + coSetMass(handle: number, mass: number): void; +} +export class RawColliderShapeCastHit { + private constructor(); + free(): void; + colliderHandle(): number; + time_of_impact(): number; + normal1(): RawVector; + normal2(): RawVector; + witness1(): RawVector; + witness2(): RawVector; +} +export class RawContactForceEvent { + private constructor(); + free(): void; + /** + * The sum of all the forces between the two colliders. + */ + total_force(): RawVector; + /** + * The world-space (unit) direction of the force with strongest magnitude. + */ + max_force_direction(): RawVector; + /** + * The magnitude of the largest force at a contact point of this contact pair. + */ + max_force_magnitude(): number; + /** + * The sum of the magnitudes of each force between the two colliders. + * + * Note that this is **not** the same as the magnitude of `self.total_force`. + * Here we are summing the magnitude of all the forces, instead of taking + * the magnitude of their sum. + */ + total_force_magnitude(): number; + /** + * The first collider involved in the contact. + */ + collider1(): number; + /** + * The second collider involved in the contact. + */ + collider2(): number; +} +export class RawContactManifold { + private constructor(); + free(): void; + contact_dist(i: number): number; + contact_fid1(i: number): number; + contact_fid2(i: number): number; + num_contacts(): number; + contact_impulse(i: number): number; + contact_local_p1(i: number): RawVector | undefined; + contact_local_p2(i: number): RawVector | undefined; + num_solver_contacts(): number; + solver_contact_dist(i: number): number; + solver_contact_point(i: number): RawVector | undefined; + contact_tangent_impulse(i: number): number; + solver_contact_friction(i: number): number; + solver_contact_restitution(i: number): number; + solver_contact_tangent_velocity(i: number): RawVector; + normal(): RawVector; + local_n1(): RawVector; + local_n2(): RawVector; + subshape1(): number; + subshape2(): number; +} +export class RawContactPair { + private constructor(); + free(): void; + contactManifold(i: number): RawContactManifold | undefined; + numContactManifolds(): number; + collider1(): number; + collider2(): number; +} +export class RawDebugRenderPipeline { + free(): void; + constructor(); + colors(): Float32Array; + render(bodies: RawRigidBodySet, colliders: RawColliderSet, impulse_joints: RawImpulseJointSet, multibody_joints: RawMultibodyJointSet, narrow_phase: RawNarrowPhase, filter_flags: number, filter_predicate: Function): void; + vertices(): Float32Array; +} +export class RawDeserializedWorld { + private constructor(); + free(): void; + takeBodies(): RawRigidBodySet | undefined; + takeGravity(): RawVector | undefined; + takeColliders(): RawColliderSet | undefined; + takeBroadPhase(): RawBroadPhase | undefined; + takeNarrowPhase(): RawNarrowPhase | undefined; + takeImpulseJoints(): RawImpulseJointSet | undefined; + takeIslandManager(): RawIslandManager | undefined; + takeMultibodyJoints(): RawMultibodyJointSet | undefined; + takeIntegrationParameters(): RawIntegrationParameters | undefined; +} +/** + * A structure responsible for collecting events generated + * by the physics engine. + */ +export class RawEventQueue { + free(): void; + /** + * Applies the given javascript closure on each collision event of this collector, then clear + * the internal collision event buffer. + * + * # Parameters + * - `f(handle1, handle2, started)`: JavaScript closure applied to each collision event. The + * closure should take three arguments: two integers representing the handles of the colliders + * involved in the collision, and a boolean indicating if the collision started (true) or stopped + * (false). + */ + drainCollisionEvents(f: Function): void; + drainContactForceEvents(f: Function): void; + /** + * Creates a new event collector. + * + * # Parameters + * - `autoDrain`: setting this to `true` is strongly recommended. If true, the collector will + * be automatically drained before each `world.step(collector)`. If false, the collector will + * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of + * RAM if no drain is performed. + */ + constructor(autoDrain: boolean); + /** + * Removes all events contained by this collector. + */ + clear(): void; +} +export class RawGenericJoint { + private constructor(); + free(): void; + static rope(length: number, anchor1: RawVector, anchor2: RawVector): RawGenericJoint; + /** + * Creates a new joint descriptor that builds a Fixed joint. + * + * A fixed joint removes all the degrees of freedom between the affected bodies. + */ + static fixed(anchor1: RawVector, axes1: RawRotation, anchor2: RawVector, axes2: RawRotation): RawGenericJoint; + static spring(rest_length: number, stiffness: number, damping: number, anchor1: RawVector, anchor2: RawVector): RawGenericJoint; + /** + * Create a new joint descriptor that builds Revolute joints. + * + * A revolute joint removes all degrees of freedom between the affected + * bodies except for the rotation. + */ + static revolute(anchor1: RawVector, anchor2: RawVector): RawGenericJoint | undefined; + /** + * Creates a new joint descriptor that builds a Prismatic joint. + * + * A prismatic joint removes all the degrees of freedom between the + * affected bodies, except for the translation along one axis. + * + * Returns `None` if any of the provided axes cannot be normalized. + */ + static prismatic(anchor1: RawVector, anchor2: RawVector, axis: RawVector, limitsEnabled: boolean, limitsMin: number, limitsMax: number): RawGenericJoint | undefined; +} +export class RawImpulseJointSet { + free(): void; + /** + * The position of the first anchor of this joint. + * + * The first anchor gives the position of the points application point on the + * local frame of the first rigid-body it is attached to. + */ + jointAnchor1(handle: number): RawVector; + /** + * The position of the second anchor of this joint. + * + * The second anchor gives the position of the points application point on the + * local frame of the second rigid-body it is attached to. + */ + jointAnchor2(handle: number): RawVector; + /** + * The angular part of the joint’s local frame relative to the first rigid-body it is attached to. + */ + jointFrameX1(handle: number): RawRotation; + /** + * The angular part of the joint’s local frame relative to the second rigid-body it is attached to. + */ + jointFrameX2(handle: number): RawRotation; + /** + * If this is a prismatic joint, returns its upper limit. + */ + jointLimitsMax(handle: number, axis: RawJointAxis): number; + /** + * Return the lower limit along the given joint axis. + */ + jointLimitsMin(handle: number, axis: RawJointAxis): number; + /** + * Enables and sets the joint limits + */ + jointSetLimits(handle: number, axis: RawJointAxis, min: number, max: number): void; + /** + * Sets the position of the first local anchor + */ + jointSetAnchor1(handle: number, newPos: RawVector): void; + /** + * Sets the position of the second local anchor + */ + jointSetAnchor2(handle: number, newPos: RawVector): void; + /** + * The unique integer identifier of the first rigid-body this joint it attached to. + */ + jointBodyHandle1(handle: number): number; + /** + * The unique integer identifier of the second rigid-body this joint is attached to. + */ + jointBodyHandle2(handle: number): number; + /** + * Are the limits for this joint enabled? + */ + jointLimitsEnabled(handle: number, axis: RawJointAxis): boolean; + jointConfigureMotor(handle: number, axis: RawJointAxis, targetPos: number, targetVel: number, stiffness: number, damping: number): void; + /** + * Are contacts between the rigid-bodies attached by this joint enabled? + */ + jointContactsEnabled(handle: number): boolean; + /** + * Sets whether contacts are enabled between the rigid-bodies attached by this joint. + */ + jointSetContactsEnabled(handle: number, enabled: boolean): void; + jointConfigureMotorModel(handle: number, axis: RawJointAxis, model: RawMotorModel): void; + jointConfigureMotorPosition(handle: number, axis: RawJointAxis, targetPos: number, stiffness: number, damping: number): void; + jointConfigureMotorVelocity(handle: number, axis: RawJointAxis, targetVel: number, factor: number): void; + /** + * The type of this joint. + */ + jointType(handle: number): RawJointType; + createJoint(params: RawGenericJoint, parent1: number, parent2: number, wake_up: boolean): number; + /** + * Applies the given JavaScript function to the integer handle of each joint managed by this physics world. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`. + */ + forEachJointHandle(f: Function): void; + /** + * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`. + */ + forEachJointAttachedToRigidBody(body: number, f: Function): void; + len(): number; + constructor(); + remove(handle: number, wakeUp: boolean): void; + contains(handle: number): boolean; +} +export class RawIntegrationParameters { + free(): void; + constructor(); + lengthUnit: number; + readonly contact_erp: number; + minIslandSize: number; + maxCcdSubsteps: number; + numSolverIterations: number; + numInternalPgsIterations: number; + normalizedAllowedLinearError: number; + normalizedPredictionDistance: number; + set contact_natural_frequency(value: number); + dt: number; +} +export class RawIslandManager { + free(): void; + /** + * Applies the given JavaScript function to the integer handle of each active rigid-body + * managed by this island manager. + * + * After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by + * the physics engine in order to save computational power. A sleeping rigid-body never moves + * unless it is moved manually by the user. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each active rigid-body managed by this + * set. Called as `f(collider)`. + */ + forEachActiveRigidBodyHandle(f: Function): void; + constructor(); +} +export class RawKinematicCharacterController { + free(): void; + slideEnabled(): boolean; + enableAutostep(maxHeight: number, minWidth: number, includeDynamicBodies: boolean): void; + autostepEnabled(): boolean; + disableAutostep(): void; + setSlideEnabled(enabled: boolean): void; + autostepMinWidth(): number | undefined; + computedGrounded(): boolean; + computedMovement(): RawVector; + autostepMaxHeight(): number | undefined; + computedCollision(i: number, collision: RawCharacterCollision): boolean; + normalNudgeFactor(): number; + enableSnapToGround(distance: number): void; + maxSlopeClimbAngle(): number; + minSlopeSlideAngle(): number; + disableSnapToGround(): void; + snapToGroundEnabled(): boolean; + setNormalNudgeFactor(value: number): void; + snapToGroundDistance(): number | undefined; + numComputedCollisions(): number; + setMaxSlopeClimbAngle(angle: number): void; + setMinSlopeSlideAngle(angle: number): void; + computeColliderMovement(dt: number, broad_phase: RawBroadPhase, narrow_phase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, collider_handle: number, desired_translation_delta: RawVector, apply_impulses_to_dynamic_bodies: boolean, character_mass: number | null | undefined, filter_flags: number, filter_groups: number | null | undefined, filter_predicate: Function): void; + autostepIncludesDynamicBodies(): boolean | undefined; + up(): RawVector; + constructor(offset: number); + setUp(vector: RawVector): void; + offset(): number; + setOffset(value: number): void; +} +export class RawMultibodyJointSet { + free(): void; + /** + * The position of the first anchor of this joint. + * + * The first anchor gives the position of the points application point on the + * local frame of the first rigid-body it is attached to. + */ + jointAnchor1(handle: number): RawVector; + /** + * The position of the second anchor of this joint. + * + * The second anchor gives the position of the points application point on the + * local frame of the second rigid-body it is attached to. + */ + jointAnchor2(handle: number): RawVector; + /** + * The angular part of the joint’s local frame relative to the first rigid-body it is attached to. + */ + jointFrameX1(handle: number): RawRotation; + /** + * The angular part of the joint’s local frame relative to the second rigid-body it is attached to. + */ + jointFrameX2(handle: number): RawRotation; + /** + * If this is a prismatic joint, returns its upper limit. + */ + jointLimitsMax(handle: number, axis: RawJointAxis): number; + /** + * Return the lower limit along the given joint axis. + */ + jointLimitsMin(handle: number, axis: RawJointAxis): number; + /** + * Are the limits for this joint enabled? + */ + jointLimitsEnabled(handle: number, axis: RawJointAxis): boolean; + /** + * Are contacts between the rigid-bodies attached by this joint enabled? + */ + jointContactsEnabled(handle: number): boolean; + /** + * Sets whether contacts are enabled between the rigid-bodies attached by this joint. + */ + jointSetContactsEnabled(handle: number, enabled: boolean): void; + /** + * The type of this joint. + */ + jointType(handle: number): RawJointType; + createJoint(params: RawGenericJoint, parent1: number, parent2: number, wakeUp: boolean): number; + /** + * Applies the given JavaScript function to the integer handle of each joint managed by this physics world. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`. + */ + forEachJointHandle(f: Function): void; + /** + * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`. + */ + forEachJointAttachedToRigidBody(body: number, f: Function): void; + constructor(); + remove(handle: number, wakeUp: boolean): void; + contains(handle: number): boolean; +} +export class RawNarrowPhase { + free(): void; + contact_pair(handle1: number, handle2: number): RawContactPair | undefined; + intersection_pair(handle1: number, handle2: number): boolean; + contact_pairs_with(handle1: number, f: Function): void; + intersection_pairs_with(handle1: number, f: Function): void; + constructor(); +} +export class RawPhysicsPipeline { + free(): void; + timing_ccd(): number; + timing_step(): number; + timing_solver(): number; + stepWithEvents(gravity: RawVector, integrationParameters: RawIntegrationParameters, islands: RawIslandManager, broadPhase: RawBroadPhase, narrowPhase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, joints: RawImpulseJointSet, articulations: RawMultibodyJointSet, ccd_solver: RawCCDSolver, eventQueue: RawEventQueue, hookObject: object, hookFilterContactPair: Function, hookFilterIntersectionPair: Function): void; + timing_ccd_solver(): number; + timing_broad_phase(): number; + is_profiler_enabled(): boolean; + timing_narrow_phase(): number; + timing_user_changes(): number; + set_profiler_enabled(enabled: boolean): void; + timing_ccd_broad_phase(): number; + timing_velocity_update(): number; + timing_ccd_narrow_phase(): number; + timing_velocity_assembly(): number; + timing_velocity_writeback(): number; + timing_ccd_toi_computation(): number; + timing_collision_detection(): number; + timing_island_construction(): number; + timing_velocity_resolution(): number; + constructor(); + step(gravity: RawVector, integrationParameters: RawIntegrationParameters, islands: RawIslandManager, broadPhase: RawBroadPhase, narrowPhase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, joints: RawImpulseJointSet, articulations: RawMultibodyJointSet, ccd_solver: RawCCDSolver): void; +} +export class RawPidController { + free(): void; + set_axes_mask(axes_mask: number): void; + reset_integrals(): void; + linear_correction(dt: number, bodies: RawRigidBodySet, rb_handle: number, target_translation: RawVector, target_linvel: RawVector): RawVector; + angular_correction(dt: number, bodies: RawRigidBodySet, rb_handle: number, target_rotation: number, target_angvel: number): number; + apply_linear_correction(dt: number, bodies: RawRigidBodySet, rb_handle: number, target_translation: RawVector, target_linvel: RawVector): void; + apply_angular_correction(dt: number, bodies: RawRigidBodySet, rb_handle: number, target_rotation: number, target_angvel: number): void; + constructor(kp: number, ki: number, kd: number, axes_mask: number); + set_kd(kd: number, axes: number): void; + set_ki(ki: number, axes: number): void; + set_kp(kp: number, axes: number): void; +} +export class RawPointColliderProjection { + private constructor(); + free(): void; + featureType(): RawFeatureType; + colliderHandle(): number; + point(): RawVector; + isInside(): boolean; + featureId(): number | undefined; +} +export class RawPointProjection { + private constructor(); + free(): void; + point(): RawVector; + isInside(): boolean; +} +export class RawRayColliderHit { + private constructor(); + free(): void; + timeOfImpact(): number; + colliderHandle(): number; +} +export class RawRayColliderIntersection { + private constructor(); + free(): void; + featureType(): RawFeatureType; + colliderHandle(): number; + time_of_impact(): number; + normal(): RawVector; + featureId(): number | undefined; +} +export class RawRayIntersection { + private constructor(); + free(): void; + featureType(): RawFeatureType; + time_of_impact(): number; + normal(): RawVector; + featureId(): number | undefined; +} +export class RawRigidBodySet { + free(): void; + /** + * Adds a force at the center-of-mass of this rigid-body. + * + * # Parameters + * - `force`: the world-space force to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + */ + rbAddForce(handle: number, force: RawVector, wakeUp: boolean): void; + /** + * The status of this rigid-body: fixed, dynamic, or kinematic. + */ + rbBodyType(handle: number): RawRigidBodyType; + /** + * Retrieves the `i-th` collider attached to this rigid-body. + * + * # Parameters + * - `at`: The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`. + * This index is **not** the same as the unique identifier of the collider. + */ + rbCollider(handle: number, at: number): number; + /** + * Is the velocity of this rigid-body not zero? + */ + rbIsMoving(handle: number): boolean; + /** + * The center of mass of a rigid-body expressed in its local-space. + */ + rbLocalCom(handle: number): RawVector; + /** + * The world-space orientation of this rigid-body. + */ + rbRotation(handle: number): RawRotation; + /** + * An arbitrary user-defined 32-bit integer + */ + rbUserData(handle: number): number; + /** + * The world-space center of mass of the rigid-body. + */ + rbWorldCom(handle: number): RawVector; + /** + * Adds a torque at the center-of-mass of this rigid-body. + * + * # Parameters + * - `torque`: the torque to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + */ + rbAddTorque(handle: number, torque: number, wakeUp: boolean): void; + rbEnableCcd(handle: number, enabled: boolean): void; + /** + * Is this rigid-body dynamic? + */ + rbIsDynamic(handle: number): boolean; + rbIsEnabled(handle: number): boolean; + /** + * Sets the angular velocity of this rigid-body. + */ + rbSetAngvel(handle: number, angvel: number, wakeUp: boolean): void; + /** + * Sets the linear velocity of this rigid-body. + */ + rbSetLinvel(handle: number, linvel: RawVector, wakeUp: boolean): void; + /** + * Retrieves the constant force(s) the user added to this rigid-body. + * Returns zero if the rigid-body is not dynamic. + */ + rbUserForce(handle: number): RawVector; + /** + * Is this rigid-body sleeping? + */ + rbIsSleeping(handle: number): boolean; + rbSetEnabled(handle: number, enabled: boolean): void; + /** + * Retrieves the constant torque(s) the user added to this rigid-body. + * Returns zero if the rigid-body is not dynamic. + */ + rbUserTorque(handle: number): number; + /** + * Is this rigid-body kinematic? + */ + rbIsKinematic(handle: number): boolean; + /** + * Resets to zero all user-added forces added to this rigid-body. + */ + rbResetForces(handle: number, wakeUp: boolean): void; + /** + * Set a new status for this rigid-body: fixed, dynamic, or kinematic. + */ + rbSetBodyType(handle: number, status: RawRigidBodyType, wake_up: boolean): void; + /** + * Sets the rotation angle of this rigid-body. + * + * # Parameters + * - `angle`: the rotation angle, in radians. + * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + */ + rbSetRotation(handle: number, angle: number, wakeUp: boolean): void; + /** + * Sets the user-defined 32-bit integer of this rigid-body. + * + * # Parameters + * - `data`: an arbitrary user-defined 32-bit integer. + */ + rbSetUserData(handle: number, data: number): void; + /** + * The world-space translation of this rigid-body. + */ + rbTranslation(handle: number): RawVector; + /** + * Applies an impulse at the center-of-mass of this rigid-body. + * + * # Parameters + * - `impulse`: the world-space impulse to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + */ + rbApplyImpulse(handle: number, impulse: RawVector, wakeUp: boolean): void; + rbGravityScale(handle: number): number; + /** + * Is Continuous Collision Detection enabled for this rigid-body? + */ + rbIsCcdEnabled(handle: number): boolean; + /** + * The world-space predicted orientation of this rigid-body. + * + * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation` + * method and is used for estimating the kinematic body velocity at the next timestep. + * For non-kinematic bodies, this value is currently unspecified. + */ + rbNextRotation(handle: number): RawRotation; + /** + * The number of colliders attached to this rigid-body. + */ + rbNumColliders(handle: number): number; + /** + * Resets to zero all user-added torques added to this rigid-body. + */ + rbResetTorques(handle: number, wakeUp: boolean): void; + /** + * The linear damping coefficient of this rigid-body. + */ + rbLinearDamping(handle: number): number; + rbLockRotations(handle: number, locked: boolean, wake_up: boolean): void; + /** + * The angular damping coefficient of this rigid-body. + */ + rbAngularDamping(handle: number): number; + rbDominanceGroup(handle: number): number; + /** + * Sets the translation of this rigid-body. + * + * # Parameters + * - `x`: the world-space position of the rigid-body along the `x` axis. + * - `y`: the world-space position of the rigid-body along the `y` axis. + * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + */ + rbSetTranslation(handle: number, x: number, y: number, wakeUp: boolean): void; + /** + * Adds a force at the given world-space point of this rigid-body. + * + * # Parameters + * - `force`: the world-space force to apply on the rigid-body. + * - `point`: the world-space point where the impulse is to be applied on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + */ + rbAddForceAtPoint(handle: number, force: RawVector, point: RawVector, wakeUp: boolean): void; + /** + * The world-space predicted translation of this rigid-body. + * + * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation` + * method and is used for estimating the kinematic body velocity at the next timestep. + * For non-kinematic bodies, this value is currently unspecified. + */ + rbNextTranslation(handle: number): RawVector; + rbSetGravityScale(handle: number, factor: number, wakeUp: boolean): void; + /** + * The velocity of the given world-space point on this rigid-body. + */ + rbVelocityAtPoint(handle: number, point: RawVector): RawVector; + /** + * The inverse mass taking into account translation locking. + */ + rbEffectiveInvMass(handle: number): RawVector; + rbLockTranslations(handle: number, locked: boolean, wake_up: boolean): void; + /** + * The angular inertia along the principal inertia axes of the rigid-body. + */ + rbPrincipalInertia(handle: number): number; + rbSetLinearDamping(handle: number, factor: number): void; + rbSetAdditionalMass(handle: number, mass: number, wake_up: boolean): void; + rbSetAngularDamping(handle: number, factor: number): void; + rbSetDominanceGroup(handle: number, group: number): void; + rbSoftCcdPrediction(handle: number): number; + /** + * Applies an impulsive torque at the center-of-mass of this rigid-body. + * + * # Parameters + * - `torque impulse`: the torque impulse to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + */ + rbApplyTorqueImpulse(handle: number, torque_impulse: number, wakeUp: boolean): void; + /** + * Applies an impulse at the given world-space point of this rigid-body. + * + * # Parameters + * - `impulse`: the world-space impulse to apply on the rigid-body. + * - `point`: the world-space point where the impulse is to be applied on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + */ + rbApplyImpulseAtPoint(handle: number, impulse: RawVector, point: RawVector, wakeUp: boolean): void; + /** + * The inverse of the principal angular inertia of the rigid-body. + * + * Components set to zero are assumed to be infinite along the corresponding principal axis. + */ + rbInvPrincipalInertia(handle: number): number; + rbSetSoftCcdPrediction(handle: number, prediction: number): void; + rbSetEnabledTranslations(handle: number, allow_x: boolean, allow_y: boolean, wake_up: boolean): void; + /** + * The effective world-space angular inertia (that takes the potential rotation locking into account) of + * this rigid-body. + */ + rbEffectiveAngularInertia(handle: number): number; + /** + * The world-space inverse angular inertia tensor of the rigid-body, + * taking into account rotation locking. + */ + rbEffectiveWorldInvInertia(handle: number): number; + /** + * If this rigid body is kinematic, sets its future rotation after the next timestep integration. + * + * This should be used instead of `rigidBody.setRotation` to make the dynamic object + * interacting with this kinematic body behave as expected. Internally, Rapier will compute + * an artificial velocity for this rigid-body from its current position and its next kinematic + * position. This velocity will be used to compute forces on dynamic bodies interacting with + * this body. + * + * # Parameters + * - `angle`: the rotation angle, in radians. + */ + rbSetNextKinematicRotation(handle: number, angle: number): void; + rbAdditionalSolverIterations(handle: number): number; + rbSetAdditionalMassProperties(handle: number, mass: number, centerOfMass: RawVector, principalAngularInertia: number, wake_up: boolean): void; + /** + * If this rigid body is kinematic, sets its future translation after the next timestep integration. + * + * This should be used instead of `rigidBody.setTranslation` to make the dynamic object + * interacting with this kinematic body behave as expected. Internally, Rapier will compute + * an artificial velocity for this rigid-body from its current position and its next kinematic + * position. This velocity will be used to compute forces on dynamic bodies interacting with + * this body. + * + * # Parameters + * - `x`: the world-space position of the rigid-body along the `x` axis. + * - `y`: the world-space position of the rigid-body along the `y` axis. + */ + rbSetNextKinematicTranslation(handle: number, x: number, y: number): void; + rbSetAdditionalSolverIterations(handle: number, iters: number): void; + rbRecomputeMassPropertiesFromColliders(handle: number, colliders: RawColliderSet): void; + /** + * The mass of this rigid-body. + */ + rbMass(handle: number): number; + /** + * Put the given rigid-body to sleep. + */ + rbSleep(handle: number): void; + /** + * The angular velocity of this rigid-body. + */ + rbAngvel(handle: number): number; + /** + * The linear velocity of this rigid-body. + */ + rbLinvel(handle: number): RawVector; + /** + * Wakes this rigid-body up. + * + * A dynamic rigid-body that does not move during several consecutive frames will + * be put to sleep by the physics engine, i.e., it will stop being simulated in order + * to avoid useless computations. + * This method forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying + * the position of a dynamic body so that it is properly simulated afterwards. + */ + rbWakeUp(handle: number): void; + /** + * The inverse of the mass of a rigid-body. + * + * If this is zero, the rigid-body is assumed to have infinite mass. + */ + rbInvMass(handle: number): number; + /** + * Is this rigid-body fixed? + */ + rbIsFixed(handle: number): boolean; + createRigidBody(enabled: boolean, translation: RawVector, rotation: RawRotation, gravityScale: number, mass: number, massOnly: boolean, centerOfMass: RawVector, linvel: RawVector, angvel: number, principalAngularInertia: number, translationEnabledX: boolean, translationEnabledY: boolean, rotationsEnabled: boolean, linearDamping: number, angularDamping: number, rb_type: RawRigidBodyType, canSleep: boolean, sleeping: boolean, softCcdPrediciton: number, ccdEnabled: boolean, dominanceGroup: number, additional_solver_iterations: number): number; + /** + * Applies the given JavaScript function to the integer handle of each rigid-body managed by this set. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each rigid-body managed by this set. Called as `f(collider)`. + */ + forEachRigidBodyHandle(f: Function): void; + /** + * The number of rigid-bodies on this set. + */ + len(): number; + constructor(); + propagateModifiedBodyPositionsToColliders(colliders: RawColliderSet): void; + remove(handle: number, islands: RawIslandManager, colliders: RawColliderSet, joints: RawImpulseJointSet, articulations: RawMultibodyJointSet): void; + /** + * Checks if a rigid-body with the given integer handle exists. + */ + contains(handle: number): boolean; +} +/** + * A rotation quaternion. + */ +export class RawRotation { + private constructor(); + free(): void; + /** + * The identity rotation. + */ + static identity(): RawRotation; + /** + * The rotation with thegiven angle. + */ + static fromAngle(angle: number): RawRotation; + /** + * The imaginary part of this complex number. + */ + readonly im: number; + /** + * The real part of this complex number. + */ + readonly re: number; + /** + * The rotation angle in radians. + */ + readonly angle: number; +} +export class RawSerializationPipeline { + free(): void; + serializeAll(gravity: RawVector, integrationParameters: RawIntegrationParameters, islands: RawIslandManager, broadPhase: RawBroadPhase, narrowPhase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, impulse_joints: RawImpulseJointSet, multibody_joints: RawMultibodyJointSet): Uint8Array | undefined; + deserializeAll(data: Uint8Array): RawDeserializedWorld | undefined; + constructor(); +} +export class RawShape { + private constructor(); + free(): void; + static convexHull(points: Float32Array): RawShape | undefined; + static heightfield(heights: Float32Array, scale: RawVector): RawShape; + static roundCuboid(hx: number, hy: number, borderRadius: number): RawShape; + contactShape(shapePos1: RawVector, shapeRot1: RawRotation, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation, prediction: number): RawShapeContact | undefined; + projectPoint(shapePos: RawVector, shapeRot: RawRotation, point: RawVector, solid: boolean): RawPointProjection; + containsPoint(shapePos: RawVector, shapeRot: RawRotation, point: RawVector): boolean; + intersectsRay(shapePos: RawVector, shapeRot: RawRotation, rayOrig: RawVector, rayDir: RawVector, maxToi: number): boolean; + static roundTriangle(p1: RawVector, p2: RawVector, p3: RawVector, borderRadius: number): RawShape; + static convexPolyline(vertices: Float32Array): RawShape | undefined; + intersectsShape(shapePos1: RawVector, shapeRot1: RawRotation, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation): boolean; + static roundConvexHull(points: Float32Array, borderRadius: number): RawShape | undefined; + static voxelsFromPoints(voxel_size: RawVector, points: Float32Array): RawShape; + castRayAndGetNormal(shapePos: RawVector, shapeRot: RawRotation, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): RawRayIntersection | undefined; + static roundConvexPolyline(vertices: Float32Array, borderRadius: number): RawShape | undefined; + static ball(radius: number): RawShape; + static cuboid(hx: number, hy: number): RawShape; + static voxels(voxel_size: RawVector, grid_coords: Int32Array): RawShape; + static capsule(halfHeight: number, radius: number): RawShape; + castRay(shapePos: RawVector, shapeRot: RawRotation, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): number; + static segment(p1: RawVector, p2: RawVector): RawShape; + static trimesh(vertices: Float32Array, indices: Uint32Array, flags: number): RawShape | undefined; + static polyline(vertices: Float32Array, indices: Uint32Array): RawShape; + static triangle(p1: RawVector, p2: RawVector, p3: RawVector): RawShape; + castShape(shapePos1: RawVector, shapeRot1: RawRotation, shapeVel1: RawVector, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation, shapeVel2: RawVector, target_distance: number, maxToi: number, stop_at_penetration: boolean): RawShapeCastHit | undefined; + static halfspace(normal: RawVector): RawShape; +} +export class RawShapeCastHit { + private constructor(); + free(): void; + time_of_impact(): number; + normal1(): RawVector; + normal2(): RawVector; + witness1(): RawVector; + witness2(): RawVector; +} +export class RawShapeContact { + private constructor(); + free(): void; + point1(): RawVector; + point2(): RawVector; + normal1(): RawVector; + normal2(): RawVector; + distance(): number; +} +/** + * A vector. + */ +export class RawVector { + free(): void; + /** + * Create a new 2D vector from this vector with its components rearranged as `{x, y}`. + */ + xy(): RawVector; + /** + * Create a new 2D vector from this vector with its components rearranged as `{y, x}`. + */ + yx(): RawVector; + /** + * Creates a new 2D vector from its two components. + * + * # Parameters + * - `x`: the `x` component of this 2D vector. + * - `y`: the `y` component of this 2D vector. + */ + constructor(x: number, y: number); + /** + * Creates a new vector filled with zeros. + */ + static zero(): RawVector; + /** + * The `x` component of this vector. + */ + x: number; + /** + * The `y` component of this vector. + */ + y: number; +} + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly __wbg_rawbroadphase_free: (a: number, b: number) => void; + readonly __wbg_rawccdsolver_free: (a: number, b: number) => void; + readonly __wbg_rawcharactercollision_free: (a: number, b: number) => void; + readonly __wbg_rawcolliderset_free: (a: number, b: number) => void; + readonly __wbg_rawcollidershapecasthit_free: (a: number, b: number) => void; + readonly __wbg_rawcontactforceevent_free: (a: number, b: number) => void; + readonly __wbg_rawcontactmanifold_free: (a: number, b: number) => void; + readonly __wbg_rawdebugrenderpipeline_free: (a: number, b: number) => void; + readonly __wbg_rawdeserializedworld_free: (a: number, b: number) => void; + readonly __wbg_raweventqueue_free: (a: number, b: number) => void; + readonly __wbg_rawgenericjoint_free: (a: number, b: number) => void; + readonly __wbg_rawimpulsejointset_free: (a: number, b: number) => void; + readonly __wbg_rawintegrationparameters_free: (a: number, b: number) => void; + readonly __wbg_rawislandmanager_free: (a: number, b: number) => void; + readonly __wbg_rawkinematiccharactercontroller_free: (a: number, b: number) => void; + readonly __wbg_rawmultibodyjointset_free: (a: number, b: number) => void; + readonly __wbg_rawnarrowphase_free: (a: number, b: number) => void; + readonly __wbg_rawphysicspipeline_free: (a: number, b: number) => void; + readonly __wbg_rawpidcontroller_free: (a: number, b: number) => void; + readonly __wbg_rawpointcolliderprojection_free: (a: number, b: number) => void; + readonly __wbg_rawpointprojection_free: (a: number, b: number) => void; + readonly __wbg_rawrayintersection_free: (a: number, b: number) => void; + readonly __wbg_rawrigidbodyset_free: (a: number, b: number) => void; + readonly __wbg_rawrotation_free: (a: number, b: number) => void; + readonly __wbg_rawshape_free: (a: number, b: number) => void; + readonly __wbg_rawshapecontact_free: (a: number, b: number) => void; + readonly __wbg_rawvector_free: (a: number, b: number) => void; + readonly rawbroadphase_castRay: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => number; + readonly rawbroadphase_castRayAndGetNormal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => number; + readonly rawbroadphase_castShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => number; + readonly rawbroadphase_collidersWithAabbIntersectingAabb: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void; + readonly rawbroadphase_intersectionWithShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void; + readonly rawbroadphase_intersectionsWithPoint: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void; + readonly rawbroadphase_intersectionsWithRay: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void; + readonly rawbroadphase_intersectionsWithShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void; + readonly rawbroadphase_new: () => number; + readonly rawbroadphase_projectPoint: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number; + readonly rawbroadphase_projectPointAndGetFeature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number; + readonly rawcharactercollision_handle: (a: number) => number; + readonly rawcharactercollision_new: () => number; + readonly rawcharactercollision_toi: (a: number) => number; + readonly rawcharactercollision_translationDeltaApplied: (a: number) => number; + readonly rawcharactercollision_translationDeltaRemaining: (a: number) => number; + readonly rawcharactercollision_worldNormal1: (a: number) => number; + readonly rawcharactercollision_worldNormal2: (a: number) => number; + readonly rawcharactercollision_worldWitness1: (a: number) => number; + readonly rawcharactercollision_worldWitness2: (a: number) => number; + readonly rawcolliderset_coActiveCollisionTypes: (a: number, b: number) => number; + readonly rawcolliderset_coActiveEvents: (a: number, b: number) => number; + readonly rawcolliderset_coActiveHooks: (a: number, b: number) => number; + readonly rawcolliderset_coCastCollider: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; + readonly rawcolliderset_coCastRay: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawcolliderset_coCastRayAndGetNormal: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawcolliderset_coCastShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number; + readonly rawcolliderset_coCollisionGroups: (a: number, b: number) => number; + readonly rawcolliderset_coCombineVoxelStates: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawcolliderset_coContactCollider: (a: number, b: number, c: number, d: number) => number; + readonly rawcolliderset_coContactForceEventThreshold: (a: number, b: number) => number; + readonly rawcolliderset_coContactShape: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawcolliderset_coContactSkin: (a: number, b: number) => number; + readonly rawcolliderset_coContainsPoint: (a: number, b: number, c: number) => number; + readonly rawcolliderset_coDensity: (a: number, b: number) => number; + readonly rawcolliderset_coFriction: (a: number, b: number) => number; + readonly rawcolliderset_coFrictionCombineRule: (a: number, b: number) => number; + readonly rawcolliderset_coHalfExtents: (a: number, b: number) => number; + readonly rawcolliderset_coHalfHeight: (a: number, b: number) => number; + readonly rawcolliderset_coHalfspaceNormal: (a: number, b: number) => number; + readonly rawcolliderset_coHeightfieldHeights: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coHeightfieldScale: (a: number, b: number) => number; + readonly rawcolliderset_coIndices: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coIntersectsRay: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawcolliderset_coIntersectsShape: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawcolliderset_coIsEnabled: (a: number, b: number) => number; + readonly rawcolliderset_coIsSensor: (a: number, b: number) => number; + readonly rawcolliderset_coMass: (a: number, b: number) => number; + readonly rawcolliderset_coParent: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coProjectPoint: (a: number, b: number, c: number, d: number) => number; + readonly rawcolliderset_coPropagateVoxelChange: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void; + readonly rawcolliderset_coRadius: (a: number, b: number) => number; + readonly rawcolliderset_coRestitution: (a: number, b: number) => number; + readonly rawcolliderset_coRestitutionCombineRule: (a: number, b: number) => number; + readonly rawcolliderset_coRotation: (a: number, b: number) => number; + readonly rawcolliderset_coRotationWrtParent: (a: number, b: number) => number; + readonly rawcolliderset_coRoundRadius: (a: number, b: number) => number; + readonly rawcolliderset_coSetActiveCollisionTypes: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetActiveEvents: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetActiveHooks: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetCollisionGroups: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetContactForceEventThreshold: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetContactSkin: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetDensity: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetEnabled: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetFriction: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetFrictionCombineRule: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetHalfExtents: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetHalfHeight: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetMass: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetMassProperties: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawcolliderset_coSetRadius: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetRestitution: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetRestitutionCombineRule: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetRotation: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetRotationWrtParent: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetRoundRadius: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetSensor: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetShape: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetSolverGroups: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coSetTranslation: (a: number, b: number, c: number, d: number) => void; + readonly rawcolliderset_coSetTranslationWrtParent: (a: number, b: number, c: number, d: number) => void; + readonly rawcolliderset_coSetVoxel: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawcolliderset_coShapeType: (a: number, b: number) => number; + readonly rawcolliderset_coSolverGroups: (a: number, b: number) => number; + readonly rawcolliderset_coTranslation: (a: number, b: number) => number; + readonly rawcolliderset_coTranslationWrtParent: (a: number, b: number) => number; + readonly rawcolliderset_coTriMeshFlags: (a: number, b: number) => number; + readonly rawcolliderset_coVertices: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coVolume: (a: number, b: number) => number; + readonly rawcolliderset_coVoxelData: (a: number, b: number, c: number) => void; + readonly rawcolliderset_coVoxelSize: (a: number, b: number) => number; + readonly rawcolliderset_contains: (a: number, b: number) => number; + readonly rawcolliderset_createCollider: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number) => void; + readonly rawcolliderset_forEachColliderHandle: (a: number, b: number) => void; + readonly rawcolliderset_len: (a: number) => number; + readonly rawcolliderset_new: () => number; + readonly rawcolliderset_remove: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawcollidershapecasthit_colliderHandle: (a: number) => number; + readonly rawcollidershapecasthit_normal1: (a: number) => number; + readonly rawcollidershapecasthit_normal2: (a: number) => number; + readonly rawcollidershapecasthit_time_of_impact: (a: number) => number; + readonly rawcollidershapecasthit_witness1: (a: number) => number; + readonly rawcollidershapecasthit_witness2: (a: number) => number; + readonly rawcontactforceevent_collider2: (a: number) => number; + readonly rawcontactforceevent_max_force_magnitude: (a: number) => number; + readonly rawcontactforceevent_total_force: (a: number) => number; + readonly rawcontactforceevent_total_force_magnitude: (a: number) => number; + readonly rawcontactmanifold_contact_dist: (a: number, b: number) => number; + readonly rawcontactmanifold_contact_fid1: (a: number, b: number) => number; + readonly rawcontactmanifold_contact_fid2: (a: number, b: number) => number; + readonly rawcontactmanifold_contact_impulse: (a: number, b: number) => number; + readonly rawcontactmanifold_contact_local_p1: (a: number, b: number) => number; + readonly rawcontactmanifold_contact_local_p2: (a: number, b: number) => number; + readonly rawcontactmanifold_contact_tangent_impulse: (a: number, b: number) => number; + readonly rawcontactmanifold_local_n1: (a: number) => number; + readonly rawcontactmanifold_local_n2: (a: number) => number; + readonly rawcontactmanifold_normal: (a: number) => number; + readonly rawcontactmanifold_num_contacts: (a: number) => number; + readonly rawcontactmanifold_num_solver_contacts: (a: number) => number; + readonly rawcontactmanifold_solver_contact_dist: (a: number, b: number) => number; + readonly rawcontactmanifold_solver_contact_friction: (a: number, b: number) => number; + readonly rawcontactmanifold_solver_contact_point: (a: number, b: number) => number; + readonly rawcontactmanifold_solver_contact_restitution: (a: number, b: number) => number; + readonly rawcontactmanifold_solver_contact_tangent_velocity: (a: number, b: number) => number; + readonly rawcontactmanifold_subshape1: (a: number) => number; + readonly rawcontactmanifold_subshape2: (a: number) => number; + readonly rawcontactpair_collider1: (a: number) => number; + readonly rawcontactpair_collider2: (a: number) => number; + readonly rawcontactpair_contactManifold: (a: number, b: number) => number; + readonly rawcontactpair_numContactManifolds: (a: number) => number; + readonly rawdebugrenderpipeline_colors: (a: number) => number; + readonly rawdebugrenderpipeline_new: () => number; + readonly rawdebugrenderpipeline_render: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void; + readonly rawdebugrenderpipeline_vertices: (a: number) => number; + readonly rawdeserializedworld_takeBodies: (a: number) => number; + readonly rawdeserializedworld_takeBroadPhase: (a: number) => number; + readonly rawdeserializedworld_takeColliders: (a: number) => number; + readonly rawdeserializedworld_takeGravity: (a: number) => number; + readonly rawdeserializedworld_takeImpulseJoints: (a: number) => number; + readonly rawdeserializedworld_takeIntegrationParameters: (a: number) => number; + readonly rawdeserializedworld_takeIslandManager: (a: number) => number; + readonly rawdeserializedworld_takeMultibodyJoints: (a: number) => number; + readonly rawdeserializedworld_takeNarrowPhase: (a: number) => number; + readonly raweventqueue_clear: (a: number) => void; + readonly raweventqueue_drainCollisionEvents: (a: number, b: number) => void; + readonly raweventqueue_drainContactForceEvents: (a: number, b: number) => void; + readonly raweventqueue_new: (a: number) => number; + readonly rawgenericjoint_fixed: (a: number, b: number, c: number, d: number) => number; + readonly rawgenericjoint_prismatic: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawgenericjoint_revolute: (a: number, b: number) => number; + readonly rawgenericjoint_rope: (a: number, b: number, c: number) => number; + readonly rawgenericjoint_spring: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawimpulsejointset_contains: (a: number, b: number) => number; + readonly rawimpulsejointset_createJoint: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawimpulsejointset_forEachJointAttachedToRigidBody: (a: number, b: number, c: number) => void; + readonly rawimpulsejointset_forEachJointHandle: (a: number, b: number) => void; + readonly rawimpulsejointset_jointAnchor1: (a: number, b: number) => number; + readonly rawimpulsejointset_jointAnchor2: (a: number, b: number) => number; + readonly rawimpulsejointset_jointBodyHandle1: (a: number, b: number) => number; + readonly rawimpulsejointset_jointBodyHandle2: (a: number, b: number) => number; + readonly rawimpulsejointset_jointConfigureMotor: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void; + readonly rawimpulsejointset_jointConfigureMotorModel: (a: number, b: number, c: number, d: number) => void; + readonly rawimpulsejointset_jointConfigureMotorPosition: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly rawimpulsejointset_jointConfigureMotorVelocity: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawimpulsejointset_jointContactsEnabled: (a: number, b: number) => number; + readonly rawimpulsejointset_jointFrameX1: (a: number, b: number) => number; + readonly rawimpulsejointset_jointFrameX2: (a: number, b: number) => number; + readonly rawimpulsejointset_jointLimitsEnabled: (a: number, b: number, c: number) => number; + readonly rawimpulsejointset_jointLimitsMax: (a: number, b: number, c: number) => number; + readonly rawimpulsejointset_jointLimitsMin: (a: number, b: number, c: number) => number; + readonly rawimpulsejointset_jointSetAnchor1: (a: number, b: number, c: number) => void; + readonly rawimpulsejointset_jointSetAnchor2: (a: number, b: number, c: number) => void; + readonly rawimpulsejointset_jointSetContactsEnabled: (a: number, b: number, c: number) => void; + readonly rawimpulsejointset_jointSetLimits: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawimpulsejointset_jointType: (a: number, b: number) => number; + readonly rawimpulsejointset_len: (a: number) => number; + readonly rawimpulsejointset_new: () => number; + readonly rawimpulsejointset_remove: (a: number, b: number, c: number) => void; + readonly rawintegrationparameters_contact_erp: (a: number) => number; + readonly rawintegrationparameters_dt: (a: number) => number; + readonly rawintegrationparameters_lengthUnit: (a: number) => number; + readonly rawintegrationparameters_maxCcdSubsteps: (a: number) => number; + readonly rawintegrationparameters_minIslandSize: (a: number) => number; + readonly rawintegrationparameters_new: () => number; + readonly rawintegrationparameters_numInternalPgsIterations: (a: number) => number; + readonly rawintegrationparameters_numSolverIterations: (a: number) => number; + readonly rawintegrationparameters_set_contact_natural_frequency: (a: number, b: number) => void; + readonly rawintegrationparameters_set_dt: (a: number, b: number) => void; + readonly rawintegrationparameters_set_lengthUnit: (a: number, b: number) => void; + readonly rawintegrationparameters_set_maxCcdSubsteps: (a: number, b: number) => void; + readonly rawintegrationparameters_set_minIslandSize: (a: number, b: number) => void; + readonly rawintegrationparameters_set_normalizedAllowedLinearError: (a: number, b: number) => void; + readonly rawintegrationparameters_set_normalizedPredictionDistance: (a: number, b: number) => void; + readonly rawintegrationparameters_set_numInternalPgsIterations: (a: number, b: number) => void; + readonly rawintegrationparameters_set_numSolverIterations: (a: number, b: number) => void; + readonly rawislandmanager_forEachActiveRigidBodyHandle: (a: number, b: number) => void; + readonly rawislandmanager_new: () => number; + readonly rawkinematiccharactercontroller_autostepEnabled: (a: number) => number; + readonly rawkinematiccharactercontroller_autostepIncludesDynamicBodies: (a: number) => number; + readonly rawkinematiccharactercontroller_autostepMaxHeight: (a: number) => number; + readonly rawkinematiccharactercontroller_autostepMinWidth: (a: number) => number; + readonly rawkinematiccharactercontroller_computeColliderMovement: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void; + readonly rawkinematiccharactercontroller_computedCollision: (a: number, b: number, c: number) => number; + readonly rawkinematiccharactercontroller_computedGrounded: (a: number) => number; + readonly rawkinematiccharactercontroller_computedMovement: (a: number) => number; + readonly rawkinematiccharactercontroller_disableAutostep: (a: number) => void; + readonly rawkinematiccharactercontroller_disableSnapToGround: (a: number) => void; + readonly rawkinematiccharactercontroller_enableAutostep: (a: number, b: number, c: number, d: number) => void; + readonly rawkinematiccharactercontroller_enableSnapToGround: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_maxSlopeClimbAngle: (a: number) => number; + readonly rawkinematiccharactercontroller_minSlopeSlideAngle: (a: number) => number; + readonly rawkinematiccharactercontroller_new: (a: number) => number; + readonly rawkinematiccharactercontroller_normalNudgeFactor: (a: number) => number; + readonly rawkinematiccharactercontroller_numComputedCollisions: (a: number) => number; + readonly rawkinematiccharactercontroller_offset: (a: number) => number; + readonly rawkinematiccharactercontroller_setMaxSlopeClimbAngle: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_setMinSlopeSlideAngle: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_setNormalNudgeFactor: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_setOffset: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_setSlideEnabled: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_setUp: (a: number, b: number) => void; + readonly rawkinematiccharactercontroller_slideEnabled: (a: number) => number; + readonly rawkinematiccharactercontroller_snapToGroundDistance: (a: number) => number; + readonly rawkinematiccharactercontroller_snapToGroundEnabled: (a: number) => number; + readonly rawmultibodyjointset_contains: (a: number, b: number) => number; + readonly rawmultibodyjointset_createJoint: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawmultibodyjointset_forEachJointAttachedToRigidBody: (a: number, b: number, c: number) => void; + readonly rawmultibodyjointset_forEachJointHandle: (a: number, b: number) => void; + readonly rawmultibodyjointset_jointAnchor1: (a: number, b: number) => number; + readonly rawmultibodyjointset_jointAnchor2: (a: number, b: number) => number; + readonly rawmultibodyjointset_jointContactsEnabled: (a: number, b: number) => number; + readonly rawmultibodyjointset_jointFrameX1: (a: number, b: number) => number; + readonly rawmultibodyjointset_jointFrameX2: (a: number, b: number) => number; + readonly rawmultibodyjointset_jointLimitsEnabled: (a: number, b: number, c: number) => number; + readonly rawmultibodyjointset_jointLimitsMax: (a: number, b: number, c: number) => number; + readonly rawmultibodyjointset_jointLimitsMin: (a: number, b: number, c: number) => number; + readonly rawmultibodyjointset_jointSetContactsEnabled: (a: number, b: number, c: number) => void; + readonly rawmultibodyjointset_jointType: (a: number, b: number) => number; + readonly rawmultibodyjointset_new: () => number; + readonly rawmultibodyjointset_remove: (a: number, b: number, c: number) => void; + readonly rawnarrowphase_contact_pair: (a: number, b: number, c: number) => number; + readonly rawnarrowphase_contact_pairs_with: (a: number, b: number, c: number) => void; + readonly rawnarrowphase_intersection_pair: (a: number, b: number, c: number) => number; + readonly rawnarrowphase_intersection_pairs_with: (a: number, b: number, c: number) => void; + readonly rawnarrowphase_new: () => number; + readonly rawphysicspipeline_is_profiler_enabled: (a: number) => number; + readonly rawphysicspipeline_new: () => number; + readonly rawphysicspipeline_set_profiler_enabled: (a: number, b: number) => void; + readonly rawphysicspipeline_step: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void; + readonly rawphysicspipeline_stepWithEvents: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void; + readonly rawphysicspipeline_timing_broad_phase: (a: number) => number; + readonly rawphysicspipeline_timing_ccd: (a: number) => number; + readonly rawphysicspipeline_timing_ccd_broad_phase: (a: number) => number; + readonly rawphysicspipeline_timing_ccd_narrow_phase: (a: number) => number; + readonly rawphysicspipeline_timing_ccd_solver: (a: number) => number; + readonly rawphysicspipeline_timing_ccd_toi_computation: (a: number) => number; + readonly rawphysicspipeline_timing_collision_detection: (a: number) => number; + readonly rawphysicspipeline_timing_island_construction: (a: number) => number; + readonly rawphysicspipeline_timing_narrow_phase: (a: number) => number; + readonly rawphysicspipeline_timing_solver: (a: number) => number; + readonly rawphysicspipeline_timing_step: (a: number) => number; + readonly rawphysicspipeline_timing_user_changes: (a: number) => number; + readonly rawphysicspipeline_timing_velocity_assembly: (a: number) => number; + readonly rawphysicspipeline_timing_velocity_resolution: (a: number) => number; + readonly rawphysicspipeline_timing_velocity_update: (a: number) => number; + readonly rawphysicspipeline_timing_velocity_writeback: (a: number) => number; + readonly rawpidcontroller_angular_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawpidcontroller_apply_angular_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly rawpidcontroller_apply_linear_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly rawpidcontroller_linear_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawpidcontroller_new: (a: number, b: number, c: number, d: number) => number; + readonly rawpidcontroller_reset_integrals: (a: number) => void; + readonly rawpidcontroller_set_axes_mask: (a: number, b: number) => void; + readonly rawpidcontroller_set_kd: (a: number, b: number, c: number) => void; + readonly rawpidcontroller_set_ki: (a: number, b: number, c: number) => void; + readonly rawpidcontroller_set_kp: (a: number, b: number, c: number) => void; + readonly rawpointcolliderprojection_colliderHandle: (a: number) => number; + readonly rawpointcolliderprojection_featureId: (a: number) => number; + readonly rawpointcolliderprojection_featureType: (a: number) => number; + readonly rawpointcolliderprojection_isInside: (a: number) => number; + readonly rawpointcolliderprojection_point: (a: number) => number; + readonly rawpointprojection_isInside: (a: number) => number; + readonly rawpointprojection_point: (a: number) => number; + readonly rawrigidbodyset_contains: (a: number, b: number) => number; + readonly rawrigidbodyset_createRigidBody: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number) => number; + readonly rawrigidbodyset_forEachRigidBodyHandle: (a: number, b: number) => void; + readonly rawrigidbodyset_len: (a: number) => number; + readonly rawrigidbodyset_new: () => number; + readonly rawrigidbodyset_propagateModifiedBodyPositionsToColliders: (a: number, b: number) => void; + readonly rawrigidbodyset_rbAddForce: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbAddForceAtPoint: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawrigidbodyset_rbAddTorque: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbAdditionalSolverIterations: (a: number, b: number) => number; + readonly rawrigidbodyset_rbAngularDamping: (a: number, b: number) => number; + readonly rawrigidbodyset_rbAngvel: (a: number, b: number) => number; + readonly rawrigidbodyset_rbApplyImpulse: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbApplyImpulseAtPoint: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawrigidbodyset_rbApplyTorqueImpulse: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbBodyType: (a: number, b: number) => number; + readonly rawrigidbodyset_rbCollider: (a: number, b: number, c: number) => number; + readonly rawrigidbodyset_rbDominanceGroup: (a: number, b: number) => number; + readonly rawrigidbodyset_rbEffectiveAngularInertia: (a: number, b: number) => number; + readonly rawrigidbodyset_rbEffectiveInvMass: (a: number, b: number) => number; + readonly rawrigidbodyset_rbEffectiveWorldInvInertia: (a: number, b: number) => number; + readonly rawrigidbodyset_rbEnableCcd: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbGravityScale: (a: number, b: number) => number; + readonly rawrigidbodyset_rbInvMass: (a: number, b: number) => number; + readonly rawrigidbodyset_rbInvPrincipalInertia: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsCcdEnabled: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsDynamic: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsEnabled: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsFixed: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsKinematic: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsMoving: (a: number, b: number) => number; + readonly rawrigidbodyset_rbIsSleeping: (a: number, b: number) => number; + readonly rawrigidbodyset_rbLinearDamping: (a: number, b: number) => number; + readonly rawrigidbodyset_rbLinvel: (a: number, b: number) => number; + readonly rawrigidbodyset_rbLocalCom: (a: number, b: number) => number; + readonly rawrigidbodyset_rbLockRotations: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbLockTranslations: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbMass: (a: number, b: number) => number; + readonly rawrigidbodyset_rbNextRotation: (a: number, b: number) => number; + readonly rawrigidbodyset_rbNextTranslation: (a: number, b: number) => number; + readonly rawrigidbodyset_rbNumColliders: (a: number, b: number) => number; + readonly rawrigidbodyset_rbPrincipalInertia: (a: number, b: number) => number; + readonly rawrigidbodyset_rbRecomputeMassPropertiesFromColliders: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbResetForces: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbResetTorques: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbRotation: (a: number, b: number) => number; + readonly rawrigidbodyset_rbSetAdditionalMass: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetAdditionalMassProperties: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly rawrigidbodyset_rbSetAdditionalSolverIterations: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetAngularDamping: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetAngvel: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetBodyType: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetDominanceGroup: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetEnabled: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetEnabledTranslations: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawrigidbodyset_rbSetGravityScale: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetLinearDamping: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetLinvel: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetNextKinematicRotation: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetNextKinematicTranslation: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetRotation: (a: number, b: number, c: number, d: number) => void; + readonly rawrigidbodyset_rbSetSoftCcdPrediction: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSetTranslation: (a: number, b: number, c: number, d: number, e: number) => void; + readonly rawrigidbodyset_rbSetUserData: (a: number, b: number, c: number) => void; + readonly rawrigidbodyset_rbSleep: (a: number, b: number) => void; + readonly rawrigidbodyset_rbSoftCcdPrediction: (a: number, b: number) => number; + readonly rawrigidbodyset_rbTranslation: (a: number, b: number) => number; + readonly rawrigidbodyset_rbUserData: (a: number, b: number) => number; + readonly rawrigidbodyset_rbUserForce: (a: number, b: number) => number; + readonly rawrigidbodyset_rbUserTorque: (a: number, b: number) => number; + readonly rawrigidbodyset_rbVelocityAtPoint: (a: number, b: number, c: number) => number; + readonly rawrigidbodyset_rbWakeUp: (a: number, b: number) => void; + readonly rawrigidbodyset_rbWorldCom: (a: number, b: number) => number; + readonly rawrigidbodyset_remove: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly rawrotation_angle: (a: number) => number; + readonly rawrotation_fromAngle: (a: number) => number; + readonly rawrotation_identity: () => number; + readonly rawserializationpipeline_deserializeAll: (a: number, b: number) => number; + readonly rawserializationpipeline_serializeAll: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number; + readonly rawshape_ball: (a: number) => number; + readonly rawshape_capsule: (a: number, b: number) => number; + readonly rawshape_castRay: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; + readonly rawshape_castRayAndGetNormal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; + readonly rawshape_castShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number; + readonly rawshape_contactShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; + readonly rawshape_containsPoint: (a: number, b: number, c: number, d: number) => number; + readonly rawshape_convexHull: (a: number, b: number) => number; + readonly rawshape_convexPolyline: (a: number, b: number) => number; + readonly rawshape_cuboid: (a: number, b: number) => number; + readonly rawshape_halfspace: (a: number) => number; + readonly rawshape_heightfield: (a: number, b: number, c: number) => number; + readonly rawshape_intersectsRay: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawshape_intersectsShape: (a: number, b: number, c: number, d: number, e: number, f: number) => number; + readonly rawshape_polyline: (a: number, b: number, c: number, d: number) => number; + readonly rawshape_projectPoint: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawshape_roundConvexHull: (a: number, b: number, c: number) => number; + readonly rawshape_roundConvexPolyline: (a: number, b: number, c: number) => number; + readonly rawshape_roundCuboid: (a: number, b: number, c: number) => number; + readonly rawshape_roundTriangle: (a: number, b: number, c: number, d: number) => number; + readonly rawshape_segment: (a: number, b: number) => number; + readonly rawshape_triangle: (a: number, b: number, c: number) => number; + readonly rawshape_trimesh: (a: number, b: number, c: number, d: number, e: number) => number; + readonly rawshape_voxels: (a: number, b: number, c: number) => number; + readonly rawshape_voxelsFromPoints: (a: number, b: number, c: number) => number; + readonly rawshapecasthit_witness1: (a: number) => number; + readonly rawvector_new: (a: number, b: number) => number; + readonly rawvector_set_y: (a: number, b: number) => void; + readonly rawvector_xy: (a: number) => number; + readonly rawvector_yx: (a: number) => number; + readonly rawvector_zero: () => number; + readonly version: (a: number) => void; + readonly rawcolliderset_isHandleValid: (a: number, b: number) => number; + readonly rawvector_set_x: (a: number, b: number) => void; + readonly reserve_memory: (a: number) => void; + readonly rawraycolliderintersection_featureId: (a: number) => number; + readonly rawrayintersection_featureId: (a: number) => number; + readonly rawcontactforceevent_collider1: (a: number) => number; + readonly rawintegrationparameters_normalizedAllowedLinearError: (a: number) => number; + readonly rawintegrationparameters_normalizedPredictionDistance: (a: number) => number; + readonly rawraycolliderhit_colliderHandle: (a: number) => number; + readonly rawraycolliderhit_timeOfImpact: (a: number) => number; + readonly rawraycolliderintersection_colliderHandle: (a: number) => number; + readonly rawraycolliderintersection_featureType: (a: number) => number; + readonly rawraycolliderintersection_time_of_impact: (a: number) => number; + readonly rawrayintersection_featureType: (a: number) => number; + readonly rawrayintersection_time_of_impact: (a: number) => number; + readonly rawrotation_im: (a: number) => number; + readonly rawrotation_re: (a: number) => number; + readonly rawshapecasthit_time_of_impact: (a: number) => number; + readonly rawshapecontact_distance: (a: number) => number; + readonly rawvector_x: (a: number) => number; + readonly rawvector_y: (a: number) => number; + readonly __wbg_rawcontactpair_free: (a: number, b: number) => void; + readonly __wbg_rawraycolliderhit_free: (a: number, b: number) => void; + readonly __wbg_rawraycolliderintersection_free: (a: number, b: number) => void; + readonly __wbg_rawserializationpipeline_free: (a: number, b: number) => void; + readonly __wbg_rawshapecasthit_free: (a: number, b: number) => void; + readonly rawcontactforceevent_max_force_direction: (a: number) => number; + readonly rawkinematiccharactercontroller_up: (a: number) => number; + readonly rawraycolliderintersection_normal: (a: number) => number; + readonly rawrayintersection_normal: (a: number) => number; + readonly rawshapecasthit_normal1: (a: number) => number; + readonly rawshapecasthit_normal2: (a: number) => number; + readonly rawshapecasthit_witness2: (a: number) => number; + readonly rawshapecontact_normal1: (a: number) => number; + readonly rawshapecontact_normal2: (a: number) => number; + readonly rawshapecontact_point1: (a: number) => number; + readonly rawshapecontact_point2: (a: number) => number; + readonly rawccdsolver_new: () => number; + readonly rawserializationpipeline_new: () => number; + readonly __wbindgen_export_0: (a: number) => void; + readonly __wbindgen_add_to_stack_pointer: (a: number) => number; + readonly __wbindgen_export_1: (a: number, b: number, c: number) => void; + readonly __wbindgen_export_2: (a: number, b: number) => number; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. +* +* @returns {InitOutput} +*/ +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise} +*/ +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise; diff --git a/packages/rapier2d/pkg/rapier_wasm2d.js b/packages/rapier2d/pkg/rapier_wasm2d.js new file mode 100644 index 00000000..5867c4a3 --- /dev/null +++ b/packages/rapier2d/pkg/rapier_wasm2d.js @@ -0,0 +1,5461 @@ +let wasm; + +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_export_0(addHeapObject(e)); + } +} + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} +/** + * @param {number} extra_bytes_count + */ +export function reserve_memory(extra_bytes_count) { + wasm.reserve_memory(extra_bytes_count); +} + +/** + * @returns {string} + */ +export function version() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.version(retptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1); + } +} + +function _assertClass(instance, klass) { + if (!(instance instanceof klass)) { + throw new Error(`expected instance of ${klass.name}`); + } +} + +let stack_pointer = 128; + +function addBorrowedObject(obj) { + if (stack_pointer == 1) throw new Error('out of js stack'); + heap[--stack_pointer] = obj; + return stack_pointer; +} + +let cachedFloat32ArrayMemory0 = null; + +function getFloat32ArrayMemory0() { + if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) { + cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer); + } + return cachedFloat32ArrayMemory0; +} + +let WASM_VECTOR_LEN = 0; + +function passArrayF32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getFloat32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +let cachedUint32ArrayMemory0 = null; + +function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; +} + +function passArray32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getUint32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function getArrayF32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +let cachedInt32ArrayMemory0 = null; + +function getInt32ArrayMemory0() { + if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) { + cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32ArrayMemory0; +} + +function getArrayI32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +function getArrayU32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} +/** + * @enum {0 | 1 | 2} + */ +export const RawFeatureType = Object.freeze({ + Vertex: 0, "0": "Vertex", + Face: 1, "1": "Face", + Unknown: 2, "2": "Unknown", +}); +/** + * @enum {0 | 1 | 2} + */ +export const RawJointAxis = Object.freeze({ + LinX: 0, "0": "LinX", + LinY: 1, "1": "LinY", + AngX: 2, "2": "AngX", +}); +/** + * @enum {0 | 1 | 2 | 3 | 4 | 5} + */ +export 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", +}); +/** + * @enum {0 | 1} + */ +export const RawMotorModel = Object.freeze({ + AccelerationBased: 0, "0": "AccelerationBased", + ForceBased: 1, "1": "ForceBased", +}); +/** + * @enum {0 | 1 | 2 | 3} + */ +export const RawRigidBodyType = Object.freeze({ + Dynamic: 0, "0": "Dynamic", + Fixed: 1, "1": "Fixed", + KinematicPositionBased: 2, "2": "KinematicPositionBased", + KinematicVelocityBased: 3, "3": "KinematicVelocityBased", +}); +/** + * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14} + */ +export 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", + Voxels: 14, "14": "Voxels", +}); + +const RawBroadPhaseFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawbroadphase_free(ptr >>> 0, 1)); + +export class RawBroadPhase { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawBroadPhase.prototype); + obj.__wbg_ptr = ptr; + RawBroadPhaseFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawBroadPhaseFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawbroadphase_free(ptr, 0); + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} point + * @param {boolean} solid + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + * @returns {RawPointColliderProjection | undefined} + */ + projectPoint(narrow_phase, bodies, colliders, point, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(point, RawVector); + const ret = wasm.rawbroadphase_projectPoint(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, solid, filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + return ret === 0 ? undefined : RawPointColliderProjection.__wrap(ret); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + * @returns {RawRayColliderIntersection | undefined} + */ + castRayAndGetNormal(narrow_phase, bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + return ret === 0 ? undefined : RawRayColliderIntersection.__wrap(ret); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @param {Function} callback + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + */ + intersectionsWithRay(narrow_phase, bodies, colliders, rayOrig, rayDir, maxToi, solid, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + wasm.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, addBorrowedObject(callback), filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + } finally { + heap[stack_pointer++] = undefined; + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawShape} shape + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + * @returns {number | undefined} + */ + intersectionWithShape(narrow_phase, bodies, colliders, shapePos, shapeRot, shape, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(shape, RawShape); + wasm.rawbroadphase_intersectionWithShape(retptr, this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shape.__wbg_ptr, filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true); + return r0 === 0 ? undefined : r2; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} point + * @param {Function} callback + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + */ + intersectionsWithPoint(narrow_phase, bodies, colliders, point, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(point, RawVector); + wasm.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, addBorrowedObject(callback), filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + } finally { + heap[stack_pointer++] = undefined; + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawShape} shape + * @param {Function} callback + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + */ + intersectionsWithShape(narrow_phase, bodies, colliders, shapePos, shapeRot, shape, callback, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(shape, RawShape); + wasm.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, shape.__wbg_ptr, addBorrowedObject(callback), filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + } finally { + heap[stack_pointer++] = undefined; + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} point + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + * @returns {RawPointColliderProjection | undefined} + */ + projectPointAndGetFeature(narrow_phase, bodies, colliders, point, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(point, RawVector); + const ret = wasm.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, point.__wbg_ptr, filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + return ret === 0 ? undefined : RawPointColliderProjection.__wrap(ret); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} aabbCenter + * @param {RawVector} aabbHalfExtents + * @param {Function} callback + */ + collidersWithAabbIntersectingAabb(narrow_phase, bodies, colliders, aabbCenter, aabbHalfExtents, callback) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(aabbCenter, RawVector); + _assertClass(aabbHalfExtents, RawVector); + wasm.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, aabbCenter.__wbg_ptr, aabbHalfExtents.__wbg_ptr, addBorrowedObject(callback)); + } finally { + heap[stack_pointer++] = undefined; + } + } + constructor() { + const ret = wasm.rawbroadphase_new(); + this.__wbg_ptr = ret >>> 0; + RawBroadPhaseFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + * @returns {RawRayColliderHit | undefined} + */ + castRay(narrow_phase, bodies, colliders, rayOrig, rayDir, maxToi, solid, filter_flags, filter_groups, filter_exclude_collider, filter_exclude_rigid_body, filter_predicate) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawbroadphase_castRay(this.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid, filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, !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)); + return ret === 0 ? undefined : RawRayColliderHit.__wrap(ret); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawVector} shapeVel + * @param {RawShape} shape + * @param {number} target_distance + * @param {number} maxToi + * @param {boolean} stop_at_penetration + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {number | null | undefined} filter_exclude_collider + * @param {number | null | undefined} filter_exclude_rigid_body + * @param {Function} filter_predicate + * @returns {RawColliderShapeCastHit | undefined} + */ + castShape(narrow_phase, 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) { + try { + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(shapeVel, RawVector); + _assertClass(shape, RawShape); + const ret = wasm.rawbroadphase_castShape(this.__wbg_ptr, narrow_phase.__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) ? 0x100000001 : (filter_groups) >>> 0, !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)); + return ret === 0 ? undefined : RawColliderShapeCastHit.__wrap(ret); + } finally { + heap[stack_pointer++] = undefined; + } + } +} + +const RawCCDSolverFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawccdsolver_free(ptr >>> 0, 1)); + +export class RawCCDSolver { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawCCDSolverFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawccdsolver_free(ptr, 0); + } + constructor() { + const ret = wasm.rawccdsolver_new(); + this.__wbg_ptr = ret >>> 0; + RawCCDSolverFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +const RawCharacterCollisionFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawcharactercollision_free(ptr >>> 0, 1)); + +export class RawCharacterCollision { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawCharacterCollisionFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawcharactercollision_free(ptr, 0); + } + /** + * @returns {RawVector} + */ + worldNormal1() { + const ret = wasm.rawcharactercollision_worldNormal1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + worldNormal2() { + const ret = wasm.rawcharactercollision_worldNormal2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + worldWitness1() { + const ret = wasm.rawcharactercollision_worldWitness1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + worldWitness2() { + const ret = wasm.rawcharactercollision_worldWitness2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + translationDeltaApplied() { + const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + translationDeltaRemaining() { + const ret = wasm.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + constructor() { + const ret = wasm.rawcharactercollision_new(); + this.__wbg_ptr = ret >>> 0; + RawCharacterCollisionFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @returns {number} + */ + toi() { + const ret = wasm.rawcharactercollision_toi(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + handle() { + const ret = wasm.rawcharactercollision_handle(this.__wbg_ptr); + return ret; + } +} + +const RawColliderSetFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawcolliderset_free(ptr >>> 0, 1)); + +export class RawColliderSet { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawColliderSet.prototype); + obj.__wbg_ptr = ptr; + RawColliderSetFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawColliderSetFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawcolliderset_free(ptr, 0); + } + /** + * Checks if a collider with the given integer handle exists. + * @param {number} handle + * @returns {boolean} + */ + isHandleValid(handle) { + const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * @param {boolean} enabled + * @param {RawShape} shape + * @param {RawVector} translation + * @param {RawRotation} rotation + * @param {number} massPropsMode + * @param {number} mass + * @param {RawVector} centerOfMass + * @param {number} principalAngularInertia + * @param {number} density + * @param {number} friction + * @param {number} restitution + * @param {number} frictionCombineRule + * @param {number} restitutionCombineRule + * @param {boolean} isSensor + * @param {number} collisionGroups + * @param {number} solverGroups + * @param {number} activeCollisionTypes + * @param {number} activeHooks + * @param {number} activeEvents + * @param {number} contactForceEventThreshold + * @param {number} contactSkin + * @param {boolean} hasParent + * @param {number} parent + * @param {RawRigidBodySet} bodies + * @returns {number | undefined} + */ + 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) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertClass(shape, RawShape); + _assertClass(translation, RawVector); + _assertClass(rotation, RawRotation); + _assertClass(centerOfMass, RawVector); + _assertClass(bodies, RawRigidBodySet); + 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); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true); + return r0 === 0 ? undefined : r2; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * Applies the given JavaScript function to the integer handle of each collider managed by this collider set. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each collider managed by this collider set. Called as `f(handle)`. + * @param {Function} f + */ + forEachColliderHandle(f) { + try { + wasm.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @returns {number} + */ + len() { + const ret = wasm.rawcolliderset_len(this.__wbg_ptr); + return ret >>> 0; + } + constructor() { + const ret = wasm.rawcolliderset_new(); + this.__wbg_ptr = ret >>> 0; + RawColliderSetFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * Removes a collider from this set and wake-up the rigid-body it is attached to. + * @param {number} handle + * @param {RawIslandManager} islands + * @param {RawRigidBodySet} bodies + * @param {boolean} wakeUp + */ + remove(handle, islands, bodies, wakeUp) { + _assertClass(islands, RawIslandManager); + _assertClass(bodies, RawRigidBodySet); + wasm.rawcolliderset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, bodies.__wbg_ptr, wakeUp); + } + /** + * @param {number} handle + * @returns {boolean} + */ + contains(handle) { + const ret = wasm.rawcolliderset_contains(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * The friction coefficient of this collider. + * @param {number} handle + * @returns {number} + */ + coFriction(handle) { + const ret = wasm.rawcolliderset_coFriction(this.__wbg_ptr, handle); + return ret; + } + /** + * Is this collider a sensor? + * @param {number} handle + * @returns {boolean} + */ + coIsSensor(handle) { + const ret = wasm.rawcolliderset_coIsSensor(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * The world-space orientation of this collider. + * @param {number} handle + * @returns {RawRotation} + */ + coRotation(handle) { + const ret = wasm.rawcolliderset_coRotation(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * @param {number} handle + * @param {RawShape} shape + */ + coSetShape(handle, shape) { + _assertClass(shape, RawShape); + wasm.rawcolliderset_coSetShape(this.__wbg_ptr, handle, shape.__wbg_ptr); + } + /** + * @param {number} handle + * @param {number} ix + * @param {number} iy + * @param {boolean} filled + */ + coSetVoxel(handle, ix, iy, filled) { + wasm.rawcolliderset_coSetVoxel(this.__wbg_ptr, handle, ix, iy, filled); + } + /** + * The vertices of this triangle mesh, polyline, convex polyhedron, segment, triangle or convex polyhedron, if it is one. + * @param {number} handle + * @returns {Float32Array | undefined} + */ + coVertices(handle) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.rawcolliderset_coVertices(retptr, this.__wbg_ptr, handle); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getArrayF32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_1(r0, r1 * 4, 4); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {number} handle + * @param {RawVector} colliderVel + * @param {RawShape} shape2 + * @param {RawVector} shape2Pos + * @param {RawRotation} shape2Rot + * @param {RawVector} shape2Vel + * @param {number} target_distance + * @param {number} maxToi + * @param {boolean} stop_at_penetration + * @returns {RawShapeCastHit | undefined} + */ + coCastShape(handle, colliderVel, shape2, shape2Pos, shape2Rot, shape2Vel, target_distance, maxToi, stop_at_penetration) { + _assertClass(colliderVel, RawVector); + _assertClass(shape2, RawShape); + _assertClass(shape2Pos, RawVector); + _assertClass(shape2Rot, RawRotation); + _assertClass(shape2Vel, RawVector); + 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); + return ret === 0 ? undefined : RawShapeCastHit.__wrap(ret); + } + /** + * @param {number} handle + * @returns {boolean} + */ + coIsEnabled(handle) { + const ret = wasm.rawcolliderset_coIsEnabled(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * Set the radius of this collider if it is a ball, capsule, cylinder, or cone shape. + * @param {number} handle + * @param {number} newRadius + */ + coSetRadius(handle, newRadius) { + wasm.rawcolliderset_coSetRadius(this.__wbg_ptr, handle, newRadius); + } + /** + * @param {number} handle + * @param {boolean} is_sensor + */ + coSetSensor(handle, is_sensor) { + wasm.rawcolliderset_coSetSensor(this.__wbg_ptr, handle, is_sensor); + } + /** + * The type of the shape of this collider. + * @param {number} handle + * @returns {RawShapeType} + */ + coShapeType(handle) { + const ret = wasm.rawcolliderset_coShapeType(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @returns {Int32Array | undefined} + */ + coVoxelData(handle) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.rawcolliderset_coVoxelData(retptr, this.__wbg_ptr, handle); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getArrayI32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_1(r0, r1 * 4, 4); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {number} handle + * @returns {RawVector | undefined} + */ + coVoxelSize(handle) { + const ret = wasm.rawcolliderset_coVoxelSize(this.__wbg_ptr, handle); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * The half height of this collider if it is a capsule, cylinder, or cone shape. + * @param {number} handle + * @returns {number | undefined} + */ + coHalfHeight(handle) { + const ret = wasm.rawcolliderset_coHalfHeight(this.__wbg_ptr, handle); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number} handle + * @param {number} density + */ + coSetDensity(handle, density) { + wasm.rawcolliderset_coSetDensity(this.__wbg_ptr, handle, density); + } + /** + * @param {number} handle + * @param {boolean} enabled + */ + coSetEnabled(handle, enabled) { + wasm.rawcolliderset_coSetEnabled(this.__wbg_ptr, handle, enabled); + } + /** + * The physics hooks enabled for this collider. + * @param {number} handle + * @returns {number} + */ + coActiveHooks(handle) { + const ret = wasm.rawcolliderset_coActiveHooks(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * @param {number} handle + * @returns {number} + */ + coContactSkin(handle) { + const ret = wasm.rawcolliderset_coContactSkin(this.__wbg_ptr, handle); + return ret; + } + /** + * The half-extents of this collider if it is has a cuboid shape. + * @param {number} handle + * @returns {RawVector | undefined} + */ + coHalfExtents(handle) { + const ret = wasm.rawcolliderset_coHalfExtents(this.__wbg_ptr, handle); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * The restitution coefficient of this collider. + * @param {number} handle + * @returns {number} + */ + coRestitution(handle) { + const ret = wasm.rawcolliderset_coRestitution(this.__wbg_ptr, handle); + return ret; + } + /** + * The radius of the round edges of this collider. + * @param {number} handle + * @returns {number | undefined} + */ + coRoundRadius(handle) { + const ret = wasm.rawcolliderset_coRoundRadius(this.__wbg_ptr, handle); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number} handle + * @param {number} friction + */ + coSetFriction(handle, friction) { + wasm.rawcolliderset_coSetFriction(this.__wbg_ptr, handle, friction); + } + /** + * Sets the rotation angle of this collider. + * + * # Parameters + * - `angle`: the rotation angle, in radians. + * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + * @param {number} handle + * @param {number} angle + */ + coSetRotation(handle, angle) { + wasm.rawcolliderset_coSetRotation(this.__wbg_ptr, handle, angle); + } + /** + * The world-space translation of this collider. + * @param {number} handle + * @returns {RawVector} + */ + coTranslation(handle) { + const ret = wasm.rawcolliderset_coTranslation(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * The events enabled for this collider. + * @param {number} handle + * @returns {number} + */ + coActiveEvents(handle) { + const ret = wasm.rawcolliderset_coActiveEvents(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * @param {number} handle + * @param {RawVector} collider1Vel + * @param {number} collider2handle + * @param {RawVector} collider2Vel + * @param {number} target_distance + * @param {number} max_toi + * @param {boolean} stop_at_penetration + * @returns {RawColliderShapeCastHit | undefined} + */ + coCastCollider(handle, collider1Vel, collider2handle, collider2Vel, target_distance, max_toi, stop_at_penetration) { + _assertClass(collider1Vel, RawVector); + _assertClass(collider2Vel, RawVector); + const ret = wasm.rawcolliderset_coCastCollider(this.__wbg_ptr, handle, collider1Vel.__wbg_ptr, collider2handle, collider2Vel.__wbg_ptr, target_distance, max_toi, stop_at_penetration); + return ret === 0 ? undefined : RawColliderShapeCastHit.__wrap(ret); + } + /** + * @param {number} handle + * @param {RawShape} shape2 + * @param {RawVector} shapePos2 + * @param {RawRotation} shapeRot2 + * @param {number} prediction + * @returns {RawShapeContact | undefined} + */ + coContactShape(handle, shape2, shapePos2, shapeRot2, prediction) { + _assertClass(shape2, RawShape); + _assertClass(shapePos2, RawVector); + _assertClass(shapeRot2, RawRotation); + const ret = wasm.rawcolliderset_coContactShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction); + return ret === 0 ? undefined : RawShapeContact.__wrap(ret); + } + /** + * @param {number} handle + * @param {RawVector} point + * @param {boolean} solid + * @returns {RawPointProjection} + */ + coProjectPoint(handle, point, solid) { + _assertClass(point, RawVector); + const ret = wasm.rawcolliderset_coProjectPoint(this.__wbg_ptr, handle, point.__wbg_ptr, solid); + return RawPointProjection.__wrap(ret); + } + /** + * The solver groups of this collider. + * @param {number} handle + * @returns {number} + */ + coSolverGroups(handle) { + const ret = wasm.rawcolliderset_coSolverGroups(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * @param {number} handle + * @returns {number | undefined} + */ + coTriMeshFlags(handle) { + const ret = wasm.rawcolliderset_coTriMeshFlags(this.__wbg_ptr, handle); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number} handle + * @param {RawVector} point + * @returns {boolean} + */ + coContainsPoint(handle, point) { + _assertClass(point, RawVector); + const ret = wasm.rawcolliderset_coContainsPoint(this.__wbg_ptr, handle, point.__wbg_ptr); + return ret !== 0; + } + /** + * @param {number} handle + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @returns {boolean} + */ + coIntersectsRay(handle, rayOrig, rayDir, maxToi) { + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawcolliderset_coIntersectsRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi); + return ret !== 0; + } + /** + * Set the half height of this collider if it is a capsule, cylinder, or cone shape. + * @param {number} handle + * @param {number} newHalfheight + */ + coSetHalfHeight(handle, newHalfheight) { + wasm.rawcolliderset_coSetHalfHeight(this.__wbg_ptr, handle, newHalfheight); + } + /** + * @param {number} handle + * @param {number} hooks + */ + coSetActiveHooks(handle, hooks) { + wasm.rawcolliderset_coSetActiveHooks(this.__wbg_ptr, handle, hooks); + } + /** + * @param {number} handle + * @param {number} contact_skin + */ + coSetContactSkin(handle, contact_skin) { + wasm.rawcolliderset_coSetContactSkin(this.__wbg_ptr, handle, contact_skin); + } + /** + * Set the half-extents of this collider if it has a cuboid shape. + * @param {number} handle + * @param {RawVector} newHalfExtents + */ + coSetHalfExtents(handle, newHalfExtents) { + _assertClass(newHalfExtents, RawVector); + wasm.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, handle, newHalfExtents.__wbg_ptr); + } + /** + * @param {number} handle + * @param {number} restitution + */ + coSetRestitution(handle, restitution) { + wasm.rawcolliderset_coSetRestitution(this.__wbg_ptr, handle, restitution); + } + /** + * Set the radius of the round edges of this collider. + * @param {number} handle + * @param {number} newBorderRadius + */ + coSetRoundRadius(handle, newBorderRadius) { + wasm.rawcolliderset_coSetRoundRadius(this.__wbg_ptr, handle, newBorderRadius); + } + /** + * Sets the translation of this collider. + * + * # Parameters + * - `x`: the world-space position of the collider along the `x` axis. + * - `y`: the world-space position of the collider along the `y` axis. + * - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + * @param {number} handle + * @param {number} x + * @param {number} y + */ + coSetTranslation(handle, x, y) { + wasm.rawcolliderset_coSetTranslation(this.__wbg_ptr, handle, x, y); + } + /** + * The collision groups of this collider. + * @param {number} handle + * @returns {number} + */ + coCollisionGroups(handle) { + const ret = wasm.rawcolliderset_coCollisionGroups(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * @param {number} handle + * @param {number} collider2handle + * @param {number} prediction + * @returns {RawShapeContact | undefined} + */ + coContactCollider(handle, collider2handle, prediction) { + const ret = wasm.rawcolliderset_coContactCollider(this.__wbg_ptr, handle, collider2handle, prediction); + return ret === 0 ? undefined : RawShapeContact.__wrap(ret); + } + /** + * @param {number} handle + * @returns {RawVector | undefined} + */ + coHalfspaceNormal(handle) { + const ret = wasm.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, handle); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * @param {number} handle + * @param {RawShape} shape2 + * @param {RawVector} shapePos2 + * @param {RawRotation} shapeRot2 + * @returns {boolean} + */ + coIntersectsShape(handle, shape2, shapePos2, shapeRot2) { + _assertClass(shape2, RawShape); + _assertClass(shapePos2, RawVector); + _assertClass(shapeRot2, RawRotation); + const ret = wasm.rawcolliderset_coIntersectsShape(this.__wbg_ptr, handle, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr); + return ret !== 0; + } + /** + * @param {number} handle + * @param {number} events + */ + coSetActiveEvents(handle, events) { + wasm.rawcolliderset_coSetActiveEvents(this.__wbg_ptr, handle, events); + } + /** + * @param {number} handle + * @param {number} groups + */ + coSetSolverGroups(handle, groups) { + wasm.rawcolliderset_coSetSolverGroups(this.__wbg_ptr, handle, groups); + } + /** + * The scaling factor applied of this heightfield if it is one. + * @param {number} handle + * @returns {RawVector | undefined} + */ + coHeightfieldScale(handle) { + const ret = wasm.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, handle); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * The orientation of this collider relative to its parent rigid-body. + * + * Returns the `None` if it doesn’t have a parent. + * @param {number} handle + * @returns {RawRotation | undefined} + */ + coRotationWrtParent(handle) { + const ret = wasm.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, handle); + return ret === 0 ? undefined : RawRotation.__wrap(ret); + } + /** + * @param {number} handle + * @param {number} mass + * @param {RawVector} centerOfMass + * @param {number} principalAngularInertia + */ + coSetMassProperties(handle, mass, centerOfMass, principalAngularInertia) { + _assertClass(centerOfMass, RawVector); + wasm.rawcolliderset_coSetMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia); + } + /** + * @param {number} handle1 + * @param {number} handle2 + * @param {number} shift_x + * @param {number} shift_y + */ + coCombineVoxelStates(handle1, handle2, shift_x, shift_y) { + wasm.rawcolliderset_coCombineVoxelStates(this.__wbg_ptr, handle1, handle2, shift_x, shift_y); + } + /** + * The height of this heightfield if it is one. + * @param {number} handle + * @returns {Float32Array | undefined} + */ + coHeightfieldHeights(handle) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.rawcolliderset_coHeightfieldHeights(retptr, this.__wbg_ptr, handle); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getArrayF32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_1(r0, r1 * 4, 4); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {number} handle + * @param {number} groups + */ + coSetCollisionGroups(handle, groups) { + wasm.rawcolliderset_coSetCollisionGroups(this.__wbg_ptr, handle, groups); + } + /** + * @param {number} handle + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @returns {RawRayIntersection | undefined} + */ + coCastRayAndGetNormal(handle, rayOrig, rayDir, maxToi, solid) { + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); + return ret === 0 ? undefined : RawRayIntersection.__wrap(ret); + } + /** + * @param {number} handle + * @returns {number} + */ + coFrictionCombineRule(handle) { + const ret = wasm.rawcolliderset_coFrictionCombineRule(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * The collision types enabled for this collider. + * @param {number} handle + * @returns {number} + */ + coActiveCollisionTypes(handle) { + const ret = wasm.rawcolliderset_coActiveCollisionTypes(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle1 + * @param {number} handle2 + * @param {number} ix + * @param {number} iy + * @param {number} shift_x + * @param {number} shift_y + */ + coPropagateVoxelChange(handle1, handle2, ix, iy, shift_x, shift_y) { + wasm.rawcolliderset_coPropagateVoxelChange(this.__wbg_ptr, handle1, handle2, ix, iy, shift_x, shift_y); + } + /** + * @param {number} handle + * @param {number} angle + */ + coSetRotationWrtParent(handle, angle) { + wasm.rawcolliderset_coSetRotationWrtParent(this.__wbg_ptr, handle, angle); + } + /** + * The translation of this collider relative to its parent rigid-body. + * + * Returns the `None` if it doesn’t have a parent. + * @param {number} handle + * @returns {RawVector | undefined} + */ + coTranslationWrtParent(handle) { + const ret = wasm.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, handle); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * @param {number} handle + * @returns {number} + */ + coRestitutionCombineRule(handle) { + const ret = wasm.rawcolliderset_coRestitutionCombineRule(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * @param {number} handle + * @param {number} rule + */ + coSetFrictionCombineRule(handle, rule) { + wasm.rawcolliderset_coSetFrictionCombineRule(this.__wbg_ptr, handle, rule); + } + /** + * @param {number} handle + * @param {number} types + */ + coSetActiveCollisionTypes(handle, types) { + wasm.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, handle, types); + } + /** + * @param {number} handle + * @param {number} x + * @param {number} y + */ + coSetTranslationWrtParent(handle, x, y) { + wasm.rawcolliderset_coSetTranslationWrtParent(this.__wbg_ptr, handle, x, y); + } + /** + * @param {number} handle + * @param {number} rule + */ + coSetRestitutionCombineRule(handle, rule) { + wasm.rawcolliderset_coSetRestitutionCombineRule(this.__wbg_ptr, handle, rule); + } + /** + * The total force magnitude beyond which a contact force event can be emitted. + * @param {number} handle + * @returns {number} + */ + coContactForceEventThreshold(handle) { + const ret = wasm.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @param {number} threshold + */ + coSetContactForceEventThreshold(handle, threshold) { + wasm.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, handle, threshold); + } + /** + * The mass of this collider. + * @param {number} handle + * @returns {number} + */ + coMass(handle) { + const ret = wasm.rawcolliderset_coMass(this.__wbg_ptr, handle); + return ret; + } + /** + * The unique integer identifier of the collider this collider is attached to. + * @param {number} handle + * @returns {number | undefined} + */ + coParent(handle) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.rawcolliderset_coParent(retptr, this.__wbg_ptr, handle); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true); + return r0 === 0 ? undefined : r2; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * The radius of this collider if it is a ball, capsule, cylinder, or cone shape. + * @param {number} handle + * @returns {number | undefined} + */ + coRadius(handle) { + const ret = wasm.rawcolliderset_coRadius(this.__wbg_ptr, handle); + return ret === 0x100000001 ? undefined : ret; + } + /** + * The volume of this collider. + * @param {number} handle + * @returns {number} + */ + coVolume(handle) { + const ret = wasm.rawcolliderset_coVolume(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @returns {number} + */ + coCastRay(handle, rayOrig, rayDir, maxToi, solid) { + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawcolliderset_coCastRay(this.__wbg_ptr, handle, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); + return ret; + } + /** + * The density of this collider. + * @param {number} handle + * @returns {number} + */ + coDensity(handle) { + const ret = wasm.rawcolliderset_coDensity(this.__wbg_ptr, handle); + return ret; + } + /** + * The indices of this triangle mesh, polyline, or convex polyhedron, if it is one. + * @param {number} handle + * @returns {Uint32Array | undefined} + */ + coIndices(handle) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.rawcolliderset_coIndices(retptr, this.__wbg_ptr, handle); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_1(r0, r1 * 4, 4); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {number} handle + * @param {number} mass + */ + coSetMass(handle, mass) { + wasm.rawcolliderset_coSetMass(this.__wbg_ptr, handle, mass); + } +} + +const RawColliderShapeCastHitFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawcollidershapecasthit_free(ptr >>> 0, 1)); + +export class RawColliderShapeCastHit { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawColliderShapeCastHit.prototype); + obj.__wbg_ptr = ptr; + RawColliderShapeCastHitFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawColliderShapeCastHitFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawcollidershapecasthit_free(ptr, 0); + } + /** + * @returns {number} + */ + colliderHandle() { + const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + time_of_impact() { + const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); + return ret; + } + /** + * @returns {RawVector} + */ + normal1() { + const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + normal2() { + const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + witness1() { + const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + witness2() { + const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } +} + +const RawContactForceEventFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawcontactforceevent_free(ptr >>> 0, 1)); + +export class RawContactForceEvent { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawContactForceEvent.prototype); + obj.__wbg_ptr = ptr; + RawContactForceEventFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawContactForceEventFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawcontactforceevent_free(ptr, 0); + } + /** + * The sum of all the forces between the two colliders. + * @returns {RawVector} + */ + total_force() { + const ret = wasm.rawcontactforceevent_total_force(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * The world-space (unit) direction of the force with strongest magnitude. + * @returns {RawVector} + */ + max_force_direction() { + const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * The magnitude of the largest force at a contact point of this contact pair. + * @returns {number} + */ + max_force_magnitude() { + const ret = wasm.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr); + return ret; + } + /** + * The sum of the magnitudes of each force between the two colliders. + * + * Note that this is **not** the same as the magnitude of `self.total_force`. + * Here we are summing the magnitude of all the forces, instead of taking + * the magnitude of their sum. + * @returns {number} + */ + total_force_magnitude() { + const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr); + return ret; + } + /** + * The first collider involved in the contact. + * @returns {number} + */ + collider1() { + const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr); + return ret; + } + /** + * The second collider involved in the contact. + * @returns {number} + */ + collider2() { + const ret = wasm.rawcontactforceevent_collider2(this.__wbg_ptr); + return ret; + } +} + +const RawContactManifoldFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawcontactmanifold_free(ptr >>> 0, 1)); + +export class RawContactManifold { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawContactManifold.prototype); + obj.__wbg_ptr = ptr; + RawContactManifoldFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawContactManifoldFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawcontactmanifold_free(ptr, 0); + } + /** + * @param {number} i + * @returns {number} + */ + contact_dist(i) { + const ret = wasm.rawcontactmanifold_contact_dist(this.__wbg_ptr, i); + return ret; + } + /** + * @param {number} i + * @returns {number} + */ + contact_fid1(i) { + const ret = wasm.rawcontactmanifold_contact_fid1(this.__wbg_ptr, i); + return ret >>> 0; + } + /** + * @param {number} i + * @returns {number} + */ + contact_fid2(i) { + const ret = wasm.rawcontactmanifold_contact_fid2(this.__wbg_ptr, i); + return ret >>> 0; + } + /** + * @returns {number} + */ + num_contacts() { + const ret = wasm.rawcontactmanifold_num_contacts(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} i + * @returns {number} + */ + contact_impulse(i) { + const ret = wasm.rawcontactmanifold_contact_impulse(this.__wbg_ptr, i); + return ret; + } + /** + * @param {number} i + * @returns {RawVector | undefined} + */ + contact_local_p1(i) { + const ret = wasm.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, i); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * @param {number} i + * @returns {RawVector | undefined} + */ + contact_local_p2(i) { + const ret = wasm.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, i); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * @returns {number} + */ + num_solver_contacts() { + const ret = wasm.rawcontactmanifold_num_solver_contacts(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} i + * @returns {number} + */ + solver_contact_dist(i) { + const ret = wasm.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, i); + return ret; + } + /** + * @param {number} i + * @returns {RawVector | undefined} + */ + solver_contact_point(i) { + const ret = wasm.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, i); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * @param {number} i + * @returns {number} + */ + contact_tangent_impulse(i) { + const ret = wasm.rawcontactmanifold_contact_tangent_impulse(this.__wbg_ptr, i); + return ret; + } + /** + * @param {number} i + * @returns {number} + */ + solver_contact_friction(i) { + const ret = wasm.rawcontactmanifold_solver_contact_friction(this.__wbg_ptr, i); + return ret; + } + /** + * @param {number} i + * @returns {number} + */ + solver_contact_restitution(i) { + const ret = wasm.rawcontactmanifold_solver_contact_restitution(this.__wbg_ptr, i); + return ret; + } + /** + * @param {number} i + * @returns {RawVector} + */ + solver_contact_tangent_velocity(i) { + const ret = wasm.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, i); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + normal() { + const ret = wasm.rawcontactmanifold_normal(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + local_n1() { + const ret = wasm.rawcontactmanifold_local_n1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + local_n2() { + const ret = wasm.rawcontactmanifold_local_n2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {number} + */ + subshape1() { + const ret = wasm.rawcontactmanifold_subshape1(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + subshape2() { + const ret = wasm.rawcontactmanifold_subshape2(this.__wbg_ptr); + return ret >>> 0; + } +} + +const RawContactPairFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawcontactpair_free(ptr >>> 0, 1)); + +export class RawContactPair { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawContactPair.prototype); + obj.__wbg_ptr = ptr; + RawContactPairFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawContactPairFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawcontactpair_free(ptr, 0); + } + /** + * @param {number} i + * @returns {RawContactManifold | undefined} + */ + contactManifold(i) { + const ret = wasm.rawcontactpair_contactManifold(this.__wbg_ptr, i); + return ret === 0 ? undefined : RawContactManifold.__wrap(ret); + } + /** + * @returns {number} + */ + numContactManifolds() { + const ret = wasm.rawcontactpair_numContactManifolds(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + collider1() { + const ret = wasm.rawcontactpair_collider1(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + collider2() { + const ret = wasm.rawcontactpair_collider2(this.__wbg_ptr); + return ret; + } +} + +const RawDebugRenderPipelineFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawdebugrenderpipeline_free(ptr >>> 0, 1)); + +export class RawDebugRenderPipeline { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawDebugRenderPipelineFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawdebugrenderpipeline_free(ptr, 0); + } + constructor() { + const ret = wasm.rawdebugrenderpipeline_new(); + this.__wbg_ptr = ret >>> 0; + RawDebugRenderPipelineFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @returns {Float32Array} + */ + colors() { + const ret = wasm.rawdebugrenderpipeline_colors(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawImpulseJointSet} impulse_joints + * @param {RawMultibodyJointSet} multibody_joints + * @param {RawNarrowPhase} narrow_phase + * @param {number} filter_flags + * @param {Function} filter_predicate + */ + render(bodies, colliders, impulse_joints, multibody_joints, narrow_phase, filter_flags, filter_predicate) { + try { + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(impulse_joints, RawImpulseJointSet); + _assertClass(multibody_joints, RawMultibodyJointSet); + _assertClass(narrow_phase, RawNarrowPhase); + wasm.rawdebugrenderpipeline_render(this.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, impulse_joints.__wbg_ptr, multibody_joints.__wbg_ptr, narrow_phase.__wbg_ptr, filter_flags, addBorrowedObject(filter_predicate)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @returns {Float32Array} + */ + vertices() { + const ret = wasm.rawdebugrenderpipeline_vertices(this.__wbg_ptr); + return takeObject(ret); + } +} + +const RawDeserializedWorldFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawdeserializedworld_free(ptr >>> 0, 1)); + +export class RawDeserializedWorld { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawDeserializedWorld.prototype); + obj.__wbg_ptr = ptr; + RawDeserializedWorldFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawDeserializedWorldFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawdeserializedworld_free(ptr, 0); + } + /** + * @returns {RawRigidBodySet | undefined} + */ + takeBodies() { + const ret = wasm.rawdeserializedworld_takeBodies(this.__wbg_ptr); + return ret === 0 ? undefined : RawRigidBodySet.__wrap(ret); + } + /** + * @returns {RawVector | undefined} + */ + takeGravity() { + const ret = wasm.rawdeserializedworld_takeGravity(this.__wbg_ptr); + return ret === 0 ? undefined : RawVector.__wrap(ret); + } + /** + * @returns {RawColliderSet | undefined} + */ + takeColliders() { + const ret = wasm.rawdeserializedworld_takeColliders(this.__wbg_ptr); + return ret === 0 ? undefined : RawColliderSet.__wrap(ret); + } + /** + * @returns {RawBroadPhase | undefined} + */ + takeBroadPhase() { + const ret = wasm.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr); + return ret === 0 ? undefined : RawBroadPhase.__wrap(ret); + } + /** + * @returns {RawNarrowPhase | undefined} + */ + takeNarrowPhase() { + const ret = wasm.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr); + return ret === 0 ? undefined : RawNarrowPhase.__wrap(ret); + } + /** + * @returns {RawImpulseJointSet | undefined} + */ + takeImpulseJoints() { + const ret = wasm.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr); + return ret === 0 ? undefined : RawImpulseJointSet.__wrap(ret); + } + /** + * @returns {RawIslandManager | undefined} + */ + takeIslandManager() { + const ret = wasm.rawdeserializedworld_takeIslandManager(this.__wbg_ptr); + return ret === 0 ? undefined : RawIslandManager.__wrap(ret); + } + /** + * @returns {RawMultibodyJointSet | undefined} + */ + takeMultibodyJoints() { + const ret = wasm.rawdeserializedworld_takeMultibodyJoints(this.__wbg_ptr); + return ret === 0 ? undefined : RawMultibodyJointSet.__wrap(ret); + } + /** + * @returns {RawIntegrationParameters | undefined} + */ + takeIntegrationParameters() { + const ret = wasm.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr); + return ret === 0 ? undefined : RawIntegrationParameters.__wrap(ret); + } +} + +const RawEventQueueFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_raweventqueue_free(ptr >>> 0, 1)); +/** + * A structure responsible for collecting events generated + * by the physics engine. + */ +export class RawEventQueue { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawEventQueueFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_raweventqueue_free(ptr, 0); + } + /** + * Applies the given javascript closure on each collision event of this collector, then clear + * the internal collision event buffer. + * + * # Parameters + * - `f(handle1, handle2, started)`: JavaScript closure applied to each collision event. The + * closure should take three arguments: two integers representing the handles of the colliders + * involved in the collision, and a boolean indicating if the collision started (true) or stopped + * (false). + * @param {Function} f + */ + drainCollisionEvents(f) { + try { + wasm.raweventqueue_drainCollisionEvents(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @param {Function} f + */ + drainContactForceEvents(f) { + try { + wasm.raweventqueue_drainContactForceEvents(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * Creates a new event collector. + * + * # Parameters + * - `autoDrain`: setting this to `true` is strongly recommended. If true, the collector will + * be automatically drained before each `world.step(collector)`. If false, the collector will + * keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of + * RAM if no drain is performed. + * @param {boolean} autoDrain + */ + constructor(autoDrain) { + const ret = wasm.raweventqueue_new(autoDrain); + this.__wbg_ptr = ret >>> 0; + RawEventQueueFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * Removes all events contained by this collector. + */ + clear() { + wasm.raweventqueue_clear(this.__wbg_ptr); + } +} + +const RawGenericJointFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawgenericjoint_free(ptr >>> 0, 1)); + +export class RawGenericJoint { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawGenericJoint.prototype); + obj.__wbg_ptr = ptr; + RawGenericJointFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawGenericJointFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawgenericjoint_free(ptr, 0); + } + /** + * @param {number} length + * @param {RawVector} anchor1 + * @param {RawVector} anchor2 + * @returns {RawGenericJoint} + */ + static rope(length, anchor1, anchor2) { + _assertClass(anchor1, RawVector); + _assertClass(anchor2, RawVector); + const ret = wasm.rawgenericjoint_rope(length, anchor1.__wbg_ptr, anchor2.__wbg_ptr); + return RawGenericJoint.__wrap(ret); + } + /** + * Creates a new joint descriptor that builds a Fixed joint. + * + * A fixed joint removes all the degrees of freedom between the affected bodies. + * @param {RawVector} anchor1 + * @param {RawRotation} axes1 + * @param {RawVector} anchor2 + * @param {RawRotation} axes2 + * @returns {RawGenericJoint} + */ + static fixed(anchor1, axes1, anchor2, axes2) { + _assertClass(anchor1, RawVector); + _assertClass(axes1, RawRotation); + _assertClass(anchor2, RawVector); + _assertClass(axes2, RawRotation); + const ret = wasm.rawgenericjoint_fixed(anchor1.__wbg_ptr, axes1.__wbg_ptr, anchor2.__wbg_ptr, axes2.__wbg_ptr); + return RawGenericJoint.__wrap(ret); + } + /** + * @param {number} rest_length + * @param {number} stiffness + * @param {number} damping + * @param {RawVector} anchor1 + * @param {RawVector} anchor2 + * @returns {RawGenericJoint} + */ + static spring(rest_length, stiffness, damping, anchor1, anchor2) { + _assertClass(anchor1, RawVector); + _assertClass(anchor2, RawVector); + const ret = wasm.rawgenericjoint_spring(rest_length, stiffness, damping, anchor1.__wbg_ptr, anchor2.__wbg_ptr); + return RawGenericJoint.__wrap(ret); + } + /** + * Create a new joint descriptor that builds Revolute joints. + * + * A revolute joint removes all degrees of freedom between the affected + * bodies except for the rotation. + * @param {RawVector} anchor1 + * @param {RawVector} anchor2 + * @returns {RawGenericJoint | undefined} + */ + static revolute(anchor1, anchor2) { + _assertClass(anchor1, RawVector); + _assertClass(anchor2, RawVector); + const ret = wasm.rawgenericjoint_revolute(anchor1.__wbg_ptr, anchor2.__wbg_ptr); + return ret === 0 ? undefined : RawGenericJoint.__wrap(ret); + } + /** + * Creates a new joint descriptor that builds a Prismatic joint. + * + * A prismatic joint removes all the degrees of freedom between the + * affected bodies, except for the translation along one axis. + * + * Returns `None` if any of the provided axes cannot be normalized. + * @param {RawVector} anchor1 + * @param {RawVector} anchor2 + * @param {RawVector} axis + * @param {boolean} limitsEnabled + * @param {number} limitsMin + * @param {number} limitsMax + * @returns {RawGenericJoint | undefined} + */ + static prismatic(anchor1, anchor2, axis, limitsEnabled, limitsMin, limitsMax) { + _assertClass(anchor1, RawVector); + _assertClass(anchor2, RawVector); + _assertClass(axis, RawVector); + const ret = wasm.rawgenericjoint_prismatic(anchor1.__wbg_ptr, anchor2.__wbg_ptr, axis.__wbg_ptr, limitsEnabled, limitsMin, limitsMax); + return ret === 0 ? undefined : RawGenericJoint.__wrap(ret); + } +} + +const RawImpulseJointSetFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawimpulsejointset_free(ptr >>> 0, 1)); + +export class RawImpulseJointSet { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawImpulseJointSet.prototype); + obj.__wbg_ptr = ptr; + RawImpulseJointSetFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawImpulseJointSetFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawimpulsejointset_free(ptr, 0); + } + /** + * The position of the first anchor of this joint. + * + * The first anchor gives the position of the points application point on the + * local frame of the first rigid-body it is attached to. + * @param {number} handle + * @returns {RawVector} + */ + jointAnchor1(handle) { + const ret = wasm.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * The position of the second anchor of this joint. + * + * The second anchor gives the position of the points application point on the + * local frame of the second rigid-body it is attached to. + * @param {number} handle + * @returns {RawVector} + */ + jointAnchor2(handle) { + const ret = wasm.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * The angular part of the joint’s local frame relative to the first rigid-body it is attached to. + * @param {number} handle + * @returns {RawRotation} + */ + jointFrameX1(handle) { + const ret = wasm.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * The angular part of the joint’s local frame relative to the second rigid-body it is attached to. + * @param {number} handle + * @returns {RawRotation} + */ + jointFrameX2(handle) { + const ret = wasm.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * If this is a prismatic joint, returns its upper limit. + * @param {number} handle + * @param {RawJointAxis} axis + * @returns {number} + */ + jointLimitsMax(handle, axis) { + const ret = wasm.rawimpulsejointset_jointLimitsMax(this.__wbg_ptr, handle, axis); + return ret; + } + /** + * Return the lower limit along the given joint axis. + * @param {number} handle + * @param {RawJointAxis} axis + * @returns {number} + */ + jointLimitsMin(handle, axis) { + const ret = wasm.rawimpulsejointset_jointLimitsMin(this.__wbg_ptr, handle, axis); + return ret; + } + /** + * Enables and sets the joint limits + * @param {number} handle + * @param {RawJointAxis} axis + * @param {number} min + * @param {number} max + */ + jointSetLimits(handle, axis, min, max) { + wasm.rawimpulsejointset_jointSetLimits(this.__wbg_ptr, handle, axis, min, max); + } + /** + * Sets the position of the first local anchor + * @param {number} handle + * @param {RawVector} newPos + */ + jointSetAnchor1(handle, newPos) { + _assertClass(newPos, RawVector); + wasm.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, handle, newPos.__wbg_ptr); + } + /** + * Sets the position of the second local anchor + * @param {number} handle + * @param {RawVector} newPos + */ + jointSetAnchor2(handle, newPos) { + _assertClass(newPos, RawVector); + wasm.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, handle, newPos.__wbg_ptr); + } + /** + * The unique integer identifier of the first rigid-body this joint it attached to. + * @param {number} handle + * @returns {number} + */ + jointBodyHandle1(handle) { + const ret = wasm.rawimpulsejointset_jointBodyHandle1(this.__wbg_ptr, handle); + return ret; + } + /** + * The unique integer identifier of the second rigid-body this joint is attached to. + * @param {number} handle + * @returns {number} + */ + jointBodyHandle2(handle) { + const ret = wasm.rawimpulsejointset_jointBodyHandle2(this.__wbg_ptr, handle); + return ret; + } + /** + * Are the limits for this joint enabled? + * @param {number} handle + * @param {RawJointAxis} axis + * @returns {boolean} + */ + jointLimitsEnabled(handle, axis) { + const ret = wasm.rawimpulsejointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis); + return ret !== 0; + } + /** + * @param {number} handle + * @param {RawJointAxis} axis + * @param {number} targetPos + * @param {number} targetVel + * @param {number} stiffness + * @param {number} damping + */ + jointConfigureMotor(handle, axis, targetPos, targetVel, stiffness, damping) { + wasm.rawimpulsejointset_jointConfigureMotor(this.__wbg_ptr, handle, axis, targetPos, targetVel, stiffness, damping); + } + /** + * Are contacts between the rigid-bodies attached by this joint enabled? + * @param {number} handle + * @returns {boolean} + */ + jointContactsEnabled(handle) { + const ret = wasm.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * Sets whether contacts are enabled between the rigid-bodies attached by this joint. + * @param {number} handle + * @param {boolean} enabled + */ + jointSetContactsEnabled(handle, enabled) { + wasm.rawimpulsejointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled); + } + /** + * @param {number} handle + * @param {RawJointAxis} axis + * @param {RawMotorModel} model + */ + jointConfigureMotorModel(handle, axis, model) { + wasm.rawimpulsejointset_jointConfigureMotorModel(this.__wbg_ptr, handle, axis, model); + } + /** + * @param {number} handle + * @param {RawJointAxis} axis + * @param {number} targetPos + * @param {number} stiffness + * @param {number} damping + */ + jointConfigureMotorPosition(handle, axis, targetPos, stiffness, damping) { + wasm.rawimpulsejointset_jointConfigureMotorPosition(this.__wbg_ptr, handle, axis, targetPos, stiffness, damping); + } + /** + * @param {number} handle + * @param {RawJointAxis} axis + * @param {number} targetVel + * @param {number} factor + */ + jointConfigureMotorVelocity(handle, axis, targetVel, factor) { + wasm.rawimpulsejointset_jointConfigureMotorVelocity(this.__wbg_ptr, handle, axis, targetVel, factor); + } + /** + * The type of this joint. + * @param {number} handle + * @returns {RawJointType} + */ + jointType(handle) { + const ret = wasm.rawimpulsejointset_jointType(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {RawGenericJoint} params + * @param {number} parent1 + * @param {number} parent2 + * @param {boolean} wake_up + * @returns {number} + */ + createJoint(params, parent1, parent2, wake_up) { + _assertClass(params, RawGenericJoint); + const ret = wasm.rawimpulsejointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wake_up); + return ret; + } + /** + * Applies the given JavaScript function to the integer handle of each joint managed by this physics world. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`. + * @param {Function} f + */ + forEachJointHandle(f) { + try { + wasm.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`. + * @param {number} body + * @param {Function} f + */ + forEachJointAttachedToRigidBody(body, f) { + try { + wasm.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @returns {number} + */ + len() { + const ret = wasm.rawimpulsejointset_len(this.__wbg_ptr); + return ret >>> 0; + } + constructor() { + const ret = wasm.rawimpulsejointset_new(); + this.__wbg_ptr = ret >>> 0; + RawImpulseJointSetFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {number} handle + * @param {boolean} wakeUp + */ + remove(handle, wakeUp) { + wasm.rawimpulsejointset_remove(this.__wbg_ptr, handle, wakeUp); + } + /** + * @param {number} handle + * @returns {boolean} + */ + contains(handle) { + const ret = wasm.rawimpulsejointset_contains(this.__wbg_ptr, handle); + return ret !== 0; + } +} + +const RawIntegrationParametersFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawintegrationparameters_free(ptr >>> 0, 1)); + +export class RawIntegrationParameters { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawIntegrationParameters.prototype); + obj.__wbg_ptr = ptr; + RawIntegrationParametersFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawIntegrationParametersFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawintegrationparameters_free(ptr, 0); + } + /** + * @returns {number} + */ + get lengthUnit() { + const ret = wasm.rawintegrationparameters_lengthUnit(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + get contact_erp() { + const ret = wasm.rawintegrationparameters_contact_erp(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + get minIslandSize() { + const ret = wasm.rawintegrationparameters_minIslandSize(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + get maxCcdSubsteps() { + const ret = wasm.rawintegrationparameters_maxCcdSubsteps(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} value + */ + set lengthUnit(value) { + wasm.rawintegrationparameters_set_lengthUnit(this.__wbg_ptr, value); + } + /** + * @param {number} value + */ + set minIslandSize(value) { + wasm.rawintegrationparameters_set_minIslandSize(this.__wbg_ptr, value); + } + /** + * @param {number} value + */ + set maxCcdSubsteps(value) { + wasm.rawintegrationparameters_set_maxCcdSubsteps(this.__wbg_ptr, value); + } + /** + * @returns {number} + */ + get numSolverIterations() { + const ret = wasm.rawintegrationparameters_numSolverIterations(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} value + */ + set numSolverIterations(value) { + wasm.rawintegrationparameters_set_numSolverIterations(this.__wbg_ptr, value); + } + /** + * @returns {number} + */ + get numInternalPgsIterations() { + const ret = wasm.rawintegrationparameters_numInternalPgsIterations(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + get normalizedAllowedLinearError() { + const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + get normalizedPredictionDistance() { + const ret = wasm.rawcharactercollision_toi(this.__wbg_ptr); + return ret; + } + /** + * @param {number} value + */ + set numInternalPgsIterations(value) { + wasm.rawintegrationparameters_set_numInternalPgsIterations(this.__wbg_ptr, value); + } + /** + * @param {number} value + */ + set contact_natural_frequency(value) { + wasm.rawintegrationparameters_set_contact_natural_frequency(this.__wbg_ptr, value); + } + /** + * @returns {number} + */ + get dt() { + const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); + return ret; + } + /** + * @param {number} value + */ + set normalizedAllowedLinearError(value) { + wasm.rawintegrationparameters_set_normalizedAllowedLinearError(this.__wbg_ptr, value); + } + /** + * @param {number} value + */ + set normalizedPredictionDistance(value) { + wasm.rawintegrationparameters_set_normalizedPredictionDistance(this.__wbg_ptr, value); + } + constructor() { + const ret = wasm.rawintegrationparameters_new(); + this.__wbg_ptr = ret >>> 0; + RawIntegrationParametersFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {number} value + */ + set dt(value) { + wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, value); + } +} + +const RawIslandManagerFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawislandmanager_free(ptr >>> 0, 1)); + +export class RawIslandManager { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawIslandManager.prototype); + obj.__wbg_ptr = ptr; + RawIslandManagerFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawIslandManagerFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawislandmanager_free(ptr, 0); + } + /** + * Applies the given JavaScript function to the integer handle of each active rigid-body + * managed by this island manager. + * + * After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by + * the physics engine in order to save computational power. A sleeping rigid-body never moves + * unless it is moved manually by the user. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each active rigid-body managed by this + * set. Called as `f(collider)`. + * @param {Function} f + */ + forEachActiveRigidBodyHandle(f) { + try { + wasm.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + constructor() { + const ret = wasm.rawislandmanager_new(); + this.__wbg_ptr = ret >>> 0; + RawIslandManagerFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +const RawKinematicCharacterControllerFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawkinematiccharactercontroller_free(ptr >>> 0, 1)); + +export class RawKinematicCharacterController { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawKinematicCharacterControllerFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawkinematiccharactercontroller_free(ptr, 0); + } + /** + * @returns {boolean} + */ + slideEnabled() { + const ret = wasm.rawkinematiccharactercontroller_slideEnabled(this.__wbg_ptr); + return ret !== 0; + } + /** + * @param {number} maxHeight + * @param {number} minWidth + * @param {boolean} includeDynamicBodies + */ + enableAutostep(maxHeight, minWidth, includeDynamicBodies) { + wasm.rawkinematiccharactercontroller_enableAutostep(this.__wbg_ptr, maxHeight, minWidth, includeDynamicBodies); + } + /** + * @returns {boolean} + */ + autostepEnabled() { + const ret = wasm.rawkinematiccharactercontroller_autostepEnabled(this.__wbg_ptr); + return ret !== 0; + } + disableAutostep() { + wasm.rawkinematiccharactercontroller_disableAutostep(this.__wbg_ptr); + } + /** + * @param {boolean} enabled + */ + setSlideEnabled(enabled) { + wasm.rawkinematiccharactercontroller_setSlideEnabled(this.__wbg_ptr, enabled); + } + /** + * @returns {number | undefined} + */ + autostepMinWidth() { + const ret = wasm.rawkinematiccharactercontroller_autostepMinWidth(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @returns {boolean} + */ + computedGrounded() { + const ret = wasm.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr); + return ret !== 0; + } + /** + * @returns {RawVector} + */ + computedMovement() { + const ret = wasm.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {number | undefined} + */ + autostepMaxHeight() { + const ret = wasm.rawkinematiccharactercontroller_autostepMaxHeight(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number} i + * @param {RawCharacterCollision} collision + * @returns {boolean} + */ + computedCollision(i, collision) { + _assertClass(collision, RawCharacterCollision); + const ret = wasm.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, i, collision.__wbg_ptr); + return ret !== 0; + } + /** + * @returns {number} + */ + normalNudgeFactor() { + const ret = wasm.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr); + return ret; + } + /** + * @param {number} distance + */ + enableSnapToGround(distance) { + wasm.rawkinematiccharactercontroller_enableSnapToGround(this.__wbg_ptr, distance); + } + /** + * @returns {number} + */ + maxSlopeClimbAngle() { + const ret = wasm.rawkinematiccharactercontroller_maxSlopeClimbAngle(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + minSlopeSlideAngle() { + const ret = wasm.rawkinematiccharactercontroller_minSlopeSlideAngle(this.__wbg_ptr); + return ret; + } + disableSnapToGround() { + wasm.rawkinematiccharactercontroller_disableSnapToGround(this.__wbg_ptr); + } + /** + * @returns {boolean} + */ + snapToGroundEnabled() { + const ret = wasm.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr); + return ret !== 0; + } + /** + * @param {number} value + */ + setNormalNudgeFactor(value) { + wasm.rawkinematiccharactercontroller_setNormalNudgeFactor(this.__wbg_ptr, value); + } + /** + * @returns {number | undefined} + */ + snapToGroundDistance() { + const ret = wasm.rawkinematiccharactercontroller_snapToGroundDistance(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @returns {number} + */ + numComputedCollisions() { + const ret = wasm.rawkinematiccharactercontroller_numComputedCollisions(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} angle + */ + setMaxSlopeClimbAngle(angle) { + wasm.rawkinematiccharactercontroller_setMaxSlopeClimbAngle(this.__wbg_ptr, angle); + } + /** + * @param {number} angle + */ + setMinSlopeSlideAngle(angle) { + wasm.rawkinematiccharactercontroller_setMinSlopeSlideAngle(this.__wbg_ptr, angle); + } + /** + * @param {number} dt + * @param {RawBroadPhase} broad_phase + * @param {RawNarrowPhase} narrow_phase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {number} collider_handle + * @param {RawVector} desired_translation_delta + * @param {boolean} apply_impulses_to_dynamic_bodies + * @param {number | null | undefined} character_mass + * @param {number} filter_flags + * @param {number | null | undefined} filter_groups + * @param {Function} filter_predicate + */ + computeColliderMovement(dt, broad_phase, narrow_phase, bodies, colliders, collider_handle, desired_translation_delta, apply_impulses_to_dynamic_bodies, character_mass, filter_flags, filter_groups, filter_predicate) { + try { + _assertClass(broad_phase, RawBroadPhase); + _assertClass(narrow_phase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(desired_translation_delta, RawVector); + wasm.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, dt, broad_phase.__wbg_ptr, narrow_phase.__wbg_ptr, bodies.__wbg_ptr, colliders.__wbg_ptr, collider_handle, desired_translation_delta.__wbg_ptr, apply_impulses_to_dynamic_bodies, isLikeNone(character_mass) ? 0x100000001 : Math.fround(character_mass), filter_flags, isLikeNone(filter_groups) ? 0x100000001 : (filter_groups) >>> 0, addBorrowedObject(filter_predicate)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * @returns {boolean | undefined} + */ + autostepIncludesDynamicBodies() { + const ret = wasm.rawkinematiccharactercontroller_autostepIncludesDynamicBodies(this.__wbg_ptr); + return ret === 0xFFFFFF ? undefined : ret !== 0; + } + /** + * @returns {RawVector} + */ + up() { + const ret = wasm.rawcollidershapecasthit_normal2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @param {number} offset + */ + constructor(offset) { + const ret = wasm.rawkinematiccharactercontroller_new(offset); + this.__wbg_ptr = ret >>> 0; + RawKinematicCharacterControllerFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {RawVector} vector + */ + setUp(vector) { + _assertClass(vector, RawVector); + wasm.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, vector.__wbg_ptr); + } + /** + * @returns {number} + */ + offset() { + const ret = wasm.rawkinematiccharactercontroller_offset(this.__wbg_ptr); + return ret; + } + /** + * @param {number} value + */ + setOffset(value) { + wasm.rawkinematiccharactercontroller_setOffset(this.__wbg_ptr, value); + } +} + +const RawMultibodyJointSetFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawmultibodyjointset_free(ptr >>> 0, 1)); + +export class RawMultibodyJointSet { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawMultibodyJointSet.prototype); + obj.__wbg_ptr = ptr; + RawMultibodyJointSetFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawMultibodyJointSetFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawmultibodyjointset_free(ptr, 0); + } + /** + * The position of the first anchor of this joint. + * + * The first anchor gives the position of the points application point on the + * local frame of the first rigid-body it is attached to. + * @param {number} handle + * @returns {RawVector} + */ + jointAnchor1(handle) { + const ret = wasm.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * The position of the second anchor of this joint. + * + * The second anchor gives the position of the points application point on the + * local frame of the second rigid-body it is attached to. + * @param {number} handle + * @returns {RawVector} + */ + jointAnchor2(handle) { + const ret = wasm.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * The angular part of the joint’s local frame relative to the first rigid-body it is attached to. + * @param {number} handle + * @returns {RawRotation} + */ + jointFrameX1(handle) { + const ret = wasm.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * The angular part of the joint’s local frame relative to the second rigid-body it is attached to. + * @param {number} handle + * @returns {RawRotation} + */ + jointFrameX2(handle) { + const ret = wasm.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * If this is a prismatic joint, returns its upper limit. + * @param {number} handle + * @param {RawJointAxis} axis + * @returns {number} + */ + jointLimitsMax(handle, axis) { + const ret = wasm.rawmultibodyjointset_jointLimitsMax(this.__wbg_ptr, handle, axis); + return ret; + } + /** + * Return the lower limit along the given joint axis. + * @param {number} handle + * @param {RawJointAxis} axis + * @returns {number} + */ + jointLimitsMin(handle, axis) { + const ret = wasm.rawmultibodyjointset_jointLimitsMin(this.__wbg_ptr, handle, axis); + return ret; + } + /** + * Are the limits for this joint enabled? + * @param {number} handle + * @param {RawJointAxis} axis + * @returns {boolean} + */ + jointLimitsEnabled(handle, axis) { + const ret = wasm.rawmultibodyjointset_jointLimitsEnabled(this.__wbg_ptr, handle, axis); + return ret !== 0; + } + /** + * Are contacts between the rigid-bodies attached by this joint enabled? + * @param {number} handle + * @returns {boolean} + */ + jointContactsEnabled(handle) { + const ret = wasm.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * Sets whether contacts are enabled between the rigid-bodies attached by this joint. + * @param {number} handle + * @param {boolean} enabled + */ + jointSetContactsEnabled(handle, enabled) { + wasm.rawmultibodyjointset_jointSetContactsEnabled(this.__wbg_ptr, handle, enabled); + } + /** + * The type of this joint. + * @param {number} handle + * @returns {RawJointType} + */ + jointType(handle) { + const ret = wasm.rawmultibodyjointset_jointType(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {RawGenericJoint} params + * @param {number} parent1 + * @param {number} parent2 + * @param {boolean} wakeUp + * @returns {number} + */ + createJoint(params, parent1, parent2, wakeUp) { + _assertClass(params, RawGenericJoint); + const ret = wasm.rawmultibodyjointset_createJoint(this.__wbg_ptr, params.__wbg_ptr, parent1, parent2, wakeUp); + return ret; + } + /** + * Applies the given JavaScript function to the integer handle of each joint managed by this physics world. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`. + * @param {Function} f + */ + forEachJointHandle(f) { + try { + wasm.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`. + * @param {number} body + * @param {Function} f + */ + forEachJointAttachedToRigidBody(body, f) { + try { + wasm.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, body, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + constructor() { + const ret = wasm.rawmultibodyjointset_new(); + this.__wbg_ptr = ret >>> 0; + RawMultibodyJointSetFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {number} handle + * @param {boolean} wakeUp + */ + remove(handle, wakeUp) { + wasm.rawmultibodyjointset_remove(this.__wbg_ptr, handle, wakeUp); + } + /** + * @param {number} handle + * @returns {boolean} + */ + contains(handle) { + const ret = wasm.rawmultibodyjointset_contains(this.__wbg_ptr, handle); + return ret !== 0; + } +} + +const RawNarrowPhaseFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawnarrowphase_free(ptr >>> 0, 1)); + +export class RawNarrowPhase { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawNarrowPhase.prototype); + obj.__wbg_ptr = ptr; + RawNarrowPhaseFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawNarrowPhaseFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawnarrowphase_free(ptr, 0); + } + /** + * @param {number} handle1 + * @param {number} handle2 + * @returns {RawContactPair | undefined} + */ + contact_pair(handle1, handle2) { + const ret = wasm.rawnarrowphase_contact_pair(this.__wbg_ptr, handle1, handle2); + return ret === 0 ? undefined : RawContactPair.__wrap(ret); + } + /** + * @param {number} handle1 + * @param {number} handle2 + * @returns {boolean} + */ + intersection_pair(handle1, handle2) { + const ret = wasm.rawnarrowphase_intersection_pair(this.__wbg_ptr, handle1, handle2); + return ret !== 0; + } + /** + * @param {number} handle1 + * @param {Function} f + */ + contact_pairs_with(handle1, f) { + wasm.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f)); + } + /** + * @param {number} handle1 + * @param {Function} f + */ + intersection_pairs_with(handle1, f) { + wasm.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, handle1, addHeapObject(f)); + } + constructor() { + const ret = wasm.rawnarrowphase_new(); + this.__wbg_ptr = ret >>> 0; + RawNarrowPhaseFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +const RawPhysicsPipelineFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawphysicspipeline_free(ptr >>> 0, 1)); + +export class RawPhysicsPipeline { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawPhysicsPipelineFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawphysicspipeline_free(ptr, 0); + } + /** + * @returns {number} + */ + timing_ccd() { + const ret = wasm.rawphysicspipeline_timing_ccd(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_step() { + const ret = wasm.rawphysicspipeline_timing_step(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_solver() { + const ret = wasm.rawphysicspipeline_timing_solver(this.__wbg_ptr); + return ret; + } + /** + * @param {RawVector} gravity + * @param {RawIntegrationParameters} integrationParameters + * @param {RawIslandManager} islands + * @param {RawBroadPhase} broadPhase + * @param {RawNarrowPhase} narrowPhase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawImpulseJointSet} joints + * @param {RawMultibodyJointSet} articulations + * @param {RawCCDSolver} ccd_solver + * @param {RawEventQueue} eventQueue + * @param {object} hookObject + * @param {Function} hookFilterContactPair + * @param {Function} hookFilterIntersectionPair + */ + stepWithEvents(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver, eventQueue, hookObject, hookFilterContactPair, hookFilterIntersectionPair) { + _assertClass(gravity, RawVector); + _assertClass(integrationParameters, RawIntegrationParameters); + _assertClass(islands, RawIslandManager); + _assertClass(broadPhase, RawBroadPhase); + _assertClass(narrowPhase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(joints, RawImpulseJointSet); + _assertClass(articulations, RawMultibodyJointSet); + _assertClass(ccd_solver, RawCCDSolver); + _assertClass(eventQueue, RawEventQueue); + 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)); + } + /** + * @returns {number} + */ + timing_ccd_solver() { + const ret = wasm.rawphysicspipeline_timing_ccd_solver(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_broad_phase() { + const ret = wasm.rawphysicspipeline_timing_broad_phase(this.__wbg_ptr); + return ret; + } + /** + * @returns {boolean} + */ + is_profiler_enabled() { + const ret = wasm.rawphysicspipeline_is_profiler_enabled(this.__wbg_ptr); + return ret !== 0; + } + /** + * @returns {number} + */ + timing_narrow_phase() { + const ret = wasm.rawphysicspipeline_timing_narrow_phase(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_user_changes() { + const ret = wasm.rawphysicspipeline_timing_user_changes(this.__wbg_ptr); + return ret; + } + /** + * @param {boolean} enabled + */ + set_profiler_enabled(enabled) { + wasm.rawphysicspipeline_set_profiler_enabled(this.__wbg_ptr, enabled); + } + /** + * @returns {number} + */ + timing_ccd_broad_phase() { + const ret = wasm.rawphysicspipeline_timing_ccd_broad_phase(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_velocity_update() { + const ret = wasm.rawphysicspipeline_timing_velocity_update(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_ccd_narrow_phase() { + const ret = wasm.rawphysicspipeline_timing_ccd_narrow_phase(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_velocity_assembly() { + const ret = wasm.rawphysicspipeline_timing_velocity_assembly(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_velocity_writeback() { + const ret = wasm.rawphysicspipeline_timing_velocity_writeback(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_ccd_toi_computation() { + const ret = wasm.rawphysicspipeline_timing_ccd_toi_computation(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_collision_detection() { + const ret = wasm.rawphysicspipeline_timing_collision_detection(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_island_construction() { + const ret = wasm.rawphysicspipeline_timing_island_construction(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + timing_velocity_resolution() { + const ret = wasm.rawphysicspipeline_timing_velocity_resolution(this.__wbg_ptr); + return ret; + } + constructor() { + const ret = wasm.rawphysicspipeline_new(); + this.__wbg_ptr = ret >>> 0; + RawPhysicsPipelineFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {RawVector} gravity + * @param {RawIntegrationParameters} integrationParameters + * @param {RawIslandManager} islands + * @param {RawBroadPhase} broadPhase + * @param {RawNarrowPhase} narrowPhase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawImpulseJointSet} joints + * @param {RawMultibodyJointSet} articulations + * @param {RawCCDSolver} ccd_solver + */ + step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, joints, articulations, ccd_solver) { + _assertClass(gravity, RawVector); + _assertClass(integrationParameters, RawIntegrationParameters); + _assertClass(islands, RawIslandManager); + _assertClass(broadPhase, RawBroadPhase); + _assertClass(narrowPhase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(joints, RawImpulseJointSet); + _assertClass(articulations, RawMultibodyJointSet); + _assertClass(ccd_solver, RawCCDSolver); + 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); + } +} + +const RawPidControllerFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawpidcontroller_free(ptr >>> 0, 1)); + +export class RawPidController { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawPidControllerFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawpidcontroller_free(ptr, 0); + } + /** + * @param {number} axes_mask + */ + set_axes_mask(axes_mask) { + wasm.rawpidcontroller_set_axes_mask(this.__wbg_ptr, axes_mask); + } + reset_integrals() { + wasm.rawpidcontroller_reset_integrals(this.__wbg_ptr); + } + /** + * @param {number} dt + * @param {RawRigidBodySet} bodies + * @param {number} rb_handle + * @param {RawVector} target_translation + * @param {RawVector} target_linvel + * @returns {RawVector} + */ + linear_correction(dt, bodies, rb_handle, target_translation, target_linvel) { + _assertClass(bodies, RawRigidBodySet); + _assertClass(target_translation, RawVector); + _assertClass(target_linvel, RawVector); + const ret = wasm.rawpidcontroller_linear_correction(this.__wbg_ptr, dt, bodies.__wbg_ptr, rb_handle, target_translation.__wbg_ptr, target_linvel.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @param {number} dt + * @param {RawRigidBodySet} bodies + * @param {number} rb_handle + * @param {number} target_rotation + * @param {number} target_angvel + * @returns {number} + */ + angular_correction(dt, bodies, rb_handle, target_rotation, target_angvel) { + _assertClass(bodies, RawRigidBodySet); + const ret = wasm.rawpidcontroller_angular_correction(this.__wbg_ptr, dt, bodies.__wbg_ptr, rb_handle, target_rotation, target_angvel); + return ret; + } + /** + * @param {number} dt + * @param {RawRigidBodySet} bodies + * @param {number} rb_handle + * @param {RawVector} target_translation + * @param {RawVector} target_linvel + */ + apply_linear_correction(dt, bodies, rb_handle, target_translation, target_linvel) { + _assertClass(bodies, RawRigidBodySet); + _assertClass(target_translation, RawVector); + _assertClass(target_linvel, RawVector); + wasm.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, dt, bodies.__wbg_ptr, rb_handle, target_translation.__wbg_ptr, target_linvel.__wbg_ptr); + } + /** + * @param {number} dt + * @param {RawRigidBodySet} bodies + * @param {number} rb_handle + * @param {number} target_rotation + * @param {number} target_angvel + */ + apply_angular_correction(dt, bodies, rb_handle, target_rotation, target_angvel) { + _assertClass(bodies, RawRigidBodySet); + wasm.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, dt, bodies.__wbg_ptr, rb_handle, target_rotation, target_angvel); + } + /** + * @param {number} kp + * @param {number} ki + * @param {number} kd + * @param {number} axes_mask + */ + constructor(kp, ki, kd, axes_mask) { + const ret = wasm.rawpidcontroller_new(kp, ki, kd, axes_mask); + this.__wbg_ptr = ret >>> 0; + RawPidControllerFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {number} kd + * @param {number} axes + */ + set_kd(kd, axes) { + wasm.rawpidcontroller_set_kd(this.__wbg_ptr, kd, axes); + } + /** + * @param {number} ki + * @param {number} axes + */ + set_ki(ki, axes) { + wasm.rawpidcontroller_set_ki(this.__wbg_ptr, ki, axes); + } + /** + * @param {number} kp + * @param {number} axes + */ + set_kp(kp, axes) { + wasm.rawpidcontroller_set_kp(this.__wbg_ptr, kp, axes); + } +} + +const RawPointColliderProjectionFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawpointcolliderprojection_free(ptr >>> 0, 1)); + +export class RawPointColliderProjection { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawPointColliderProjection.prototype); + obj.__wbg_ptr = ptr; + RawPointColliderProjectionFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawPointColliderProjectionFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawpointcolliderprojection_free(ptr, 0); + } + /** + * @returns {RawFeatureType} + */ + featureType() { + const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + colliderHandle() { + const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr); + return ret; + } + /** + * @returns {RawVector} + */ + point() { + const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {boolean} + */ + isInside() { + const ret = wasm.rawpointcolliderprojection_isInside(this.__wbg_ptr); + return ret !== 0; + } + /** + * @returns {number | undefined} + */ + featureId() { + const ret = wasm.rawpointcolliderprojection_featureId(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } +} + +const RawPointProjectionFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawpointprojection_free(ptr >>> 0, 1)); + +export class RawPointProjection { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawPointProjection.prototype); + obj.__wbg_ptr = ptr; + RawPointProjectionFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawPointProjectionFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawpointprojection_free(ptr, 0); + } + /** + * @returns {RawVector} + */ + point() { + const ret = wasm.rawpointprojection_point(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {boolean} + */ + isInside() { + const ret = wasm.rawpointprojection_isInside(this.__wbg_ptr); + return ret !== 0; + } +} + +const RawRayColliderHitFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawraycolliderhit_free(ptr >>> 0, 1)); + +export class RawRayColliderHit { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawRayColliderHit.prototype); + obj.__wbg_ptr = ptr; + RawRayColliderHitFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawRayColliderHitFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawraycolliderhit_free(ptr, 0); + } + /** + * @returns {number} + */ + timeOfImpact() { + const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + colliderHandle() { + const ret = wasm.rawcollidershapecasthit_colliderHandle(this.__wbg_ptr); + return ret; + } +} + +const RawRayColliderIntersectionFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawraycolliderintersection_free(ptr >>> 0, 1)); + +export class RawRayColliderIntersection { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawRayColliderIntersection.prototype); + obj.__wbg_ptr = ptr; + RawRayColliderIntersectionFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawRayColliderIntersectionFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawraycolliderintersection_free(ptr, 0); + } + /** + * @returns {RawFeatureType} + */ + featureType() { + const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + colliderHandle() { + const ret = wasm.rawpointcolliderprojection_colliderHandle(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + time_of_impact() { + const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); + return ret; + } + /** + * @returns {RawVector} + */ + normal() { + const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {number | undefined} + */ + featureId() { + const ret = wasm.rawpointcolliderprojection_featureId(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } +} + +const RawRayIntersectionFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawrayintersection_free(ptr >>> 0, 1)); + +export class RawRayIntersection { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawRayIntersection.prototype); + obj.__wbg_ptr = ptr; + RawRayIntersectionFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawRayIntersectionFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawrayintersection_free(ptr, 0); + } + /** + * @returns {RawFeatureType} + */ + featureType() { + const ret = wasm.rawpointcolliderprojection_featureType(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + time_of_impact() { + const ret = wasm.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr); + return ret; + } + /** + * @returns {RawVector} + */ + normal() { + const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {number | undefined} + */ + featureId() { + const ret = wasm.rawpointcolliderprojection_featureId(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } +} + +const RawRigidBodySetFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawrigidbodyset_free(ptr >>> 0, 1)); + +export class RawRigidBodySet { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawRigidBodySet.prototype); + obj.__wbg_ptr = ptr; + RawRigidBodySetFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawRigidBodySetFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawrigidbodyset_free(ptr, 0); + } + /** + * Adds a force at the center-of-mass of this rigid-body. + * + * # Parameters + * - `force`: the world-space force to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + * @param {number} handle + * @param {RawVector} force + * @param {boolean} wakeUp + */ + rbAddForce(handle, force, wakeUp) { + _assertClass(force, RawVector); + wasm.rawrigidbodyset_rbAddForce(this.__wbg_ptr, handle, force.__wbg_ptr, wakeUp); + } + /** + * The status of this rigid-body: fixed, dynamic, or kinematic. + * @param {number} handle + * @returns {RawRigidBodyType} + */ + rbBodyType(handle) { + const ret = wasm.rawrigidbodyset_rbBodyType(this.__wbg_ptr, handle); + return ret; + } + /** + * Retrieves the `i-th` collider attached to this rigid-body. + * + * # Parameters + * - `at`: The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`. + * This index is **not** the same as the unique identifier of the collider. + * @param {number} handle + * @param {number} at + * @returns {number} + */ + rbCollider(handle, at) { + const ret = wasm.rawrigidbodyset_rbCollider(this.__wbg_ptr, handle, at); + return ret; + } + /** + * Is the velocity of this rigid-body not zero? + * @param {number} handle + * @returns {boolean} + */ + rbIsMoving(handle) { + const ret = wasm.rawrigidbodyset_rbIsMoving(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * The center of mass of a rigid-body expressed in its local-space. + * @param {number} handle + * @returns {RawVector} + */ + rbLocalCom(handle) { + const ret = wasm.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * The world-space orientation of this rigid-body. + * @param {number} handle + * @returns {RawRotation} + */ + rbRotation(handle) { + const ret = wasm.rawrigidbodyset_rbRotation(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * An arbitrary user-defined 32-bit integer + * @param {number} handle + * @returns {number} + */ + rbUserData(handle) { + const ret = wasm.rawrigidbodyset_rbUserData(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * The world-space center of mass of the rigid-body. + * @param {number} handle + * @returns {RawVector} + */ + rbWorldCom(handle) { + const ret = wasm.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * Adds a torque at the center-of-mass of this rigid-body. + * + * # Parameters + * - `torque`: the torque to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + * @param {number} handle + * @param {number} torque + * @param {boolean} wakeUp + */ + rbAddTorque(handle, torque, wakeUp) { + wasm.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, handle, torque, wakeUp); + } + /** + * @param {number} handle + * @param {boolean} enabled + */ + rbEnableCcd(handle, enabled) { + wasm.rawrigidbodyset_rbEnableCcd(this.__wbg_ptr, handle, enabled); + } + /** + * Is this rigid-body dynamic? + * @param {number} handle + * @returns {boolean} + */ + rbIsDynamic(handle) { + const ret = wasm.rawrigidbodyset_rbIsDynamic(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * @param {number} handle + * @returns {boolean} + */ + rbIsEnabled(handle) { + const ret = wasm.rawrigidbodyset_rbIsEnabled(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * Sets the angular velocity of this rigid-body. + * @param {number} handle + * @param {number} angvel + * @param {boolean} wakeUp + */ + rbSetAngvel(handle, angvel, wakeUp) { + wasm.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, handle, angvel, wakeUp); + } + /** + * Sets the linear velocity of this rigid-body. + * @param {number} handle + * @param {RawVector} linvel + * @param {boolean} wakeUp + */ + rbSetLinvel(handle, linvel, wakeUp) { + _assertClass(linvel, RawVector); + wasm.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, handle, linvel.__wbg_ptr, wakeUp); + } + /** + * Retrieves the constant force(s) the user added to this rigid-body. + * Returns zero if the rigid-body is not dynamic. + * @param {number} handle + * @returns {RawVector} + */ + rbUserForce(handle) { + const ret = wasm.rawrigidbodyset_rbUserForce(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * Is this rigid-body sleeping? + * @param {number} handle + * @returns {boolean} + */ + rbIsSleeping(handle) { + const ret = wasm.rawrigidbodyset_rbIsSleeping(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * @param {number} handle + * @param {boolean} enabled + */ + rbSetEnabled(handle, enabled) { + wasm.rawrigidbodyset_rbSetEnabled(this.__wbg_ptr, handle, enabled); + } + /** + * Retrieves the constant torque(s) the user added to this rigid-body. + * Returns zero if the rigid-body is not dynamic. + * @param {number} handle + * @returns {number} + */ + rbUserTorque(handle) { + const ret = wasm.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, handle); + return ret; + } + /** + * Is this rigid-body kinematic? + * @param {number} handle + * @returns {boolean} + */ + rbIsKinematic(handle) { + const ret = wasm.rawrigidbodyset_rbIsKinematic(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * Resets to zero all user-added forces added to this rigid-body. + * @param {number} handle + * @param {boolean} wakeUp + */ + rbResetForces(handle, wakeUp) { + wasm.rawrigidbodyset_rbResetForces(this.__wbg_ptr, handle, wakeUp); + } + /** + * Set a new status for this rigid-body: fixed, dynamic, or kinematic. + * @param {number} handle + * @param {RawRigidBodyType} status + * @param {boolean} wake_up + */ + rbSetBodyType(handle, status, wake_up) { + wasm.rawrigidbodyset_rbSetBodyType(this.__wbg_ptr, handle, status, wake_up); + } + /** + * Sets the rotation angle of this rigid-body. + * + * # Parameters + * - `angle`: the rotation angle, in radians. + * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + * @param {number} handle + * @param {number} angle + * @param {boolean} wakeUp + */ + rbSetRotation(handle, angle, wakeUp) { + wasm.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, handle, angle, wakeUp); + } + /** + * Sets the user-defined 32-bit integer of this rigid-body. + * + * # Parameters + * - `data`: an arbitrary user-defined 32-bit integer. + * @param {number} handle + * @param {number} data + */ + rbSetUserData(handle, data) { + wasm.rawrigidbodyset_rbSetUserData(this.__wbg_ptr, handle, data); + } + /** + * The world-space translation of this rigid-body. + * @param {number} handle + * @returns {RawVector} + */ + rbTranslation(handle) { + const ret = wasm.rawrigidbodyset_rbTranslation(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * Applies an impulse at the center-of-mass of this rigid-body. + * + * # Parameters + * - `impulse`: the world-space impulse to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + * @param {number} handle + * @param {RawVector} impulse + * @param {boolean} wakeUp + */ + rbApplyImpulse(handle, impulse, wakeUp) { + _assertClass(impulse, RawVector); + wasm.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, handle, impulse.__wbg_ptr, wakeUp); + } + /** + * @param {number} handle + * @returns {number} + */ + rbGravityScale(handle) { + const ret = wasm.rawrigidbodyset_rbGravityScale(this.__wbg_ptr, handle); + return ret; + } + /** + * Is Continuous Collision Detection enabled for this rigid-body? + * @param {number} handle + * @returns {boolean} + */ + rbIsCcdEnabled(handle) { + const ret = wasm.rawrigidbodyset_rbIsCcdEnabled(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * The world-space predicted orientation of this rigid-body. + * + * If this rigid-body is kinematic this value is set by the `setNextKinematicRotation` + * method and is used for estimating the kinematic body velocity at the next timestep. + * For non-kinematic bodies, this value is currently unspecified. + * @param {number} handle + * @returns {RawRotation} + */ + rbNextRotation(handle) { + const ret = wasm.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, handle); + return RawRotation.__wrap(ret); + } + /** + * The number of colliders attached to this rigid-body. + * @param {number} handle + * @returns {number} + */ + rbNumColliders(handle) { + const ret = wasm.rawrigidbodyset_rbNumColliders(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * Resets to zero all user-added torques added to this rigid-body. + * @param {number} handle + * @param {boolean} wakeUp + */ + rbResetTorques(handle, wakeUp) { + wasm.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, handle, wakeUp); + } + /** + * The linear damping coefficient of this rigid-body. + * @param {number} handle + * @returns {number} + */ + rbLinearDamping(handle) { + const ret = wasm.rawrigidbodyset_rbLinearDamping(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @param {boolean} locked + * @param {boolean} wake_up + */ + rbLockRotations(handle, locked, wake_up) { + wasm.rawrigidbodyset_rbLockRotations(this.__wbg_ptr, handle, locked, wake_up); + } + /** + * The angular damping coefficient of this rigid-body. + * @param {number} handle + * @returns {number} + */ + rbAngularDamping(handle) { + const ret = wasm.rawrigidbodyset_rbAngularDamping(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @returns {number} + */ + rbDominanceGroup(handle) { + const ret = wasm.rawrigidbodyset_rbDominanceGroup(this.__wbg_ptr, handle); + return ret; + } + /** + * Sets the translation of this rigid-body. + * + * # Parameters + * - `x`: the world-space position of the rigid-body along the `x` axis. + * - `y`: the world-space position of the rigid-body along the `y` axis. + * - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it + * wasn't moving before modifying its position. + * @param {number} handle + * @param {number} x + * @param {number} y + * @param {boolean} wakeUp + */ + rbSetTranslation(handle, x, y, wakeUp) { + wasm.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, handle, x, y, wakeUp); + } + /** + * Adds a force at the given world-space point of this rigid-body. + * + * # Parameters + * - `force`: the world-space force to apply on the rigid-body. + * - `point`: the world-space point where the impulse is to be applied on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + * @param {number} handle + * @param {RawVector} force + * @param {RawVector} point + * @param {boolean} wakeUp + */ + rbAddForceAtPoint(handle, force, point, wakeUp) { + _assertClass(force, RawVector); + _assertClass(point, RawVector); + wasm.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, handle, force.__wbg_ptr, point.__wbg_ptr, wakeUp); + } + /** + * The world-space predicted translation of this rigid-body. + * + * If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation` + * method and is used for estimating the kinematic body velocity at the next timestep. + * For non-kinematic bodies, this value is currently unspecified. + * @param {number} handle + * @returns {RawVector} + */ + rbNextTranslation(handle) { + const ret = wasm.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * @param {number} handle + * @param {number} factor + * @param {boolean} wakeUp + */ + rbSetGravityScale(handle, factor, wakeUp) { + wasm.rawrigidbodyset_rbSetGravityScale(this.__wbg_ptr, handle, factor, wakeUp); + } + /** + * The velocity of the given world-space point on this rigid-body. + * @param {number} handle + * @param {RawVector} point + * @returns {RawVector} + */ + rbVelocityAtPoint(handle, point) { + _assertClass(point, RawVector); + const ret = wasm.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, handle, point.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * The inverse mass taking into account translation locking. + * @param {number} handle + * @returns {RawVector} + */ + rbEffectiveInvMass(handle) { + const ret = wasm.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * @param {number} handle + * @param {boolean} locked + * @param {boolean} wake_up + */ + rbLockTranslations(handle, locked, wake_up) { + wasm.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, handle, locked, wake_up); + } + /** + * The angular inertia along the principal inertia axes of the rigid-body. + * @param {number} handle + * @returns {number} + */ + rbPrincipalInertia(handle) { + const ret = wasm.rawrigidbodyset_rbPrincipalInertia(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @param {number} factor + */ + rbSetLinearDamping(handle, factor) { + wasm.rawrigidbodyset_rbSetLinearDamping(this.__wbg_ptr, handle, factor); + } + /** + * @param {number} handle + * @param {number} mass + * @param {boolean} wake_up + */ + rbSetAdditionalMass(handle, mass, wake_up) { + wasm.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, handle, mass, wake_up); + } + /** + * @param {number} handle + * @param {number} factor + */ + rbSetAngularDamping(handle, factor) { + wasm.rawrigidbodyset_rbSetAngularDamping(this.__wbg_ptr, handle, factor); + } + /** + * @param {number} handle + * @param {number} group + */ + rbSetDominanceGroup(handle, group) { + wasm.rawrigidbodyset_rbSetDominanceGroup(this.__wbg_ptr, handle, group); + } + /** + * @param {number} handle + * @returns {number} + */ + rbSoftCcdPrediction(handle) { + const ret = wasm.rawrigidbodyset_rbSoftCcdPrediction(this.__wbg_ptr, handle); + return ret; + } + /** + * Applies an impulsive torque at the center-of-mass of this rigid-body. + * + * # Parameters + * - `torque impulse`: the torque impulse to apply on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + * @param {number} handle + * @param {number} torque_impulse + * @param {boolean} wakeUp + */ + rbApplyTorqueImpulse(handle, torque_impulse, wakeUp) { + wasm.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, handle, torque_impulse, wakeUp); + } + /** + * Applies an impulse at the given world-space point of this rigid-body. + * + * # Parameters + * - `impulse`: the world-space impulse to apply on the rigid-body. + * - `point`: the world-space point where the impulse is to be applied on the rigid-body. + * - `wakeUp`: should the rigid-body be automatically woken-up? + * @param {number} handle + * @param {RawVector} impulse + * @param {RawVector} point + * @param {boolean} wakeUp + */ + rbApplyImpulseAtPoint(handle, impulse, point, wakeUp) { + _assertClass(impulse, RawVector); + _assertClass(point, RawVector); + wasm.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, handle, impulse.__wbg_ptr, point.__wbg_ptr, wakeUp); + } + /** + * The inverse of the principal angular inertia of the rigid-body. + * + * Components set to zero are assumed to be infinite along the corresponding principal axis. + * @param {number} handle + * @returns {number} + */ + rbInvPrincipalInertia(handle) { + const ret = wasm.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, handle); + return ret; + } + /** + * @param {number} handle + * @param {number} prediction + */ + rbSetSoftCcdPrediction(handle, prediction) { + wasm.rawrigidbodyset_rbSetSoftCcdPrediction(this.__wbg_ptr, handle, prediction); + } + /** + * @param {number} handle + * @param {boolean} allow_x + * @param {boolean} allow_y + * @param {boolean} wake_up + */ + rbSetEnabledTranslations(handle, allow_x, allow_y, wake_up) { + wasm.rawrigidbodyset_rbSetEnabledTranslations(this.__wbg_ptr, handle, allow_x, allow_y, wake_up); + } + /** + * The effective world-space angular inertia (that takes the potential rotation locking into account) of + * this rigid-body. + * @param {number} handle + * @returns {number} + */ + rbEffectiveAngularInertia(handle) { + const ret = wasm.rawrigidbodyset_rbEffectiveAngularInertia(this.__wbg_ptr, handle); + return ret; + } + /** + * The world-space inverse angular inertia tensor of the rigid-body, + * taking into account rotation locking. + * @param {number} handle + * @returns {number} + */ + rbEffectiveWorldInvInertia(handle) { + const ret = wasm.rawrigidbodyset_rbEffectiveWorldInvInertia(this.__wbg_ptr, handle); + return ret; + } + /** + * If this rigid body is kinematic, sets its future rotation after the next timestep integration. + * + * This should be used instead of `rigidBody.setRotation` to make the dynamic object + * interacting with this kinematic body behave as expected. Internally, Rapier will compute + * an artificial velocity for this rigid-body from its current position and its next kinematic + * position. This velocity will be used to compute forces on dynamic bodies interacting with + * this body. + * + * # Parameters + * - `angle`: the rotation angle, in radians. + * @param {number} handle + * @param {number} angle + */ + rbSetNextKinematicRotation(handle, angle) { + wasm.rawrigidbodyset_rbSetNextKinematicRotation(this.__wbg_ptr, handle, angle); + } + /** + * @param {number} handle + * @returns {number} + */ + rbAdditionalSolverIterations(handle) { + const ret = wasm.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, handle); + return ret >>> 0; + } + /** + * @param {number} handle + * @param {number} mass + * @param {RawVector} centerOfMass + * @param {number} principalAngularInertia + * @param {boolean} wake_up + */ + rbSetAdditionalMassProperties(handle, mass, centerOfMass, principalAngularInertia, wake_up) { + _assertClass(centerOfMass, RawVector); + wasm.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, handle, mass, centerOfMass.__wbg_ptr, principalAngularInertia, wake_up); + } + /** + * If this rigid body is kinematic, sets its future translation after the next timestep integration. + * + * This should be used instead of `rigidBody.setTranslation` to make the dynamic object + * interacting with this kinematic body behave as expected. Internally, Rapier will compute + * an artificial velocity for this rigid-body from its current position and its next kinematic + * position. This velocity will be used to compute forces on dynamic bodies interacting with + * this body. + * + * # Parameters + * - `x`: the world-space position of the rigid-body along the `x` axis. + * - `y`: the world-space position of the rigid-body along the `y` axis. + * @param {number} handle + * @param {number} x + * @param {number} y + */ + rbSetNextKinematicTranslation(handle, x, y) { + wasm.rawrigidbodyset_rbSetNextKinematicTranslation(this.__wbg_ptr, handle, x, y); + } + /** + * @param {number} handle + * @param {number} iters + */ + rbSetAdditionalSolverIterations(handle, iters) { + wasm.rawrigidbodyset_rbSetAdditionalSolverIterations(this.__wbg_ptr, handle, iters); + } + /** + * @param {number} handle + * @param {RawColliderSet} colliders + */ + rbRecomputeMassPropertiesFromColliders(handle, colliders) { + _assertClass(colliders, RawColliderSet); + wasm.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, handle, colliders.__wbg_ptr); + } + /** + * The mass of this rigid-body. + * @param {number} handle + * @returns {number} + */ + rbMass(handle) { + const ret = wasm.rawrigidbodyset_rbMass(this.__wbg_ptr, handle); + return ret; + } + /** + * Put the given rigid-body to sleep. + * @param {number} handle + */ + rbSleep(handle) { + wasm.rawrigidbodyset_rbSleep(this.__wbg_ptr, handle); + } + /** + * The angular velocity of this rigid-body. + * @param {number} handle + * @returns {number} + */ + rbAngvel(handle) { + const ret = wasm.rawrigidbodyset_rbAngvel(this.__wbg_ptr, handle); + return ret; + } + /** + * The linear velocity of this rigid-body. + * @param {number} handle + * @returns {RawVector} + */ + rbLinvel(handle) { + const ret = wasm.rawrigidbodyset_rbLinvel(this.__wbg_ptr, handle); + return RawVector.__wrap(ret); + } + /** + * Wakes this rigid-body up. + * + * A dynamic rigid-body that does not move during several consecutive frames will + * be put to sleep by the physics engine, i.e., it will stop being simulated in order + * to avoid useless computations. + * This method forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying + * the position of a dynamic body so that it is properly simulated afterwards. + * @param {number} handle + */ + rbWakeUp(handle) { + wasm.rawrigidbodyset_rbWakeUp(this.__wbg_ptr, handle); + } + /** + * The inverse of the mass of a rigid-body. + * + * If this is zero, the rigid-body is assumed to have infinite mass. + * @param {number} handle + * @returns {number} + */ + rbInvMass(handle) { + const ret = wasm.rawrigidbodyset_rbInvMass(this.__wbg_ptr, handle); + return ret; + } + /** + * Is this rigid-body fixed? + * @param {number} handle + * @returns {boolean} + */ + rbIsFixed(handle) { + const ret = wasm.rawrigidbodyset_rbIsFixed(this.__wbg_ptr, handle); + return ret !== 0; + } + /** + * @param {boolean} enabled + * @param {RawVector} translation + * @param {RawRotation} rotation + * @param {number} gravityScale + * @param {number} mass + * @param {boolean} massOnly + * @param {RawVector} centerOfMass + * @param {RawVector} linvel + * @param {number} angvel + * @param {number} principalAngularInertia + * @param {boolean} translationEnabledX + * @param {boolean} translationEnabledY + * @param {boolean} rotationsEnabled + * @param {number} linearDamping + * @param {number} angularDamping + * @param {RawRigidBodyType} rb_type + * @param {boolean} canSleep + * @param {boolean} sleeping + * @param {number} softCcdPrediciton + * @param {boolean} ccdEnabled + * @param {number} dominanceGroup + * @param {number} additional_solver_iterations + * @returns {number} + */ + 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) { + _assertClass(translation, RawVector); + _assertClass(rotation, RawRotation); + _assertClass(centerOfMass, RawVector); + _assertClass(linvel, RawVector); + 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); + return ret; + } + /** + * Applies the given JavaScript function to the integer handle of each rigid-body managed by this set. + * + * # Parameters + * - `f(handle)`: the function to apply to the integer handle of each rigid-body managed by this set. Called as `f(collider)`. + * @param {Function} f + */ + forEachRigidBodyHandle(f) { + try { + wasm.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, addBorrowedObject(f)); + } finally { + heap[stack_pointer++] = undefined; + } + } + /** + * The number of rigid-bodies on this set. + * @returns {number} + */ + len() { + const ret = wasm.rawrigidbodyset_len(this.__wbg_ptr); + return ret >>> 0; + } + constructor() { + const ret = wasm.rawrigidbodyset_new(); + this.__wbg_ptr = ret >>> 0; + RawRigidBodySetFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {RawColliderSet} colliders + */ + propagateModifiedBodyPositionsToColliders(colliders) { + _assertClass(colliders, RawColliderSet); + wasm.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, colliders.__wbg_ptr); + } + /** + * @param {number} handle + * @param {RawIslandManager} islands + * @param {RawColliderSet} colliders + * @param {RawImpulseJointSet} joints + * @param {RawMultibodyJointSet} articulations + */ + remove(handle, islands, colliders, joints, articulations) { + _assertClass(islands, RawIslandManager); + _assertClass(colliders, RawColliderSet); + _assertClass(joints, RawImpulseJointSet); + _assertClass(articulations, RawMultibodyJointSet); + wasm.rawrigidbodyset_remove(this.__wbg_ptr, handle, islands.__wbg_ptr, colliders.__wbg_ptr, joints.__wbg_ptr, articulations.__wbg_ptr); + } + /** + * Checks if a rigid-body with the given integer handle exists. + * @param {number} handle + * @returns {boolean} + */ + contains(handle) { + const ret = wasm.rawrigidbodyset_contains(this.__wbg_ptr, handle); + return ret !== 0; + } +} + +const RawRotationFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawrotation_free(ptr >>> 0, 1)); +/** + * A rotation quaternion. + */ +export class RawRotation { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawRotation.prototype); + obj.__wbg_ptr = ptr; + RawRotationFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawRotationFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawrotation_free(ptr, 0); + } + /** + * The imaginary part of this complex number. + * @returns {number} + */ + get im() { + const ret = wasm.rawkinematiccharactercontroller_offset(this.__wbg_ptr); + return ret; + } + /** + * The real part of this complex number. + * @returns {number} + */ + get re() { + const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); + return ret; + } + /** + * The rotation angle in radians. + * @returns {number} + */ + get angle() { + const ret = wasm.rawrotation_angle(this.__wbg_ptr); + return ret; + } + /** + * The identity rotation. + * @returns {RawRotation} + */ + static identity() { + const ret = wasm.rawrotation_identity(); + return RawRotation.__wrap(ret); + } + /** + * The rotation with thegiven angle. + * @param {number} angle + * @returns {RawRotation} + */ + static fromAngle(angle) { + const ret = wasm.rawrotation_fromAngle(angle); + return RawRotation.__wrap(ret); + } +} + +const RawSerializationPipelineFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawserializationpipeline_free(ptr >>> 0, 1)); + +export class RawSerializationPipeline { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawSerializationPipelineFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawserializationpipeline_free(ptr, 0); + } + /** + * @param {RawVector} gravity + * @param {RawIntegrationParameters} integrationParameters + * @param {RawIslandManager} islands + * @param {RawBroadPhase} broadPhase + * @param {RawNarrowPhase} narrowPhase + * @param {RawRigidBodySet} bodies + * @param {RawColliderSet} colliders + * @param {RawImpulseJointSet} impulse_joints + * @param {RawMultibodyJointSet} multibody_joints + * @returns {Uint8Array | undefined} + */ + serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulse_joints, multibody_joints) { + _assertClass(gravity, RawVector); + _assertClass(integrationParameters, RawIntegrationParameters); + _assertClass(islands, RawIslandManager); + _assertClass(broadPhase, RawBroadPhase); + _assertClass(narrowPhase, RawNarrowPhase); + _assertClass(bodies, RawRigidBodySet); + _assertClass(colliders, RawColliderSet); + _assertClass(impulse_joints, RawImpulseJointSet); + _assertClass(multibody_joints, RawMultibodyJointSet); + 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); + return takeObject(ret); + } + /** + * @param {Uint8Array} data + * @returns {RawDeserializedWorld | undefined} + */ + deserializeAll(data) { + const ret = wasm.rawserializationpipeline_deserializeAll(this.__wbg_ptr, addHeapObject(data)); + return ret === 0 ? undefined : RawDeserializedWorld.__wrap(ret); + } + constructor() { + const ret = wasm.rawccdsolver_new(); + this.__wbg_ptr = ret >>> 0; + RawSerializationPipelineFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +const RawShapeFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawshape_free(ptr >>> 0, 1)); + +export class RawShape { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawShape.prototype); + obj.__wbg_ptr = ptr; + RawShapeFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawShapeFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawshape_free(ptr, 0); + } + /** + * @param {Float32Array} points + * @returns {RawShape | undefined} + */ + static convexHull(points) { + const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_convexHull(ptr0, len0); + return ret === 0 ? undefined : RawShape.__wrap(ret); + } + /** + * @param {Float32Array} heights + * @param {RawVector} scale + * @returns {RawShape} + */ + static heightfield(heights, scale) { + const ptr0 = passArrayF32ToWasm0(heights, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + _assertClass(scale, RawVector); + const ret = wasm.rawshape_heightfield(ptr0, len0, scale.__wbg_ptr); + return RawShape.__wrap(ret); + } + /** + * @param {number} hx + * @param {number} hy + * @param {number} borderRadius + * @returns {RawShape} + */ + static roundCuboid(hx, hy, borderRadius) { + const ret = wasm.rawshape_roundCuboid(hx, hy, borderRadius); + return RawShape.__wrap(ret); + } + /** + * @param {RawVector} shapePos1 + * @param {RawRotation} shapeRot1 + * @param {RawShape} shape2 + * @param {RawVector} shapePos2 + * @param {RawRotation} shapeRot2 + * @param {number} prediction + * @returns {RawShapeContact | undefined} + */ + contactShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2, prediction) { + _assertClass(shapePos1, RawVector); + _assertClass(shapeRot1, RawRotation); + _assertClass(shape2, RawShape); + _assertClass(shapePos2, RawVector); + _assertClass(shapeRot2, RawRotation); + const ret = wasm.rawshape_contactShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr, prediction); + return ret === 0 ? undefined : RawShapeContact.__wrap(ret); + } + /** + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawVector} point + * @param {boolean} solid + * @returns {RawPointProjection} + */ + projectPoint(shapePos, shapeRot, point, solid) { + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(point, RawVector); + const ret = wasm.rawshape_projectPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr, solid); + return RawPointProjection.__wrap(ret); + } + /** + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawVector} point + * @returns {boolean} + */ + containsPoint(shapePos, shapeRot, point) { + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(point, RawVector); + const ret = wasm.rawshape_containsPoint(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, point.__wbg_ptr); + return ret !== 0; + } + /** + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @returns {boolean} + */ + intersectsRay(shapePos, shapeRot, rayOrig, rayDir, maxToi) { + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawshape_intersectsRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi); + return ret !== 0; + } + /** + * @param {RawVector} p1 + * @param {RawVector} p2 + * @param {RawVector} p3 + * @param {number} borderRadius + * @returns {RawShape} + */ + static roundTriangle(p1, p2, p3, borderRadius) { + _assertClass(p1, RawVector); + _assertClass(p2, RawVector); + _assertClass(p3, RawVector); + const ret = wasm.rawshape_roundTriangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr, borderRadius); + return RawShape.__wrap(ret); + } + /** + * @param {Float32Array} vertices + * @returns {RawShape | undefined} + */ + static convexPolyline(vertices) { + const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_convexPolyline(ptr0, len0); + return ret === 0 ? undefined : RawShape.__wrap(ret); + } + /** + * @param {RawVector} shapePos1 + * @param {RawRotation} shapeRot1 + * @param {RawShape} shape2 + * @param {RawVector} shapePos2 + * @param {RawRotation} shapeRot2 + * @returns {boolean} + */ + intersectsShape(shapePos1, shapeRot1, shape2, shapePos2, shapeRot2) { + _assertClass(shapePos1, RawVector); + _assertClass(shapeRot1, RawRotation); + _assertClass(shape2, RawShape); + _assertClass(shapePos2, RawVector); + _assertClass(shapeRot2, RawRotation); + const ret = wasm.rawshape_intersectsShape(this.__wbg_ptr, shapePos1.__wbg_ptr, shapeRot1.__wbg_ptr, shape2.__wbg_ptr, shapePos2.__wbg_ptr, shapeRot2.__wbg_ptr); + return ret !== 0; + } + /** + * @param {Float32Array} points + * @param {number} borderRadius + * @returns {RawShape | undefined} + */ + static roundConvexHull(points, borderRadius) { + const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_roundConvexHull(ptr0, len0, borderRadius); + return ret === 0 ? undefined : RawShape.__wrap(ret); + } + /** + * @param {RawVector} voxel_size + * @param {Float32Array} points + * @returns {RawShape} + */ + static voxelsFromPoints(voxel_size, points) { + _assertClass(voxel_size, RawVector); + const ptr0 = passArrayF32ToWasm0(points, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_voxelsFromPoints(voxel_size.__wbg_ptr, ptr0, len0); + return RawShape.__wrap(ret); + } + /** + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @returns {RawRayIntersection | undefined} + */ + castRayAndGetNormal(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) { + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawshape_castRayAndGetNormal(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); + return ret === 0 ? undefined : RawRayIntersection.__wrap(ret); + } + /** + * @param {Float32Array} vertices + * @param {number} borderRadius + * @returns {RawShape | undefined} + */ + static roundConvexPolyline(vertices, borderRadius) { + const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_roundConvexPolyline(ptr0, len0, borderRadius); + return ret === 0 ? undefined : RawShape.__wrap(ret); + } + /** + * @param {number} radius + * @returns {RawShape} + */ + static ball(radius) { + const ret = wasm.rawshape_ball(radius); + return RawShape.__wrap(ret); + } + /** + * @param {number} hx + * @param {number} hy + * @returns {RawShape} + */ + static cuboid(hx, hy) { + const ret = wasm.rawshape_cuboid(hx, hy); + return RawShape.__wrap(ret); + } + /** + * @param {RawVector} voxel_size + * @param {Int32Array} grid_coords + * @returns {RawShape} + */ + static voxels(voxel_size, grid_coords) { + _assertClass(voxel_size, RawVector); + const ptr0 = passArray32ToWasm0(grid_coords, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_voxels(voxel_size.__wbg_ptr, ptr0, len0); + return RawShape.__wrap(ret); + } + /** + * @param {number} halfHeight + * @param {number} radius + * @returns {RawShape} + */ + static capsule(halfHeight, radius) { + const ret = wasm.rawshape_capsule(halfHeight, radius); + return RawShape.__wrap(ret); + } + /** + * @param {RawVector} shapePos + * @param {RawRotation} shapeRot + * @param {RawVector} rayOrig + * @param {RawVector} rayDir + * @param {number} maxToi + * @param {boolean} solid + * @returns {number} + */ + castRay(shapePos, shapeRot, rayOrig, rayDir, maxToi, solid) { + _assertClass(shapePos, RawVector); + _assertClass(shapeRot, RawRotation); + _assertClass(rayOrig, RawVector); + _assertClass(rayDir, RawVector); + const ret = wasm.rawshape_castRay(this.__wbg_ptr, shapePos.__wbg_ptr, shapeRot.__wbg_ptr, rayOrig.__wbg_ptr, rayDir.__wbg_ptr, maxToi, solid); + return ret; + } + /** + * @param {RawVector} p1 + * @param {RawVector} p2 + * @returns {RawShape} + */ + static segment(p1, p2) { + _assertClass(p1, RawVector); + _assertClass(p2, RawVector); + const ret = wasm.rawshape_segment(p1.__wbg_ptr, p2.__wbg_ptr); + return RawShape.__wrap(ret); + } + /** + * @param {Float32Array} vertices + * @param {Uint32Array} indices + * @param {number} flags + * @returns {RawShape | undefined} + */ + static trimesh(vertices, indices, flags) { + const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_trimesh(ptr0, len0, ptr1, len1, flags); + return ret === 0 ? undefined : RawShape.__wrap(ret); + } + /** + * @param {Float32Array} vertices + * @param {Uint32Array} indices + * @returns {RawShape} + */ + static polyline(vertices, indices) { + const ptr0 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.rawshape_polyline(ptr0, len0, ptr1, len1); + return RawShape.__wrap(ret); + } + /** + * @param {RawVector} p1 + * @param {RawVector} p2 + * @param {RawVector} p3 + * @returns {RawShape} + */ + static triangle(p1, p2, p3) { + _assertClass(p1, RawVector); + _assertClass(p2, RawVector); + _assertClass(p3, RawVector); + const ret = wasm.rawshape_triangle(p1.__wbg_ptr, p2.__wbg_ptr, p3.__wbg_ptr); + return RawShape.__wrap(ret); + } + /** + * @param {RawVector} shapePos1 + * @param {RawRotation} shapeRot1 + * @param {RawVector} shapeVel1 + * @param {RawShape} shape2 + * @param {RawVector} shapePos2 + * @param {RawRotation} shapeRot2 + * @param {RawVector} shapeVel2 + * @param {number} target_distance + * @param {number} maxToi + * @param {boolean} stop_at_penetration + * @returns {RawShapeCastHit | undefined} + */ + castShape(shapePos1, shapeRot1, shapeVel1, shape2, shapePos2, shapeRot2, shapeVel2, target_distance, maxToi, stop_at_penetration) { + _assertClass(shapePos1, RawVector); + _assertClass(shapeRot1, RawRotation); + _assertClass(shapeVel1, RawVector); + _assertClass(shape2, RawShape); + _assertClass(shapePos2, RawVector); + _assertClass(shapeRot2, RawRotation); + _assertClass(shapeVel2, RawVector); + 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); + return ret === 0 ? undefined : RawShapeCastHit.__wrap(ret); + } + /** + * @param {RawVector} normal + * @returns {RawShape} + */ + static halfspace(normal) { + _assertClass(normal, RawVector); + const ret = wasm.rawshape_halfspace(normal.__wbg_ptr); + return RawShape.__wrap(ret); + } +} + +const RawShapeCastHitFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawshapecasthit_free(ptr >>> 0, 1)); + +export class RawShapeCastHit { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawShapeCastHit.prototype); + obj.__wbg_ptr = ptr; + RawShapeCastHitFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawShapeCastHitFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawshapecasthit_free(ptr, 0); + } + /** + * @returns {number} + */ + time_of_impact() { + const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); + return ret; + } + /** + * @returns {RawVector} + */ + normal1() { + const ret = wasm.rawcollidershapecasthit_witness2(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + normal2() { + const ret = wasm.rawcollidershapecasthit_normal1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + witness1() { + const ret = wasm.rawshapecasthit_witness1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + witness2() { + const ret = wasm.rawcollidershapecasthit_witness1(this.__wbg_ptr); + return RawVector.__wrap(ret); + } +} + +const RawShapeContactFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawshapecontact_free(ptr >>> 0, 1)); + +export class RawShapeContact { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawShapeContact.prototype); + obj.__wbg_ptr = ptr; + RawShapeContactFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawShapeContactFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawshapecontact_free(ptr, 0); + } + /** + * @returns {RawVector} + */ + point1() { + const ret = wasm.rawpointprojection_point(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + point2() { + const ret = wasm.rawpointcolliderprojection_point(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + normal1() { + const ret = wasm.rawcontactforceevent_total_force(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {RawVector} + */ + normal2() { + const ret = wasm.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * @returns {number} + */ + distance() { + const ret = wasm.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr); + return ret; + } +} + +const RawVectorFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_rawvector_free(ptr >>> 0, 1)); +/** + * A vector. + */ +export class RawVector { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RawVector.prototype); + obj.__wbg_ptr = ptr; + RawVectorFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RawVectorFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rawvector_free(ptr, 0); + } + /** + * The `x` component of this vector. + * @returns {number} + */ + get x() { + const ret = wasm.rawintegrationparameters_dt(this.__wbg_ptr); + return ret; + } + /** + * The `y` component of this vector. + * @returns {number} + */ + get y() { + const ret = wasm.rawkinematiccharactercontroller_offset(this.__wbg_ptr); + return ret; + } + /** + * Create a new 2D vector from this vector with its components rearranged as `{x, y}`. + * @returns {RawVector} + */ + xy() { + const ret = wasm.rawvector_xy(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * Create a new 2D vector from this vector with its components rearranged as `{y, x}`. + * @returns {RawVector} + */ + yx() { + const ret = wasm.rawvector_yx(this.__wbg_ptr); + return RawVector.__wrap(ret); + } + /** + * Creates a new 2D vector from its two components. + * + * # Parameters + * - `x`: the `x` component of this 2D vector. + * - `y`: the `y` component of this 2D vector. + * @param {number} x + * @param {number} y + */ + constructor(x, y) { + const ret = wasm.rawvector_new(x, y); + this.__wbg_ptr = ret >>> 0; + RawVectorFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * Creates a new vector filled with zeros. + * @returns {RawVector} + */ + static zero() { + const ret = wasm.rawvector_zero(); + return RawVector.__wrap(ret); + } + /** + * Sets the `x` component of this vector. + * @param {number} x + */ + set x(x) { + wasm.rawintegrationparameters_set_dt(this.__wbg_ptr, x); + } + /** + * Sets the `y` component of this vector. + * @param {number} y + */ + set y(y) { + wasm.rawvector_set_y(this.__wbg_ptr, y); + } +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_bind_c8359b1cba058168 = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).bind(getObject(arg1), getObject(arg2), getObject(arg3)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); + }; + imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) { + const ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) { + const ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) { + const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) { + const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) { + const ret = new Float32Array(arg0 >>> 0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) { + const ret = getObject(arg0).now(); + return ret; + }; + imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) { + const ret = getObject(arg0).performance; + return addHeapObject(ret); + }; + imports.wbg.__wbg_rawcontactforceevent_new = function(arg0) { + const ret = RawContactForceEvent.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_rawraycolliderintersection_new = function(arg0) { + const ret = RawRayColliderIntersection.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); + }; + imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = getObject(arg0); + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; + }; + imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(getObject(arg0)) === 'function'; + return ret; + }; + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; + }; + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbindgen_number_new = function(arg0) { + const ret = arg0; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedFloat32ArrayMemory0 = null; + cachedInt32ArrayMemory0 = null; + cachedUint32ArrayMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('rapier_wasm2d_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/packages/rapier2d/pkg/rapier_wasm2d_bg.wasm b/packages/rapier2d/pkg/rapier_wasm2d_bg.wasm new file mode 100644 index 00000000..9c3912c9 Binary files /dev/null and b/packages/rapier2d/pkg/rapier_wasm2d_bg.wasm differ diff --git a/packages/rapier2d/pkg/rapier_wasm2d_bg.wasm.d.ts b/packages/rapier2d/pkg/rapier_wasm2d_bg.wasm.d.ts new file mode 100644 index 00000000..e4bf9de5 --- /dev/null +++ b/packages/rapier2d/pkg/rapier_wasm2d_bg.wasm.d.ts @@ -0,0 +1,468 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export const __wbg_rawbroadphase_free: (a: number, b: number) => void; +export const __wbg_rawccdsolver_free: (a: number, b: number) => void; +export const __wbg_rawcharactercollision_free: (a: number, b: number) => void; +export const __wbg_rawcolliderset_free: (a: number, b: number) => void; +export const __wbg_rawcollidershapecasthit_free: (a: number, b: number) => void; +export const __wbg_rawcontactforceevent_free: (a: number, b: number) => void; +export const __wbg_rawcontactmanifold_free: (a: number, b: number) => void; +export const __wbg_rawdebugrenderpipeline_free: (a: number, b: number) => void; +export const __wbg_rawdeserializedworld_free: (a: number, b: number) => void; +export const __wbg_raweventqueue_free: (a: number, b: number) => void; +export const __wbg_rawgenericjoint_free: (a: number, b: number) => void; +export const __wbg_rawimpulsejointset_free: (a: number, b: number) => void; +export const __wbg_rawintegrationparameters_free: (a: number, b: number) => void; +export const __wbg_rawislandmanager_free: (a: number, b: number) => void; +export const __wbg_rawkinematiccharactercontroller_free: (a: number, b: number) => void; +export const __wbg_rawmultibodyjointset_free: (a: number, b: number) => void; +export const __wbg_rawnarrowphase_free: (a: number, b: number) => void; +export const __wbg_rawphysicspipeline_free: (a: number, b: number) => void; +export const __wbg_rawpidcontroller_free: (a: number, b: number) => void; +export const __wbg_rawpointcolliderprojection_free: (a: number, b: number) => void; +export const __wbg_rawpointprojection_free: (a: number, b: number) => void; +export const __wbg_rawrayintersection_free: (a: number, b: number) => void; +export const __wbg_rawrigidbodyset_free: (a: number, b: number) => void; +export const __wbg_rawrotation_free: (a: number, b: number) => void; +export const __wbg_rawshape_free: (a: number, b: number) => void; +export const __wbg_rawshapecontact_free: (a: number, b: number) => void; +export const __wbg_rawvector_free: (a: number, b: number) => void; +export const rawbroadphase_castRay: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => number; +export const rawbroadphase_castRayAndGetNormal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => number; +export const rawbroadphase_castShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => number; +export const rawbroadphase_collidersWithAabbIntersectingAabb: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void; +export const rawbroadphase_intersectionWithShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void; +export const rawbroadphase_intersectionsWithPoint: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void; +export const rawbroadphase_intersectionsWithRay: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void; +export const rawbroadphase_intersectionsWithShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void; +export const rawbroadphase_new: () => number; +export const rawbroadphase_projectPoint: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number; +export const rawbroadphase_projectPointAndGetFeature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number; +export const rawcharactercollision_handle: (a: number) => number; +export const rawcharactercollision_new: () => number; +export const rawcharactercollision_toi: (a: number) => number; +export const rawcharactercollision_translationDeltaApplied: (a: number) => number; +export const rawcharactercollision_translationDeltaRemaining: (a: number) => number; +export const rawcharactercollision_worldNormal1: (a: number) => number; +export const rawcharactercollision_worldNormal2: (a: number) => number; +export const rawcharactercollision_worldWitness1: (a: number) => number; +export const rawcharactercollision_worldWitness2: (a: number) => number; +export const rawcolliderset_coActiveCollisionTypes: (a: number, b: number) => number; +export const rawcolliderset_coActiveEvents: (a: number, b: number) => number; +export const rawcolliderset_coActiveHooks: (a: number, b: number) => number; +export const rawcolliderset_coCastCollider: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; +export const rawcolliderset_coCastRay: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawcolliderset_coCastRayAndGetNormal: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawcolliderset_coCastShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number; +export const rawcolliderset_coCollisionGroups: (a: number, b: number) => number; +export const rawcolliderset_coCombineVoxelStates: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawcolliderset_coContactCollider: (a: number, b: number, c: number, d: number) => number; +export const rawcolliderset_coContactForceEventThreshold: (a: number, b: number) => number; +export const rawcolliderset_coContactShape: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawcolliderset_coContactSkin: (a: number, b: number) => number; +export const rawcolliderset_coContainsPoint: (a: number, b: number, c: number) => number; +export const rawcolliderset_coDensity: (a: number, b: number) => number; +export const rawcolliderset_coFriction: (a: number, b: number) => number; +export const rawcolliderset_coFrictionCombineRule: (a: number, b: number) => number; +export const rawcolliderset_coHalfExtents: (a: number, b: number) => number; +export const rawcolliderset_coHalfHeight: (a: number, b: number) => number; +export const rawcolliderset_coHalfspaceNormal: (a: number, b: number) => number; +export const rawcolliderset_coHeightfieldHeights: (a: number, b: number, c: number) => void; +export const rawcolliderset_coHeightfieldScale: (a: number, b: number) => number; +export const rawcolliderset_coIndices: (a: number, b: number, c: number) => void; +export const rawcolliderset_coIntersectsRay: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawcolliderset_coIntersectsShape: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawcolliderset_coIsEnabled: (a: number, b: number) => number; +export const rawcolliderset_coIsSensor: (a: number, b: number) => number; +export const rawcolliderset_coMass: (a: number, b: number) => number; +export const rawcolliderset_coParent: (a: number, b: number, c: number) => void; +export const rawcolliderset_coProjectPoint: (a: number, b: number, c: number, d: number) => number; +export const rawcolliderset_coPropagateVoxelChange: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void; +export const rawcolliderset_coRadius: (a: number, b: number) => number; +export const rawcolliderset_coRestitution: (a: number, b: number) => number; +export const rawcolliderset_coRestitutionCombineRule: (a: number, b: number) => number; +export const rawcolliderset_coRotation: (a: number, b: number) => number; +export const rawcolliderset_coRotationWrtParent: (a: number, b: number) => number; +export const rawcolliderset_coRoundRadius: (a: number, b: number) => number; +export const rawcolliderset_coSetActiveCollisionTypes: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetActiveEvents: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetActiveHooks: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetCollisionGroups: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetContactForceEventThreshold: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetContactSkin: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetDensity: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetEnabled: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetFriction: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetFrictionCombineRule: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetHalfExtents: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetHalfHeight: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetMass: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetMassProperties: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawcolliderset_coSetRadius: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetRestitution: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetRestitutionCombineRule: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetRotation: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetRotationWrtParent: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetRoundRadius: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetSensor: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetShape: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetSolverGroups: (a: number, b: number, c: number) => void; +export const rawcolliderset_coSetTranslation: (a: number, b: number, c: number, d: number) => void; +export const rawcolliderset_coSetTranslationWrtParent: (a: number, b: number, c: number, d: number) => void; +export const rawcolliderset_coSetVoxel: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawcolliderset_coShapeType: (a: number, b: number) => number; +export const rawcolliderset_coSolverGroups: (a: number, b: number) => number; +export const rawcolliderset_coTranslation: (a: number, b: number) => number; +export const rawcolliderset_coTranslationWrtParent: (a: number, b: number) => number; +export const rawcolliderset_coTriMeshFlags: (a: number, b: number) => number; +export const rawcolliderset_coVertices: (a: number, b: number, c: number) => void; +export const rawcolliderset_coVolume: (a: number, b: number) => number; +export const rawcolliderset_coVoxelData: (a: number, b: number, c: number) => void; +export const rawcolliderset_coVoxelSize: (a: number, b: number) => number; +export const rawcolliderset_contains: (a: number, b: number) => number; +export const rawcolliderset_createCollider: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number) => void; +export const rawcolliderset_forEachColliderHandle: (a: number, b: number) => void; +export const rawcolliderset_len: (a: number) => number; +export const rawcolliderset_new: () => number; +export const rawcolliderset_remove: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawcollidershapecasthit_colliderHandle: (a: number) => number; +export const rawcollidershapecasthit_normal1: (a: number) => number; +export const rawcollidershapecasthit_normal2: (a: number) => number; +export const rawcollidershapecasthit_time_of_impact: (a: number) => number; +export const rawcollidershapecasthit_witness1: (a: number) => number; +export const rawcollidershapecasthit_witness2: (a: number) => number; +export const rawcontactforceevent_collider2: (a: number) => number; +export const rawcontactforceevent_max_force_magnitude: (a: number) => number; +export const rawcontactforceevent_total_force: (a: number) => number; +export const rawcontactforceevent_total_force_magnitude: (a: number) => number; +export const rawcontactmanifold_contact_dist: (a: number, b: number) => number; +export const rawcontactmanifold_contact_fid1: (a: number, b: number) => number; +export const rawcontactmanifold_contact_fid2: (a: number, b: number) => number; +export const rawcontactmanifold_contact_impulse: (a: number, b: number) => number; +export const rawcontactmanifold_contact_local_p1: (a: number, b: number) => number; +export const rawcontactmanifold_contact_local_p2: (a: number, b: number) => number; +export const rawcontactmanifold_contact_tangent_impulse: (a: number, b: number) => number; +export const rawcontactmanifold_local_n1: (a: number) => number; +export const rawcontactmanifold_local_n2: (a: number) => number; +export const rawcontactmanifold_normal: (a: number) => number; +export const rawcontactmanifold_num_contacts: (a: number) => number; +export const rawcontactmanifold_num_solver_contacts: (a: number) => number; +export const rawcontactmanifold_solver_contact_dist: (a: number, b: number) => number; +export const rawcontactmanifold_solver_contact_friction: (a: number, b: number) => number; +export const rawcontactmanifold_solver_contact_point: (a: number, b: number) => number; +export const rawcontactmanifold_solver_contact_restitution: (a: number, b: number) => number; +export const rawcontactmanifold_solver_contact_tangent_velocity: (a: number, b: number) => number; +export const rawcontactmanifold_subshape1: (a: number) => number; +export const rawcontactmanifold_subshape2: (a: number) => number; +export const rawcontactpair_collider1: (a: number) => number; +export const rawcontactpair_collider2: (a: number) => number; +export const rawcontactpair_contactManifold: (a: number, b: number) => number; +export const rawcontactpair_numContactManifolds: (a: number) => number; +export const rawdebugrenderpipeline_colors: (a: number) => number; +export const rawdebugrenderpipeline_new: () => number; +export const rawdebugrenderpipeline_render: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void; +export const rawdebugrenderpipeline_vertices: (a: number) => number; +export const rawdeserializedworld_takeBodies: (a: number) => number; +export const rawdeserializedworld_takeBroadPhase: (a: number) => number; +export const rawdeserializedworld_takeColliders: (a: number) => number; +export const rawdeserializedworld_takeGravity: (a: number) => number; +export const rawdeserializedworld_takeImpulseJoints: (a: number) => number; +export const rawdeserializedworld_takeIntegrationParameters: (a: number) => number; +export const rawdeserializedworld_takeIslandManager: (a: number) => number; +export const rawdeserializedworld_takeMultibodyJoints: (a: number) => number; +export const rawdeserializedworld_takeNarrowPhase: (a: number) => number; +export const raweventqueue_clear: (a: number) => void; +export const raweventqueue_drainCollisionEvents: (a: number, b: number) => void; +export const raweventqueue_drainContactForceEvents: (a: number, b: number) => void; +export const raweventqueue_new: (a: number) => number; +export const rawgenericjoint_fixed: (a: number, b: number, c: number, d: number) => number; +export const rawgenericjoint_prismatic: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawgenericjoint_revolute: (a: number, b: number) => number; +export const rawgenericjoint_rope: (a: number, b: number, c: number) => number; +export const rawgenericjoint_spring: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawimpulsejointset_contains: (a: number, b: number) => number; +export const rawimpulsejointset_createJoint: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawimpulsejointset_forEachJointAttachedToRigidBody: (a: number, b: number, c: number) => void; +export const rawimpulsejointset_forEachJointHandle: (a: number, b: number) => void; +export const rawimpulsejointset_jointAnchor1: (a: number, b: number) => number; +export const rawimpulsejointset_jointAnchor2: (a: number, b: number) => number; +export const rawimpulsejointset_jointBodyHandle1: (a: number, b: number) => number; +export const rawimpulsejointset_jointBodyHandle2: (a: number, b: number) => number; +export const rawimpulsejointset_jointConfigureMotor: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void; +export const rawimpulsejointset_jointConfigureMotorModel: (a: number, b: number, c: number, d: number) => void; +export const rawimpulsejointset_jointConfigureMotorPosition: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const rawimpulsejointset_jointConfigureMotorVelocity: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawimpulsejointset_jointContactsEnabled: (a: number, b: number) => number; +export const rawimpulsejointset_jointFrameX1: (a: number, b: number) => number; +export const rawimpulsejointset_jointFrameX2: (a: number, b: number) => number; +export const rawimpulsejointset_jointLimitsEnabled: (a: number, b: number, c: number) => number; +export const rawimpulsejointset_jointLimitsMax: (a: number, b: number, c: number) => number; +export const rawimpulsejointset_jointLimitsMin: (a: number, b: number, c: number) => number; +export const rawimpulsejointset_jointSetAnchor1: (a: number, b: number, c: number) => void; +export const rawimpulsejointset_jointSetAnchor2: (a: number, b: number, c: number) => void; +export const rawimpulsejointset_jointSetContactsEnabled: (a: number, b: number, c: number) => void; +export const rawimpulsejointset_jointSetLimits: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawimpulsejointset_jointType: (a: number, b: number) => number; +export const rawimpulsejointset_len: (a: number) => number; +export const rawimpulsejointset_new: () => number; +export const rawimpulsejointset_remove: (a: number, b: number, c: number) => void; +export const rawintegrationparameters_contact_erp: (a: number) => number; +export const rawintegrationparameters_dt: (a: number) => number; +export const rawintegrationparameters_lengthUnit: (a: number) => number; +export const rawintegrationparameters_maxCcdSubsteps: (a: number) => number; +export const rawintegrationparameters_minIslandSize: (a: number) => number; +export const rawintegrationparameters_new: () => number; +export const rawintegrationparameters_numInternalPgsIterations: (a: number) => number; +export const rawintegrationparameters_numSolverIterations: (a: number) => number; +export const rawintegrationparameters_set_contact_natural_frequency: (a: number, b: number) => void; +export const rawintegrationparameters_set_dt: (a: number, b: number) => void; +export const rawintegrationparameters_set_lengthUnit: (a: number, b: number) => void; +export const rawintegrationparameters_set_maxCcdSubsteps: (a: number, b: number) => void; +export const rawintegrationparameters_set_minIslandSize: (a: number, b: number) => void; +export const rawintegrationparameters_set_normalizedAllowedLinearError: (a: number, b: number) => void; +export const rawintegrationparameters_set_normalizedPredictionDistance: (a: number, b: number) => void; +export const rawintegrationparameters_set_numInternalPgsIterations: (a: number, b: number) => void; +export const rawintegrationparameters_set_numSolverIterations: (a: number, b: number) => void; +export const rawislandmanager_forEachActiveRigidBodyHandle: (a: number, b: number) => void; +export const rawislandmanager_new: () => number; +export const rawkinematiccharactercontroller_autostepEnabled: (a: number) => number; +export const rawkinematiccharactercontroller_autostepIncludesDynamicBodies: (a: number) => number; +export const rawkinematiccharactercontroller_autostepMaxHeight: (a: number) => number; +export const rawkinematiccharactercontroller_autostepMinWidth: (a: number) => number; +export const rawkinematiccharactercontroller_computeColliderMovement: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void; +export const rawkinematiccharactercontroller_computedCollision: (a: number, b: number, c: number) => number; +export const rawkinematiccharactercontroller_computedGrounded: (a: number) => number; +export const rawkinematiccharactercontroller_computedMovement: (a: number) => number; +export const rawkinematiccharactercontroller_disableAutostep: (a: number) => void; +export const rawkinematiccharactercontroller_disableSnapToGround: (a: number) => void; +export const rawkinematiccharactercontroller_enableAutostep: (a: number, b: number, c: number, d: number) => void; +export const rawkinematiccharactercontroller_enableSnapToGround: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_maxSlopeClimbAngle: (a: number) => number; +export const rawkinematiccharactercontroller_minSlopeSlideAngle: (a: number) => number; +export const rawkinematiccharactercontroller_new: (a: number) => number; +export const rawkinematiccharactercontroller_normalNudgeFactor: (a: number) => number; +export const rawkinematiccharactercontroller_numComputedCollisions: (a: number) => number; +export const rawkinematiccharactercontroller_offset: (a: number) => number; +export const rawkinematiccharactercontroller_setMaxSlopeClimbAngle: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_setMinSlopeSlideAngle: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_setNormalNudgeFactor: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_setOffset: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_setSlideEnabled: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_setUp: (a: number, b: number) => void; +export const rawkinematiccharactercontroller_slideEnabled: (a: number) => number; +export const rawkinematiccharactercontroller_snapToGroundDistance: (a: number) => number; +export const rawkinematiccharactercontroller_snapToGroundEnabled: (a: number) => number; +export const rawmultibodyjointset_contains: (a: number, b: number) => number; +export const rawmultibodyjointset_createJoint: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawmultibodyjointset_forEachJointAttachedToRigidBody: (a: number, b: number, c: number) => void; +export const rawmultibodyjointset_forEachJointHandle: (a: number, b: number) => void; +export const rawmultibodyjointset_jointAnchor1: (a: number, b: number) => number; +export const rawmultibodyjointset_jointAnchor2: (a: number, b: number) => number; +export const rawmultibodyjointset_jointContactsEnabled: (a: number, b: number) => number; +export const rawmultibodyjointset_jointFrameX1: (a: number, b: number) => number; +export const rawmultibodyjointset_jointFrameX2: (a: number, b: number) => number; +export const rawmultibodyjointset_jointLimitsEnabled: (a: number, b: number, c: number) => number; +export const rawmultibodyjointset_jointLimitsMax: (a: number, b: number, c: number) => number; +export const rawmultibodyjointset_jointLimitsMin: (a: number, b: number, c: number) => number; +export const rawmultibodyjointset_jointSetContactsEnabled: (a: number, b: number, c: number) => void; +export const rawmultibodyjointset_jointType: (a: number, b: number) => number; +export const rawmultibodyjointset_new: () => number; +export const rawmultibodyjointset_remove: (a: number, b: number, c: number) => void; +export const rawnarrowphase_contact_pair: (a: number, b: number, c: number) => number; +export const rawnarrowphase_contact_pairs_with: (a: number, b: number, c: number) => void; +export const rawnarrowphase_intersection_pair: (a: number, b: number, c: number) => number; +export const rawnarrowphase_intersection_pairs_with: (a: number, b: number, c: number) => void; +export const rawnarrowphase_new: () => number; +export const rawphysicspipeline_is_profiler_enabled: (a: number) => number; +export const rawphysicspipeline_new: () => number; +export const rawphysicspipeline_set_profiler_enabled: (a: number, b: number) => void; +export const rawphysicspipeline_step: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void; +export const rawphysicspipeline_stepWithEvents: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void; +export const rawphysicspipeline_timing_broad_phase: (a: number) => number; +export const rawphysicspipeline_timing_ccd: (a: number) => number; +export const rawphysicspipeline_timing_ccd_broad_phase: (a: number) => number; +export const rawphysicspipeline_timing_ccd_narrow_phase: (a: number) => number; +export const rawphysicspipeline_timing_ccd_solver: (a: number) => number; +export const rawphysicspipeline_timing_ccd_toi_computation: (a: number) => number; +export const rawphysicspipeline_timing_collision_detection: (a: number) => number; +export const rawphysicspipeline_timing_island_construction: (a: number) => number; +export const rawphysicspipeline_timing_narrow_phase: (a: number) => number; +export const rawphysicspipeline_timing_solver: (a: number) => number; +export const rawphysicspipeline_timing_step: (a: number) => number; +export const rawphysicspipeline_timing_user_changes: (a: number) => number; +export const rawphysicspipeline_timing_velocity_assembly: (a: number) => number; +export const rawphysicspipeline_timing_velocity_resolution: (a: number) => number; +export const rawphysicspipeline_timing_velocity_update: (a: number) => number; +export const rawphysicspipeline_timing_velocity_writeback: (a: number) => number; +export const rawpidcontroller_angular_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawpidcontroller_apply_angular_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const rawpidcontroller_apply_linear_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const rawpidcontroller_linear_correction: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawpidcontroller_new: (a: number, b: number, c: number, d: number) => number; +export const rawpidcontroller_reset_integrals: (a: number) => void; +export const rawpidcontroller_set_axes_mask: (a: number, b: number) => void; +export const rawpidcontroller_set_kd: (a: number, b: number, c: number) => void; +export const rawpidcontroller_set_ki: (a: number, b: number, c: number) => void; +export const rawpidcontroller_set_kp: (a: number, b: number, c: number) => void; +export const rawpointcolliderprojection_colliderHandle: (a: number) => number; +export const rawpointcolliderprojection_featureId: (a: number) => number; +export const rawpointcolliderprojection_featureType: (a: number) => number; +export const rawpointcolliderprojection_isInside: (a: number) => number; +export const rawpointcolliderprojection_point: (a: number) => number; +export const rawpointprojection_isInside: (a: number) => number; +export const rawpointprojection_point: (a: number) => number; +export const rawrigidbodyset_contains: (a: number, b: number) => number; +export const rawrigidbodyset_createRigidBody: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number) => number; +export const rawrigidbodyset_forEachRigidBodyHandle: (a: number, b: number) => void; +export const rawrigidbodyset_len: (a: number) => number; +export const rawrigidbodyset_new: () => number; +export const rawrigidbodyset_propagateModifiedBodyPositionsToColliders: (a: number, b: number) => void; +export const rawrigidbodyset_rbAddForce: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbAddForceAtPoint: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawrigidbodyset_rbAddTorque: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbAdditionalSolverIterations: (a: number, b: number) => number; +export const rawrigidbodyset_rbAngularDamping: (a: number, b: number) => number; +export const rawrigidbodyset_rbAngvel: (a: number, b: number) => number; +export const rawrigidbodyset_rbApplyImpulse: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbApplyImpulseAtPoint: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawrigidbodyset_rbApplyTorqueImpulse: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbBodyType: (a: number, b: number) => number; +export const rawrigidbodyset_rbCollider: (a: number, b: number, c: number) => number; +export const rawrigidbodyset_rbDominanceGroup: (a: number, b: number) => number; +export const rawrigidbodyset_rbEffectiveAngularInertia: (a: number, b: number) => number; +export const rawrigidbodyset_rbEffectiveInvMass: (a: number, b: number) => number; +export const rawrigidbodyset_rbEffectiveWorldInvInertia: (a: number, b: number) => number; +export const rawrigidbodyset_rbEnableCcd: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbGravityScale: (a: number, b: number) => number; +export const rawrigidbodyset_rbInvMass: (a: number, b: number) => number; +export const rawrigidbodyset_rbInvPrincipalInertia: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsCcdEnabled: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsDynamic: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsEnabled: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsFixed: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsKinematic: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsMoving: (a: number, b: number) => number; +export const rawrigidbodyset_rbIsSleeping: (a: number, b: number) => number; +export const rawrigidbodyset_rbLinearDamping: (a: number, b: number) => number; +export const rawrigidbodyset_rbLinvel: (a: number, b: number) => number; +export const rawrigidbodyset_rbLocalCom: (a: number, b: number) => number; +export const rawrigidbodyset_rbLockRotations: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbLockTranslations: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbMass: (a: number, b: number) => number; +export const rawrigidbodyset_rbNextRotation: (a: number, b: number) => number; +export const rawrigidbodyset_rbNextTranslation: (a: number, b: number) => number; +export const rawrigidbodyset_rbNumColliders: (a: number, b: number) => number; +export const rawrigidbodyset_rbPrincipalInertia: (a: number, b: number) => number; +export const rawrigidbodyset_rbRecomputeMassPropertiesFromColliders: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbResetForces: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbResetTorques: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbRotation: (a: number, b: number) => number; +export const rawrigidbodyset_rbSetAdditionalMass: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetAdditionalMassProperties: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const rawrigidbodyset_rbSetAdditionalSolverIterations: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetAngularDamping: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetAngvel: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetBodyType: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetDominanceGroup: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetEnabled: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetEnabledTranslations: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawrigidbodyset_rbSetGravityScale: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetLinearDamping: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetLinvel: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetNextKinematicRotation: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetNextKinematicTranslation: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetRotation: (a: number, b: number, c: number, d: number) => void; +export const rawrigidbodyset_rbSetSoftCcdPrediction: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSetTranslation: (a: number, b: number, c: number, d: number, e: number) => void; +export const rawrigidbodyset_rbSetUserData: (a: number, b: number, c: number) => void; +export const rawrigidbodyset_rbSleep: (a: number, b: number) => void; +export const rawrigidbodyset_rbSoftCcdPrediction: (a: number, b: number) => number; +export const rawrigidbodyset_rbTranslation: (a: number, b: number) => number; +export const rawrigidbodyset_rbUserData: (a: number, b: number) => number; +export const rawrigidbodyset_rbUserForce: (a: number, b: number) => number; +export const rawrigidbodyset_rbUserTorque: (a: number, b: number) => number; +export const rawrigidbodyset_rbVelocityAtPoint: (a: number, b: number, c: number) => number; +export const rawrigidbodyset_rbWakeUp: (a: number, b: number) => void; +export const rawrigidbodyset_rbWorldCom: (a: number, b: number) => number; +export const rawrigidbodyset_remove: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const rawrotation_angle: (a: number) => number; +export const rawrotation_fromAngle: (a: number) => number; +export const rawrotation_identity: () => number; +export const rawserializationpipeline_deserializeAll: (a: number, b: number) => number; +export const rawserializationpipeline_serializeAll: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number; +export const rawshape_ball: (a: number) => number; +export const rawshape_capsule: (a: number, b: number) => number; +export const rawshape_castRay: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; +export const rawshape_castRayAndGetNormal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; +export const rawshape_castShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number; +export const rawshape_contactShape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; +export const rawshape_containsPoint: (a: number, b: number, c: number, d: number) => number; +export const rawshape_convexHull: (a: number, b: number) => number; +export const rawshape_convexPolyline: (a: number, b: number) => number; +export const rawshape_cuboid: (a: number, b: number) => number; +export const rawshape_halfspace: (a: number) => number; +export const rawshape_heightfield: (a: number, b: number, c: number) => number; +export const rawshape_intersectsRay: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawshape_intersectsShape: (a: number, b: number, c: number, d: number, e: number, f: number) => number; +export const rawshape_polyline: (a: number, b: number, c: number, d: number) => number; +export const rawshape_projectPoint: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawshape_roundConvexHull: (a: number, b: number, c: number) => number; +export const rawshape_roundConvexPolyline: (a: number, b: number, c: number) => number; +export const rawshape_roundCuboid: (a: number, b: number, c: number) => number; +export const rawshape_roundTriangle: (a: number, b: number, c: number, d: number) => number; +export const rawshape_segment: (a: number, b: number) => number; +export const rawshape_triangle: (a: number, b: number, c: number) => number; +export const rawshape_trimesh: (a: number, b: number, c: number, d: number, e: number) => number; +export const rawshape_voxels: (a: number, b: number, c: number) => number; +export const rawshape_voxelsFromPoints: (a: number, b: number, c: number) => number; +export const rawshapecasthit_witness1: (a: number) => number; +export const rawvector_new: (a: number, b: number) => number; +export const rawvector_set_y: (a: number, b: number) => void; +export const rawvector_xy: (a: number) => number; +export const rawvector_yx: (a: number) => number; +export const rawvector_zero: () => number; +export const version: (a: number) => void; +export const rawcolliderset_isHandleValid: (a: number, b: number) => number; +export const rawvector_set_x: (a: number, b: number) => void; +export const reserve_memory: (a: number) => void; +export const rawraycolliderintersection_featureId: (a: number) => number; +export const rawrayintersection_featureId: (a: number) => number; +export const rawcontactforceevent_collider1: (a: number) => number; +export const rawintegrationparameters_normalizedAllowedLinearError: (a: number) => number; +export const rawintegrationparameters_normalizedPredictionDistance: (a: number) => number; +export const rawraycolliderhit_colliderHandle: (a: number) => number; +export const rawraycolliderhit_timeOfImpact: (a: number) => number; +export const rawraycolliderintersection_colliderHandle: (a: number) => number; +export const rawraycolliderintersection_featureType: (a: number) => number; +export const rawraycolliderintersection_time_of_impact: (a: number) => number; +export const rawrayintersection_featureType: (a: number) => number; +export const rawrayintersection_time_of_impact: (a: number) => number; +export const rawrotation_im: (a: number) => number; +export const rawrotation_re: (a: number) => number; +export const rawshapecasthit_time_of_impact: (a: number) => number; +export const rawshapecontact_distance: (a: number) => number; +export const rawvector_x: (a: number) => number; +export const rawvector_y: (a: number) => number; +export const __wbg_rawcontactpair_free: (a: number, b: number) => void; +export const __wbg_rawraycolliderhit_free: (a: number, b: number) => void; +export const __wbg_rawraycolliderintersection_free: (a: number, b: number) => void; +export const __wbg_rawserializationpipeline_free: (a: number, b: number) => void; +export const __wbg_rawshapecasthit_free: (a: number, b: number) => void; +export const rawcontactforceevent_max_force_direction: (a: number) => number; +export const rawkinematiccharactercontroller_up: (a: number) => number; +export const rawraycolliderintersection_normal: (a: number) => number; +export const rawrayintersection_normal: (a: number) => number; +export const rawshapecasthit_normal1: (a: number) => number; +export const rawshapecasthit_normal2: (a: number) => number; +export const rawshapecasthit_witness2: (a: number) => number; +export const rawshapecontact_normal1: (a: number) => number; +export const rawshapecontact_normal2: (a: number) => number; +export const rawshapecontact_point1: (a: number) => number; +export const rawshapecontact_point2: (a: number) => number; +export const rawccdsolver_new: () => number; +export const rawserializationpipeline_new: () => number; +export const __wbindgen_export_0: (a: number) => void; +export const __wbindgen_add_to_stack_pointer: (a: number) => number; +export const __wbindgen_export_1: (a: number, b: number, c: number) => void; +export const __wbindgen_export_2: (a: number, b: number) => number;