@dimforge/rapier3d-compat
Advanced tools
Comparing version 0.0.0-b0953bc-20220604 to 0.0.0-b654cd5-20220809
@@ -65,3 +65,3 @@ import { Rotation, Vector } from "../math"; | ||
* | ||
* The first anchor gives the position of the points application point on the | ||
* The first anchor gives the position of the application point on the | ||
* local frame of the first rigid-body it is attached to. | ||
@@ -73,6 +73,30 @@ */ | ||
* | ||
* The second anchor gives the position of the points application point on the | ||
* The second anchor gives the position of the application point on the | ||
* local frame of the second rigid-body it is attached to. | ||
*/ | ||
anchor2(): Vector; | ||
/** | ||
* Sets the position of the first anchor of this joint. | ||
* | ||
* The first anchor gives the position of the application point on the | ||
* local frame of the first rigid-body it is attached to. | ||
*/ | ||
setAnchor1(newPos: Vector): void; | ||
/** | ||
* Sets the position of the second anchor of this joint. | ||
* | ||
* The second anchor gives the position of the application point on the | ||
* local frame of the second rigid-body it is attached to. | ||
*/ | ||
setAnchor2(newPos: Vector): void; | ||
/** | ||
* Controls whether contacts are computed between colliders attached | ||
* to the rigid-bodies linked by this joint. | ||
*/ | ||
setContactsEnabled(enabled: boolean): void; | ||
/** | ||
* Indicates if contacts are enabled between colliders attached | ||
* to the rigid-bodies linked by this joint. | ||
*/ | ||
contactsEnabled(): boolean; | ||
} | ||
@@ -96,2 +120,9 @@ export declare class UnitImpulseJoint extends ImpulseJoint { | ||
limitsMax(): number; | ||
/** | ||
* Sets the limits of this joint. | ||
* | ||
* @param min - The minimum bound of this joint’s free coordinate. | ||
* @param max - The maximum bound of this joint’s free coordinate. | ||
*/ | ||
setLimits(min: number, max: number): void; | ||
configureMotorModel(model: MotorModel): void; | ||
@@ -98,0 +129,0 @@ configureMotorVelocity(targetVel: number, factor: number): void; |
@@ -16,2 +16,12 @@ import { RawJointAxis, RawMultibodyJointSet } from "../raw"; | ||
isValid(): boolean; | ||
/** | ||
* Controls whether contacts are computed between colliders attached | ||
* to the rigid-bodies linked by this joint. | ||
*/ | ||
setContactsEnabled(enabled: boolean): void; | ||
/** | ||
* Indicates if contacts are enabled between colliders attached | ||
* to the rigid-bodies linked by this joint. | ||
*/ | ||
contactsEnabled(): boolean; | ||
} | ||
@@ -18,0 +28,0 @@ export declare class UnitMultibodyJoint extends MultibodyJoint { |
@@ -80,2 +80,12 @@ import { RawRigidBodySet } from "../raw"; | ||
*/ | ||
setEnabledTranslations(enableX: boolean, enableY: boolean, enableZ: boolean, wakeUp: boolean): void; | ||
/** | ||
* Locks or unlocks the ability of this rigid-body to translate along individual coordinate axes. | ||
* | ||
* @param enableX - If `false`, this rigid-body will no longer translate due to torques and impulses, along the X coordinate axis. | ||
* @param enableY - If `false`, this rigid-body will no longer translate due to torques and impulses, along the Y coordinate axis. | ||
* @param enableZ - If `false`, this rigid-body will no longer translate due to torques and impulses, along the Z coordinate axis. | ||
* @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep. | ||
* @deprecated use `this.setEnabledTranslations` with the same arguments instead. | ||
*/ | ||
restrictTranslations(enableX: boolean, enableY: boolean, enableZ: boolean, wakeUp: boolean): void; | ||
@@ -90,2 +100,12 @@ /** | ||
*/ | ||
setEnabledRotations(enableX: boolean, enableY: boolean, enableZ: boolean, wakeUp: boolean): void; | ||
/** | ||
* Locks or unlocks the ability of this rigid-body to rotate along individual coordinate axes. | ||
* | ||
* @param enableX - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis. | ||
* @param enableY - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis. | ||
* @param enableZ - If `false`, this rigid-body will no longer rotate due to torques and impulses, along the Z coordinate axis. | ||
* @param wakeUp - If `true`, this rigid-body will be automatically awaken if it is currently asleep. | ||
* @deprecated use `this.setEnabledRotations` with the same arguments instead. | ||
*/ | ||
restrictRotations(enableX: boolean, enableY: boolean, enableZ: boolean, wakeUp: boolean): void; | ||
@@ -290,2 +310,43 @@ /** | ||
/** | ||
* Recompute the mass-properties of this rigid-bodies based on its currently attached colliders. | ||
*/ | ||
recomputeMassPropertiesFromColliders(): void; | ||
/** | ||
* Sets the rigid-body's additional mass. | ||
* | ||
* The total angular inertia of the rigid-body will be scaled automatically based on this additional mass. If this | ||
* scaling effect isn’t desired, use Self::additional_mass_properties instead of this method. | ||
* | ||
* This is only the "additional" mass because the total mass of the rigid-body is equal to the sum of this | ||
* additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body. | ||
* | ||
* That total mass (which includes the attached colliders’ contributions) will be updated at the name physics step, | ||
* or can be updated manually with `this.recomputeMassPropertiesFromColliders`. | ||
* | ||
* This will override any previous additional mass-properties set by `this.setAdditionalMass`, | ||
* `this.setAdditionalMassProperties`, `RigidBodyDesc::setAdditionalMass`, or | ||
* `RigidBodyDesc.setAdditionalMassfProperties` for this rigid-body. | ||
* | ||
* @param mass - The additional mass to set. | ||
* @param wakeUp - If `true` then the rigid-body will be woken up if it was put to sleep because it did not move for a while. | ||
*/ | ||
setAdditionalMass(mass: number, wakeUp: boolean): void; | ||
/** | ||
* Sets the rigid-body's additional mass-properties. | ||
* | ||
* This is only the "additional" mass-properties because the total mass-properties of the rigid-body is equal to the | ||
* sum of this additional mass-properties and the mass computed from the colliders (with non-zero densities) attached | ||
* to this rigid-body. | ||
* | ||
* That total mass-properties (which include the attached colliders’ contributions) will be updated at the name | ||
* physics step, or can be updated manually with `this.recomputeMassPropertiesFromColliders`. | ||
* | ||
* This will override any previous mass-properties set by `this.setAdditionalMass`, | ||
* `this.setAdditionalMassProperties`, `RigidBodyDesc.setAdditionalMass`, or `RigidBodyDesc.setAdditionalMassProperties` | ||
* for this rigid-body. | ||
* | ||
* If `wake_up` is true then the rigid-body will be woken up if it was put to sleep because it did not move for a while. | ||
*/ | ||
setAdditionalMassProperties(mass: number, centerOfMass: Vector, principalAngularInertia: Vector, angularInertiaLocalFrame: Rotation, wakeUp: boolean): void; | ||
/** | ||
* Sets the linear damping factor applied to this rigid-body. | ||
@@ -358,2 +419,3 @@ * | ||
mass: number; | ||
massOnly: boolean; | ||
centerOfMass: Vector; | ||
@@ -481,7 +543,8 @@ translationsEnabledX: boolean; | ||
/** | ||
* Sets the mass properties of the rigid-body being built. | ||
* | ||
* @param principalAngularInertia − The initial principal angular inertia of the rigid-body to create. | ||
* Allow translation of this rigid-body only along specific axes. | ||
* @param translationsEnabledX - Are translations along the X axis enabled? | ||
* @param translationsEnabledY - Are translations along the y axis enabled? | ||
* @param translationsEnabledZ - Are translations along the Z axis enabled? | ||
*/ | ||
setAdditionalPrincipalAngularInertia(principalAngularInertia: Vector): RigidBodyDesc; | ||
enabledTranslations(translationsEnabledX: boolean, translationsEnabledY: boolean, translationsEnabledZ: boolean): RigidBodyDesc; | ||
/** | ||
@@ -492,2 +555,3 @@ * Allow translation of this rigid-body only along specific axes. | ||
* @param translationsEnabledZ - Are translations along the Z axis enabled? | ||
* @deprecated use `this.enabledTranslations` with the same arguments instead. | ||
*/ | ||
@@ -506,2 +570,10 @@ restrictTranslations(translationsEnabledX: boolean, translationsEnabledY: boolean, translationsEnabledZ: boolean): RigidBodyDesc; | ||
*/ | ||
enabledRotations(rotationsEnabledX: boolean, rotationsEnabledY: boolean, rotationsEnabledZ: boolean): RigidBodyDesc; | ||
/** | ||
* Allow rotation of this rigid-body only along specific axes. | ||
* @param rotationsEnabledX - Are rotations along the X axis enabled? | ||
* @param rotationsEnabledY - Are rotations along the y axis enabled? | ||
* @param rotationsEnabledZ - Are rotations along the Z axis enabled? | ||
* @deprecated use `this.enabledRotations` with the same arguments instead. | ||
*/ | ||
restrictRotations(rotationsEnabledX: boolean, rotationsEnabledY: boolean, rotationsEnabledZ: boolean): RigidBodyDesc; | ||
@@ -508,0 +580,0 @@ /** |
@@ -11,10 +11,46 @@ import { Rotation, Vector } from "../math"; | ||
import { ColliderSet } from "./collider_set"; | ||
/** | ||
* Flags affecting whether collision-detection happens between two colliders | ||
* depending on the type of rigid-bodies they are attached to. | ||
*/ | ||
export declare enum ActiveCollisionTypes { | ||
/** | ||
* Enable collision-detection between a collider attached to a dynamic body | ||
* and another collider attached to a dynamic body. | ||
*/ | ||
DYNAMIC_DYNAMIC = 1, | ||
/** | ||
* Enable collision-detection between a collider attached to a dynamic body | ||
* and another collider attached to a kinematic body. | ||
*/ | ||
DYNAMIC_KINEMATIC = 12, | ||
/** | ||
* Enable collision-detection between a collider attached to a dynamic body | ||
* and another collider attached to a fixed body (or not attached to any body). | ||
*/ | ||
DYNAMIC_FIXED = 2, | ||
/** | ||
* Enable collision-detection between a collider attached to a kinematic body | ||
* and another collider attached to a kinematic body. | ||
*/ | ||
KINEMATIC_KINEMATIC = 52224, | ||
/** | ||
* Enable collision-detection between a collider attached to a kinematic body | ||
* and another collider attached to a fixed body (or not attached to any body). | ||
*/ | ||
KINEMATIC_FIXED = 8704, | ||
/** | ||
* Enable collision-detection between a collider attached to a fixed body (or | ||
* not attached to any body) and another collider attached to a fixed body (or | ||
* not attached to any body). | ||
*/ | ||
FIXED_FIXED = 32, | ||
/** | ||
* The default active collision types, enabling collisions between a dynamic body | ||
* and another body of any type, but not enabling collisions between two non-dynamic bodies. | ||
*/ | ||
DEFAULT = 15, | ||
/** | ||
* Enable collisions between any kind of rigid-bodies (including between two non-dynamic bodies). | ||
*/ | ||
ALL = 60943 | ||
@@ -158,2 +194,12 @@ } | ||
/** | ||
* Sets the total force magnitude beyond which a contact force event can be emitted. | ||
* | ||
* @param threshold - The new force threshold. | ||
*/ | ||
setContactForceEventThreshold(threshold: number): void; | ||
/** | ||
* The total force magnitude beyond which a contact force event can be emitted. | ||
*/ | ||
contactForceEventThreshold(): number; | ||
/** | ||
* Set the collision types active for this collider. | ||
@@ -165,2 +211,32 @@ * | ||
/** | ||
* Sets the uniform density of this collider. | ||
* | ||
* This will override any previous mass-properties set by `this.setDensity`, | ||
* `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`, | ||
* `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider. | ||
* | ||
* The mass and angular inertia of this collider will be computed automatically based on its | ||
* shape. | ||
*/ | ||
setDensity(density: number): void; | ||
/** | ||
* Sets the mass of this collider. | ||
* | ||
* This will override any previous mass-properties set by `this.setDensity`, | ||
* `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`, | ||
* `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider. | ||
* | ||
* The angular inertia of this collider will be computed automatically based on its shape | ||
* and this mass value. | ||
*/ | ||
setMass(mass: number): void; | ||
/** | ||
* Sets the mass of this collider. | ||
* | ||
* This will override any previous mass-properties set by `this.setDensity`, | ||
* `this.setMass`, `this.setMassProperties`, `ColliderDesc.density`, | ||
* `ColliderDesc.mass`, or `ColliderDesc.massProperties` for this collider. | ||
*/ | ||
setMassProperties(mass: number, centerOfMass: Vector, principalAngularInertia: Vector, angularInertiaLocalFrame: Rotation): void; | ||
/** | ||
* Sets the translation of this collider. | ||
@@ -275,2 +351,10 @@ * | ||
/** | ||
* The mass of this collider. | ||
*/ | ||
mass(): number; | ||
/** | ||
* The volume of this collider. | ||
*/ | ||
volume(): number; | ||
/** | ||
* The collision groups of this collider. | ||
@@ -343,5 +427,10 @@ */ | ||
} | ||
export declare enum MassPropsMode { | ||
Density = 0, | ||
Mass = 1, | ||
MassProps = 2 | ||
} | ||
export declare class ColliderDesc { | ||
shape: Shape; | ||
useMassProps: boolean; | ||
massPropsMode: MassPropsMode; | ||
mass: number; | ||
@@ -364,2 +453,3 @@ centerOfMass: Vector; | ||
activeCollisionTypes: ActiveCollisionTypes; | ||
contactForceEventThreshold: number; | ||
/** | ||
@@ -528,8 +618,10 @@ * Initializes a collider descriptor from the collision shape. | ||
* | ||
* @param is - Set to `true` of the collider built is to be a sensor. | ||
* @param sensor - Set to `true` of the collider built is to be a sensor. | ||
*/ | ||
setSensor(is: boolean): ColliderDesc; | ||
setSensor(sensor: boolean): ColliderDesc; | ||
/** | ||
* Sets the density of the collider being built. | ||
* | ||
* The mass and angular inertia tensor will be computed automatically based on this density and the collider’s shape. | ||
* | ||
* @param density - The density to set, must be greater or equal to 0. A density of 0 means that this collider | ||
@@ -540,2 +632,10 @@ * will not affect the mass or angular inertia of the rigid-body it is attached to. | ||
/** | ||
* Sets the mass of the collider being built. | ||
* | ||
* The angular inertia tensor will be computed automatically based on this mass and the collider’s shape. | ||
* | ||
* @param mass - The mass to set, must be greater or equal to 0. | ||
*/ | ||
setMass(mass: number): ColliderDesc; | ||
/** | ||
* Sets the mass properties of the collider being built. | ||
@@ -625,2 +725,8 @@ * | ||
setActiveCollisionTypes(activeCollisionTypes: ActiveCollisionTypes): ColliderDesc; | ||
/** | ||
* Sets the total force magnitude beyond which a contact force event can be emitted. | ||
* | ||
* @param threshold - The force threshold to set. | ||
*/ | ||
setContactForceEventThreshold(threshold: number): ColliderDesc; | ||
} |
@@ -21,2 +21,3 @@ import { RawVector, RawRotation } from "./raw"; | ||
static fromRaw(raw: RawVector): Vector; | ||
static copy(out: Vector, input: Vector): void; | ||
} | ||
@@ -43,2 +44,3 @@ export interface Rotation { | ||
static intoRaw(rot: Rotation): RawRotation; | ||
static copy(out: Rotation, input: Rotation): void; | ||
} |
@@ -7,3 +7,3 @@ { | ||
"description": "3-dimensional physics engine in Rust - official JS bindings. Compatibility package with inlined webassembly as base64.", | ||
"version": "0.0.0-b0953bc-20220604", | ||
"version": "0.0.0-b654cd5-20220809", | ||
"license": "Apache-2.0", | ||
@@ -10,0 +10,0 @@ "repository": { |
@@ -1,7 +0,57 @@ | ||
import { RawEventQueue } from "../raw"; | ||
import { RawContactForceEvent, RawEventQueue } from "../raw"; | ||
import { ColliderHandle } from "../geometry"; | ||
import { Vector } from "../math"; | ||
/** | ||
* Flags indicating what events are enabled for colliders. | ||
*/ | ||
export declare enum ActiveEvents { | ||
COLLISION_EVENTS = 1 | ||
/** | ||
* Enable collision events. | ||
*/ | ||
COLLISION_EVENTS = 1, | ||
/** | ||
* Enable contact force events. | ||
*/ | ||
CONTACT_FORCE_EVENTS = 2 | ||
} | ||
/** | ||
* Event occurring when the sum of the magnitudes of the | ||
* contact forces between two colliders exceed a threshold. | ||
* | ||
* This object should **not** be stored anywhere. Its properties can only be | ||
* read from within the closure given to `EventHandler.drainContactForceEvents`. | ||
*/ | ||
export declare class TempContactForceEvent { | ||
raw: RawContactForceEvent; | ||
free(): void; | ||
/** | ||
* The first collider involved in the contact. | ||
*/ | ||
collider1(): ColliderHandle; | ||
/** | ||
* The second collider involved in the contact. | ||
*/ | ||
collider2(): ColliderHandle; | ||
/** | ||
* The sum of all the forces between the two colliders. | ||
*/ | ||
totalForce(): Vector; | ||
/** | ||
* 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. | ||
*/ | ||
totalForceMagnitude(): number; | ||
/** | ||
* The world-space (unit) direction of the force with strongest magnitude. | ||
*/ | ||
maxForceDirection(): Vector; | ||
/** | ||
* The magnitude of the largest force at a contact point of this contact pair. | ||
*/ | ||
maxForceMagnitude(): number; | ||
} | ||
/** | ||
* A structure responsible for collecting events generated | ||
@@ -39,2 +89,10 @@ * by the physics engine. | ||
/** | ||
* Applies the given javascript closure on each contact force event of this collector, then clear | ||
* the internal collision event buffer. | ||
* | ||
* @param f - JavaScript closure applied to each collision event. The | ||
* closure must take one `TempContactForceEvent` argument. | ||
*/ | ||
drainContactForceEvents(f: (event: TempContactForceEvent) => void): void; | ||
/** | ||
* Removes all events contained by this collector | ||
@@ -41,0 +99,0 @@ */ |
@@ -7,1 +7,2 @@ export * from "./world"; | ||
export * from "./debug_render_pipeline"; | ||
export * from "./query_pipeline"; |
import { RawQueryPipeline } from "../raw"; | ||
import { ColliderHandle, ColliderSet, InteractionGroups, PointColliderProjection, Ray, RayColliderIntersection, RayColliderToi, Shape, ShapeColliderTOI } from "../geometry"; | ||
import { IslandManager, RigidBodySet } from "../dynamics"; | ||
import { IslandManager, RigidBodyHandle, RigidBodySet } from "../dynamics"; | ||
import { Rotation, Vector } from "../math"; | ||
/** | ||
* Flags for excluding whole sets of colliders from a scene query. | ||
*/ | ||
export declare enum QueryFilterFlags { | ||
/** | ||
* Exclude from the query any collider attached to a fixed rigid-body and colliders with no rigid-body attached. | ||
*/ | ||
EXCLUDE_FIXED = 1, | ||
/** | ||
* Exclude from the query any collider attached to a dynamic rigid-body. | ||
*/ | ||
EXCLUDE_KINEMATIC = 2, | ||
/** | ||
* Exclude from the query any collider attached to a kinematic rigid-body. | ||
*/ | ||
EXCLUDE_DYNAMIC = 4, | ||
/** | ||
* Exclude from the query any collider that is a sensor. | ||
*/ | ||
EXCLUDE_SENSORS = 8, | ||
/** | ||
* Exclude from the query any collider that is not a sensor. | ||
*/ | ||
EXCLUDE_SOLIDS = 16, | ||
/** | ||
* Excludes all colliders not attached to a dynamic rigid-body. | ||
*/ | ||
ONLY_DYNAMIC = 3, | ||
/** | ||
* Excludes all colliders not attached to a kinematic rigid-body. | ||
*/ | ||
ONLY_KINEMATIC = 5, | ||
/** | ||
* Exclude all colliders attached to a non-fixed rigid-body | ||
* (this will not exclude colliders not attached to any rigid-body). | ||
*/ | ||
ONLY_FIXED = 6 | ||
} | ||
/** | ||
* A pipeline for performing queries on all the colliders of a scene. | ||
@@ -37,3 +75,3 @@ * | ||
*/ | ||
castRay(colliders: ColliderSet, ray: Ray, maxToi: number, solid: boolean, groups: InteractionGroups, filter?: (collider: ColliderHandle) => boolean): RayColliderToi | null; | ||
castRay(bodies: RigidBodySet, colliders: ColliderSet, ray: Ray, maxToi: number, solid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): RayColliderToi | null; | ||
/** | ||
@@ -52,3 +90,3 @@ * Find the closest intersection between a ray and a set of collider. | ||
*/ | ||
castRayAndGetNormal(colliders: ColliderSet, ray: Ray, maxToi: number, solid: boolean, groups: InteractionGroups, filter?: (collider: ColliderHandle) => boolean): RayColliderIntersection | null; | ||
castRayAndGetNormal(bodies: RigidBodySet, colliders: ColliderSet, ray: Ray, maxToi: number, solid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): RayColliderIntersection | null; | ||
/** | ||
@@ -68,3 +106,3 @@ * Cast a ray and collects all the intersections between a ray and the scene. | ||
*/ | ||
intersectionsWithRay(colliders: ColliderSet, ray: Ray, maxToi: number, solid: boolean, groups: InteractionGroups, callback: (intersect: RayColliderIntersection) => boolean, filter?: (collider: ColliderHandle) => boolean): void; | ||
intersectionsWithRay(bodies: RigidBodySet, colliders: ColliderSet, ray: Ray, maxToi: number, solid: boolean, callback: (intersect: RayColliderIntersection) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): void; | ||
/** | ||
@@ -80,3 +118,3 @@ * Gets the handle of up to one collider intersecting the given shape. | ||
*/ | ||
intersectionWithShape(colliders: ColliderSet, shapePos: Vector, shapeRot: Rotation, shape: Shape, groups: InteractionGroups, filter?: (collider: ColliderHandle) => boolean): ColliderHandle | null; | ||
intersectionWithShape(bodies: RigidBodySet, colliders: ColliderSet, shapePos: Vector, shapeRot: Rotation, shape: Shape, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): ColliderHandle | null; | ||
/** | ||
@@ -95,3 +133,3 @@ * Find the projection of a point on the closest collider. | ||
*/ | ||
projectPoint(colliders: ColliderSet, point: Vector, solid: boolean, groups: InteractionGroups, filter?: (collider: ColliderHandle) => boolean): PointColliderProjection | null; | ||
projectPoint(bodies: RigidBodySet, colliders: ColliderSet, point: Vector, solid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): PointColliderProjection | null; | ||
/** | ||
@@ -105,3 +143,3 @@ * Find the projection of a point on the closest collider. | ||
*/ | ||
projectPointAndGetFeature(colliders: ColliderSet, point: Vector, groups: InteractionGroups): PointColliderProjection | null; | ||
projectPointAndGetFeature(bodies: RigidBodySet, colliders: ColliderSet, point: Vector, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): PointColliderProjection | null; | ||
/** | ||
@@ -117,3 +155,3 @@ * Find all the colliders containing the given point. | ||
*/ | ||
intersectionsWithPoint(colliders: ColliderSet, point: Vector, groups: InteractionGroups, callback: (handle: ColliderHandle) => boolean, filter?: (collider: ColliderHandle) => boolean): void; | ||
intersectionsWithPoint(bodies: RigidBodySet, colliders: ColliderSet, point: Vector, callback: (handle: ColliderHandle) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): void; | ||
/** | ||
@@ -134,3 +172,3 @@ * Casts a shape at a constant linear velocity and retrieve the first collider it hits. | ||
*/ | ||
castShape(colliders: ColliderSet, shapePos: Vector, shapeRot: Rotation, shapeVel: Vector, shape: Shape, maxToi: number, groups: InteractionGroups, filter?: (collider: ColliderHandle) => boolean): ShapeColliderTOI | null; | ||
castShape(bodies: RigidBodySet, colliders: ColliderSet, shapePos: Vector, shapeRot: Rotation, shapeVel: Vector, shape: Shape, maxToi: number, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): ShapeColliderTOI | null; | ||
/** | ||
@@ -147,3 +185,3 @@ * Retrieve all the colliders intersecting the given shape. | ||
*/ | ||
intersectionsWithShape(colliders: ColliderSet, shapePos: Vector, shapeRot: Rotation, shape: Shape, groups: InteractionGroups, callback: (handle: ColliderHandle) => boolean, filter?: (collider: ColliderHandle) => boolean): void; | ||
intersectionsWithShape(bodies: RigidBodySet, colliders: ColliderSet, shapePos: Vector, shapeRot: Rotation, shape: Shape, callback: (handle: ColliderHandle) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: ColliderHandle, filterExcludeRigidBody?: RigidBodyHandle, filterPredicate?: (collider: ColliderHandle) => boolean): void; | ||
/** | ||
@@ -150,0 +188,0 @@ * Finds the handles of all the colliders with an AABB intersecting the given AABB. |
@@ -6,3 +6,3 @@ import { RawBroadPhase, RawCCDSolver, RawColliderSet, RawDeserializedWorld, RawIntegrationParameters, RawIslandManager, RawImpulseJointSet, RawMultibodyJointSet, RawNarrowPhase, RawPhysicsPipeline, RawQueryPipeline, RawRigidBodySet, RawSerializationPipeline, RawDebugRenderPipeline } from "../raw"; | ||
import { PhysicsPipeline } from "./physics_pipeline"; | ||
import { QueryPipeline } from "./query_pipeline"; | ||
import { QueryFilterFlags, QueryPipeline } from "./query_pipeline"; | ||
import { SerializationPipeline } from "./serialization_pipeline"; | ||
@@ -241,3 +241,3 @@ import { EventQueue } from "./event_queue"; | ||
*/ | ||
castRay(ray: Ray, maxToi: number, solid: boolean, groups: InteractionGroups, filter?: (collider: Collider) => boolean): RayColliderToi | null; | ||
castRay(ray: Ray, maxToi: number, solid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): RayColliderToi | null; | ||
/** | ||
@@ -255,3 +255,3 @@ * Find the closest intersection between a ray and the physics world. | ||
*/ | ||
castRayAndGetNormal(ray: Ray, maxToi: number, solid: boolean, groups: InteractionGroups, filter?: (collider: Collider) => boolean): RayColliderIntersection | null; | ||
castRayAndGetNormal(ray: Ray, maxToi: number, solid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): RayColliderIntersection | null; | ||
/** | ||
@@ -270,3 +270,3 @@ * Cast a ray and collects all the intersections between a ray and the scene. | ||
*/ | ||
intersectionsWithRay(ray: Ray, maxToi: number, solid: boolean, groups: InteractionGroups, callback: (intersect: RayColliderIntersection) => boolean, filter?: (collider: Collider) => boolean): void; | ||
intersectionsWithRay(ray: Ray, maxToi: number, solid: boolean, callback: (intersect: RayColliderIntersection) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): void; | ||
/** | ||
@@ -281,3 +281,3 @@ * Gets the handle of up to one collider intersecting the given shape. | ||
*/ | ||
intersectionWithShape(shapePos: Vector, shapeRot: Rotation, shape: Shape, groups: InteractionGroups, filter?: (collider: Collider) => boolean): Collider | null; | ||
intersectionWithShape(shapePos: Vector, shapeRot: Rotation, shape: Shape, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): Collider | null; | ||
/** | ||
@@ -295,3 +295,3 @@ * Find the projection of a point on the closest collider. | ||
*/ | ||
projectPoint(point: Vector, solid: boolean, groups: InteractionGroups, filter?: (collider: Collider) => boolean): PointColliderProjection | null; | ||
projectPoint(point: Vector, solid: boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): PointColliderProjection | null; | ||
/** | ||
@@ -304,3 +304,3 @@ * Find the projection of a point on the closest collider. | ||
*/ | ||
projectPointAndGetFeature(point: Vector, groups: InteractionGroups): PointColliderProjection | null; | ||
projectPointAndGetFeature(point: Vector, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): PointColliderProjection | null; | ||
/** | ||
@@ -315,3 +315,3 @@ * Find all the colliders containing the given point. | ||
*/ | ||
intersectionsWithPoint(point: Vector, groups: InteractionGroups, callback: (handle: Collider) => boolean, filter?: (collider: Collider) => boolean): void; | ||
intersectionsWithPoint(point: Vector, callback: (handle: Collider) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): void; | ||
/** | ||
@@ -331,3 +331,3 @@ * Casts a shape at a constant linear velocity and retrieve the first collider it hits. | ||
*/ | ||
castShape(shapePos: Vector, shapeRot: Rotation, shapeVel: Vector, shape: Shape, maxToi: number, groups: InteractionGroups, filter?: (collider: Collider) => boolean): ShapeColliderTOI | null; | ||
castShape(shapePos: Vector, shapeRot: Rotation, shapeVel: Vector, shape: Shape, maxToi: number, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): ShapeColliderTOI | null; | ||
/** | ||
@@ -343,3 +343,3 @@ * Retrieve all the colliders intersecting the given shape. | ||
*/ | ||
intersectionsWithShape(shapePos: Vector, shapeRot: Rotation, shape: Shape, groups: InteractionGroups, callback: (handle: Collider) => boolean, filter?: (collider: Collider) => boolean): void; | ||
intersectionsWithShape(shapePos: Vector, shapeRot: Rotation, shape: Shape, callback: (collider: Collider) => boolean, filterFlags?: QueryFilterFlags, filterGroups?: InteractionGroups, filterExcludeCollider?: Collider, filterExcludeRigidBody?: RigidBody, filterPredicate?: (collider: Collider) => boolean): void; | ||
/** | ||
@@ -346,0 +346,0 @@ * Finds the handles of all the colliders with an AABB intersecting the given AABB. |
@@ -14,5 +14,10 @@ /* tslint:disable */ | ||
export function rawimpulsejointset_jointAnchor2(a: number, b: number): number; | ||
export function rawimpulsejointset_jointSetAnchor1(a: number, b: number, c: number): void; | ||
export function rawimpulsejointset_jointSetAnchor2(a: number, b: number, c: number): void; | ||
export function rawimpulsejointset_jointContactsEnabled(a: number, b: number): number; | ||
export function rawimpulsejointset_jointSetContactsEnabled(a: number, b: number, c: number): void; | ||
export function rawimpulsejointset_jointLimitsEnabled(a: number, b: number, c: number): number; | ||
export function rawimpulsejointset_jointLimitsMin(a: number, b: number, c: number): number; | ||
export function rawimpulsejointset_jointLimitsMax(a: number, b: number, c: number): number; | ||
export function rawimpulsejointset_jointSetLimits(a: number, b: number, c: number, d: number, e: number): void; | ||
export function rawimpulsejointset_jointConfigureMotorModel(a: number, b: number, c: number, d: number): void; | ||
@@ -63,2 +68,4 @@ export function rawimpulsejointset_jointConfigureMotorVelocity(a: number, b: number, c: number, d: number, e: number): void; | ||
export function rawmultibodyjointset_jointAnchor2(a: number, b: number): number; | ||
export function rawmultibodyjointset_jointContactsEnabled(a: number, b: number): number; | ||
export function rawmultibodyjointset_jointSetContactsEnabled(a: number, b: number, c: number): void; | ||
export function rawmultibodyjointset_jointLimitsEnabled(a: number, b: number, c: number): number; | ||
@@ -87,8 +94,11 @@ export function rawmultibodyjointset_jointLimitsMin(a: number, b: number, c: number): number; | ||
export function rawrigidbodyset_rbSetNextKinematicRotation(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(a: number, b: number, c: number): void; | ||
export function rawrigidbodyset_rbSetAdditionalMass(a: number, b: number, c: number, d: number): void; | ||
export function rawrigidbodyset_rbSetAdditionalMassProperties(a: number, b: number, c: number, d: number, e: number, f: number, g: number): void; | ||
export function rawrigidbodyset_rbLinvel(a: number, b: number): number; | ||
export function rawrigidbodyset_rbAngvel(a: number, b: number): number; | ||
export function rawrigidbodyset_rbLockTranslations(a: number, b: number, c: number, d: number): void; | ||
export function rawrigidbodyset_rbRestrictTranslations(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function rawrigidbodyset_rbSetEnabledTranslations(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function rawrigidbodyset_rbLockRotations(a: number, b: number, c: number, d: number): void; | ||
export function rawrigidbodyset_rbRestrictRotations(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function rawrigidbodyset_rbSetEnabledRotations(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function rawrigidbodyset_rbDominanceGroup(a: number, b: number): number; | ||
@@ -125,3 +135,3 @@ export function rawrigidbodyset_rbSetDominanceGroup(a: number, b: number, c: number): void; | ||
export function rawrigidbodyset_new(): number; | ||
export function 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 function 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, x: number): number; | ||
export function rawrigidbodyset_remove(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
@@ -154,3 +164,5 @@ export function rawrigidbodyset_len(a: number): number; | ||
export function rawcolliderset_coRestitution(a: number, b: number): number; | ||
export function rawcolliderset_coDensity(a: number, b: number, c: number): void; | ||
export function rawcolliderset_coDensity(a: number, b: number): number; | ||
export function rawcolliderset_coMass(a: number, b: number): number; | ||
export function rawcolliderset_coVolume(a: number, b: number): number; | ||
export function rawcolliderset_coCollisionGroups(a: number, b: number): number; | ||
@@ -161,2 +173,3 @@ export function rawcolliderset_coSolverGroups(a: number, b: number): number; | ||
export function rawcolliderset_coActiveEvents(a: number, b: number): number; | ||
export function rawcolliderset_coContactForceEventThreshold(a: number, b: number): number; | ||
export function rawcolliderset_coContainsPoint(a: number, b: number, c: number): number; | ||
@@ -185,2 +198,6 @@ export function rawcolliderset_coCastShape(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function rawcolliderset_coSetShape(a: number, b: number, c: number): void; | ||
export function rawcolliderset_coSetContactForceEventThreshold(a: number, b: number, c: number): void; | ||
export function rawcolliderset_coSetDensity(a: number, b: number, c: number): void; | ||
export function rawcolliderset_coSetMass(a: number, b: number, c: number): void; | ||
export function rawcolliderset_coSetMassProperties(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function __wbg_rawcolliderset_free(a: number): void; | ||
@@ -190,3 +207,3 @@ export function rawcolliderset_new(): number; | ||
export function rawcolliderset_contains(a: number, b: number): number; | ||
export function 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): void; | ||
export function 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): void; | ||
export function rawcolliderset_remove(a: number, b: number, c: number, d: number, e: number): void; | ||
@@ -234,3 +251,2 @@ export function rawcolliderset_forEachColliderHandle(a: number, b: number): void; | ||
export function __wbg_rawpointcolliderprojection_free(a: number): void; | ||
export function rawpointcolliderprojection_colliderHandle(a: number): number; | ||
export function rawpointcolliderprojection_point(a: number): number; | ||
@@ -301,4 +317,12 @@ export function rawpointcolliderprojection_isInside(a: number): number; | ||
export function __wbg_raweventqueue_free(a: number): void; | ||
export function __wbg_rawcontactforceevent_free(a: number): void; | ||
export function rawcontactforceevent_collider1(a: number): number; | ||
export function rawcontactforceevent_collider2(a: number): number; | ||
export function rawcontactforceevent_total_force(a: number): number; | ||
export function rawcontactforceevent_total_force_magnitude(a: number): number; | ||
export function rawcontactforceevent_max_force_direction(a: number): number; | ||
export function rawcontactforceevent_max_force_magnitude(a: number): number; | ||
export function raweventqueue_new(a: number): number; | ||
export function raweventqueue_drainCollisionEvents(a: number, b: number): void; | ||
export function raweventqueue_drainContactForceEvents(a: number, b: number): void; | ||
export function raweventqueue_clear(a: number): void; | ||
@@ -312,11 +336,11 @@ export function __wbg_rawphysicspipeline_free(a: number): void; | ||
export function rawquerypipeline_update(a: number, b: number, c: number, d: number): void; | ||
export function rawquerypipeline_castRay(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function rawquerypipeline_castRayAndGetNormal(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function rawquerypipeline_intersectionsWithRay(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number): void; | ||
export function rawquerypipeline_intersectionWithShape(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): void; | ||
export function rawquerypipeline_projectPoint(a: number, b: number, c: number, d: number, e: number, f: number): number; | ||
export function rawquerypipeline_projectPointAndGetFeature(a: number, b: number, c: number, d: number): number; | ||
export function rawquerypipeline_intersectionsWithPoint(a: number, b: number, c: number, d: number, e: number, f: number): void; | ||
export function rawquerypipeline_castShape(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number): number; | ||
export function rawquerypipeline_intersectionsWithShape(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): void; | ||
export function rawquerypipeline_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 function rawquerypipeline_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 function rawquerypipeline_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 function rawquerypipeline_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 function rawquerypipeline_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 function rawquerypipeline_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 function rawquerypipeline_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 function rawquerypipeline_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): number; | ||
export function rawquerypipeline_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 function rawquerypipeline_collidersWithAabbIntersectingAabb(a: number, b: number, c: number, d: number): void; | ||
@@ -361,2 +385,3 @@ export function __wbg_rawdeserializedworld_free(a: number): void; | ||
export function rawshapecollidertoi_colliderHandle(a: number): number; | ||
export function rawpointcolliderprojection_colliderHandle(a: number): number; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
@@ -363,0 +388,0 @@ export function __wbindgen_free(a: number, b: number): void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
6893522
26136