Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dimforge/rapier3d-compat

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dimforge/rapier3d-compat - npm Package Compare versions

Comparing version 0.0.0-18ced6c-20221030 to 0.0.0-19a4455-20230122

19

control/character_controller.d.ts

@@ -5,10 +5,21 @@ import { Vector } from "../math";

import { IntegrationParameters, RigidBodySet } from "../dynamics";
/**
* A collision between the character and an obstacle hit on its path.
*/
export declare class CharacterCollision {
collider: Collider;
/** The collider involved in the collision. Null if the collider no longer exists in the physics world. */
collider: Collider | null;
/** The translation applied to the character before this collision took place. */
translationApplied: Vector;
/** The translation the character would move after this collision if there is no other obstacles. */
translationRemaining: Vector;
/** The time-of-impact between the character and the obstacles. */
toi: number;
/** The world-space contact point on the collider when the collision happens. */
witness1: Vector;
/** The local-space contact point on the character when the collision happens. */
witness2: Vector;
/** The world-space outward contact normal on the collider when the collision happens. */
normal1: Vector;
/** The local-space outward contact normal on the character when the collision happens. */
normal2: Vector;

@@ -128,4 +139,4 @@ }

/**
* Should the character be automatically snapped to the ground if the distance between
* the ground and its feed are smaller than the specified threshold?
* If snap-to-ground is enabled, should the character be automatically snapped to the ground if
* the distance between the ground and its feet are smaller than the specified threshold?
*/

@@ -135,3 +146,3 @@ snapToGroundDistance(): number | null;

* Enables automatically snapping the character to the ground if the distance between
* the ground and its feed are smaller than the specified threshold.
* the ground and its feet are smaller than the specified threshold.
*/

@@ -138,0 +149,0 @@ enableSnapToGround(distance: number): void;

import { RawRigidBodySet } from "../raw";
import { Rotation, Vector } from "../math";
import { SdpMatrix3 } from "../math";
import { Collider, ColliderSet } from "../geometry";

@@ -233,2 +234,44 @@ /**

/**
* The inverse mass taking into account translation locking.
*/
effectiveInvMass(): Vector;
/**
* The inverse of the mass of a rigid-body.
*
* If this is zero, the rigid-body is assumed to have infinite mass.
*/
invMass(): number;
/**
* The center of mass of a rigid-body expressed in its local-space.
*/
localCom(): Vector;
/**
* The world-space center of mass of the rigid-body.
*/
worldCom(): Vector;
/**
* 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.
*/
invPrincipalInertiaSqrt(): Vector;
/**
* The angular inertia along the principal inertia axes of the rigid-body.
*/
principalInertia(): Vector;
/**
* The principal vectors of the local angular inertia tensor of the rigid-body.
*/
principalInertiaLocalFrame(): Rotation;
/**
* The square-root of the world-space inverse angular inertia tensor of the rigid-body,
* taking into account rotation locking.
*/
effectiveWorldInvInertiaSqrt(): SdpMatrix3;
/**
* The effective world-space angular inertia (that takes the potential rotation locking into account) of
* this rigid-body.
*/
effectiveAngularInertia(): SdpMatrix3;
/**
* Put this rigid body to sleep.

@@ -254,3 +297,3 @@ *

*/
isCcdEnabled(): void;
isCcdEnabled(): boolean;
/**

@@ -268,2 +311,12 @@ * The number of colliders attached to this rigid-body.

/**
* Sets whether this rigid-body is enabled or not.
*
* @param enabled - Set to `false` to disable this rigid-body and all its attached colliders.
*/
setEnabled(enabled: boolean): void;
/**
* Is this rigid-body enabled?
*/
isEnabled(): boolean;
/**
* The status of this rigid-body: static, dynamic, or kinematic.

@@ -275,3 +328,3 @@ */

*/
setBodyType(type: RigidBodyType): void;
setBodyType(type: RigidBodyType, wakeUp: boolean): void;
/**

@@ -416,2 +469,3 @@ * Is this rigid-body sleeping?

export declare class RigidBodyDesc {
enabled: boolean;
translation: Vector;

@@ -484,2 +538,7 @@ rotation: Rotation;

/**
* Sets whether the created rigid-body will be enabled or disabled.
* @param enabled − If set to `false` the rigid-body will be disabled at creation.
*/
setEnabled(enabled: boolean): RigidBodyDesc;
/**
* Sets the initial translation of the rigid-body to create.

@@ -486,0 +545,0 @@ *

@@ -106,2 +106,12 @@ import { Rotation, Vector } from "../math";

/**
* Sets whether this collider is enabled or not.
*
* @param enabled - Set to `false` to disable this collider (its parent rigid-body won’t be disabled automatically by this).
*/
setEnabled(enabled: boolean): void;
/**
* Is this collider enabled?
*/
isEnabled(): boolean;
/**
* Sets the restitution coefficient of the collider to be created.

@@ -281,2 +291,8 @@ *

/**
* Sets the half-extents of this collider if it is a cuboid shape.
*
* @param newHalfExtents - desired half extents.
*/
setHalfExtents(newHalfExtents: Vector): void;
/**
* The radius of this collider if it is a ball, cylinder, capsule, or cone shape.

@@ -287,2 +303,8 @@ * @deprecated this field will be removed in the future, please access this field on `shape` member instead.

/**
* Sets the radius of this collider if it is a ball, cylinder, capsule, or cone shape.
*
* @param newRadius - desired radius.
*/
setRadius(newRadius: number): void;
/**
* The radius of the round edges of this collider if it is a round cylinder.

@@ -293,2 +315,8 @@ * @deprecated this field will be removed in the future, please access this field on `shape` member instead.

/**
* Sets the radius of the round edges of this collider if it has round edges.
*
* @param newBorderRadius - desired round edge radius.
*/
setRoundRadius(newBorderRadius: number): void;
/**
* The half height of this collider if it is a cylinder, capsule, or cone shape.

@@ -299,2 +327,8 @@ * @deprecated this field will be removed in the future, please access this field on `shape` member instead.

/**
* Sets the half height of this collider if it is a cylinder, capsule, or cone shape.
*
* @param newHalfheight - desired half height.
*/
setHalfHeight(newHalfheight: number): void;
/**
* If this collider has a triangle mesh, polyline, convex polygon, or convex polyhedron shape,

@@ -434,2 +468,3 @@ * this returns the vertex buffer of said shape.

export declare class ColliderDesc {
enabled: boolean;
shape: Shape;

@@ -622,2 +657,7 @@ massPropsMode: MassPropsMode;

/**
* Sets whether the created collider will be enabled or disabled.
* @param enabled − If set to `false` the collider will be disabled at creation.
*/
setEnabled(enabled: boolean): ColliderDesc;
/**
* Sets the density of the collider being built.

@@ -624,0 +664,0 @@ *

import { RawVector, RawRotation } from "./raw";
import { RawSdpMatrix3 } from "./raw";
export interface Vector {

@@ -45,1 +46,50 @@ x: number;

}
/**
* A 3D symmetric-positive-definite matrix.
*/
export declare class SdpMatrix3 {
/**
* Row major list of the upper-triangular part of the symmetric matrix.
*/
elements: Float32Array;
/**
* Matrix element at row 1, column 1.
*/
get m11(): number;
/**
* Matrix element at row 1, column 2.
*/
get m12(): number;
/**
* Matrix element at row 2, column 1.
*/
get m21(): number;
/**
* Matrix element at row 1, column 3.
*/
get m13(): number;
/**
* Matrix element at row 3, column 1.
*/
get m31(): number;
/**
* Matrix element at row 2, column 2.
*/
get m22(): number;
/**
* Matrix element at row 2, column 3.
*/
get m23(): number;
/**
* Matrix element at row 3, column 2.
*/
get m32(): number;
/**
* Matrix element at row 3, column 3.
*/
get m33(): number;
constructor(elements: Float32Array);
}
export declare class SdpMatrix3Ops {
static fromRaw(raw: RawSdpMatrix3): SdpMatrix3;
}

@@ -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-18ced6c-20221030",
"version": "0.0.0-19a4455-20230122",
"license": "Apache-2.0",

@@ -10,0 +10,0 @@ "repository": {

import { RawQueryPipeline } from "../raw";
import { ColliderHandle, ColliderSet, InteractionGroups, PointColliderProjection, Ray, RayColliderIntersection, RayColliderToi, Shape, ShapeColliderTOI } from "../geometry";
import { IslandManager, RigidBodyHandle, RigidBodySet } from "../dynamics";
import { RigidBodyHandle, RigidBodySet } from "../dynamics";
import { Rotation, Vector } from "../math";

@@ -61,3 +61,3 @@ /**

*/
update(islands: IslandManager, bodies: RigidBodySet, colliders: ColliderSet): void;
update(bodies: RigidBodySet, colliders: ColliderSet): void;
/**

@@ -64,0 +64,0 @@ * Find the closest intersection between a ray and a set of collider.

@@ -70,2 +70,16 @@ import { RawBroadPhase, RawCCDSolver, RawColliderSet, RawDeserializedWorld, RawIntegrationParameters, RawIslandManager, RawImpulseJointSet, RawMultibodyJointSet, RawNarrowPhase, RawPhysicsPipeline, RawQueryPipeline, RawRigidBodySet, RawSerializationPipeline, RawDebugRenderPipeline } from "../raw";

/**
* Update colliders positions after rigid-bodies moved.
*
* When a rigid-body moves, the positions of the colliders attached to it need to be updated. This update is
* generally automatically done at the beginning and the end of each simulation step with World.step.
* If the positions need to be updated without running a simulation step this method can be called manually.
*/
propagateModifiedBodyPositionsToColliders(): void;
/**
* Ensure subsequent scene queries take into account the collider positions set before this method is called.
*
* This does not step the physics simulation forward.
*/
updateSceneQueries(): void;
/**
* The current simulation timestep.

@@ -72,0 +86,0 @@ */

@@ -21,3 +21,2 @@ /* tslint:disable */

export function rawkinematiccharactercontroller_setMaxSlopeClimbAngle(a: number, b: number): void;
export function rawkinematiccharactercontroller_minSlopeSlideAngle(a: number): number;
export function rawkinematiccharactercontroller_setMinSlopeSlideAngle(a: number, b: number): void;

@@ -143,2 +142,11 @@ export function rawkinematiccharactercontroller_snapToGroundDistance(a: number, b: number): void;

export function rawrigidbodyset_rbMass(a: number, b: number): number;
export function rawrigidbodyset_rbInvMass(a: number, b: number): number;
export function rawrigidbodyset_rbEffectiveInvMass(a: number, b: number): number;
export function rawrigidbodyset_rbLocalCom(a: number, b: number): number;
export function rawrigidbodyset_rbWorldCom(a: number, b: number): number;
export function rawrigidbodyset_rbInvPrincipalInertiaSqrt(a: number, b: number): number;
export function rawrigidbodyset_rbPrincipalInertiaLocalFrame(a: number, b: number): number;
export function rawrigidbodyset_rbPrincipalInertia(a: number, b: number): number;
export function rawrigidbodyset_rbEffectiveWorldInvInertiaSqrt(a: number, b: number): number;
export function rawrigidbodyset_rbEffectiveAngularInertia(a: number, b: number): number;
export function rawrigidbodyset_rbWakeUp(a: number, b: number): void;

@@ -149,3 +157,3 @@ export function rawrigidbodyset_rbIsCcdEnabled(a: number, b: number): number;

export function rawrigidbodyset_rbBodyType(a: number, b: number): number;
export function rawrigidbodyset_rbSetBodyType(a: number, b: number, c: number): void;
export function rawrigidbodyset_rbSetBodyType(a: number, b: number, c: number, d: number): void;
export function rawrigidbodyset_rbIsFixed(a: number, b: number): number;

@@ -158,2 +166,4 @@ export function rawrigidbodyset_rbIsKinematic(a: number, b: number): number;

export function rawrigidbodyset_rbSetAngularDamping(a: number, b: number, c: number): void;
export function rawrigidbodyset_rbSetEnabled(a: number, b: number, c: number): void;
export function rawrigidbodyset_rbIsEnabled(a: number, b: number): number;
export function rawrigidbodyset_rbGravityScale(a: number, b: number): number;

@@ -173,3 +183,3 @@ export function rawrigidbodyset_rbSetGravityScale(a: number, b: number, c: number, d: 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, x: 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, y: number): number;
export function rawrigidbodyset_remove(a: number, b: number, c: number, d: number, e: number, f: number): void;

@@ -179,2 +189,3 @@ export function rawrigidbodyset_len(a: number): number;

export function rawrigidbodyset_forEachRigidBodyHandle(a: number, b: number): void;
export function rawrigidbodyset_propagateModifiedBodyPositionsToColliders(a: number, b: number): void;
export function __wbg_rawbroadphase_free(a: number): void;

@@ -192,5 +203,9 @@ export function rawbroadphase_new(): number;

export function rawcolliderset_coHalfExtents(a: number, b: number): number;
export function rawcolliderset_coSetHalfExtents(a: number, b: number, c: number): void;
export function rawcolliderset_coRadius(a: number, b: number, c: number): void;
export function rawcolliderset_coSetRadius(a: number, b: number, c: number): void;
export function rawcolliderset_coHalfHeight(a: number, b: number, c: number): void;
export function rawcolliderset_coSetHalfHeight(a: number, b: number, c: number): void;
export function rawcolliderset_coRoundRadius(a: number, b: number, c: number): void;
export function rawcolliderset_coSetRoundRadius(a: number, b: number, c: number): void;
export function rawcolliderset_coVertices(a: number, b: number, c: number): void;

@@ -203,2 +218,4 @@ export function rawcolliderset_coIndices(a: number, b: number, c: number): void;

export function rawcolliderset_coParent(a: number, b: number, c: number): void;
export function rawcolliderset_coSetEnabled(a: number, b: number, c: number): void;
export function rawcolliderset_coIsEnabled(a: number, b: number): number;
export function rawcolliderset_coFriction(a: number, b: number): number;

@@ -246,3 +263,3 @@ export function rawcolliderset_coRestitution(a: number, b: number): 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, y: 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, z: number): void;
export function rawcolliderset_remove(a: number, b: number, c: number, d: number, e: number): void;

@@ -252,5 +269,2 @@ export function rawcolliderset_forEachColliderHandle(a: number, b: number): void;

export function rawshapecontact_distance(a: number): number;
export function rawshapecontact_point2(a: number): number;
export function rawshapecontact_normal1(a: number): number;
export function rawshapecontact_normal2(a: number): number;
export function __wbg_rawnarrowphase_free(a: number): void;

@@ -299,3 +313,2 @@ export function rawnarrowphase_new(): number;

export function rawraycolliderintersection_normal(a: number): number;
export function rawraycolliderintersection_toi(a: number): number;
export function __wbg_rawraycollidertoi_free(a: number): void;

@@ -331,3 +344,2 @@ export function __wbg_rawshape_free(a: number): void;

export function __wbg_rawshapetoi_free(a: number): void;
export function rawshapetoi_witness2(a: number): number;
export function rawshapetoi_normal1(a: number): number;

@@ -350,2 +362,3 @@ export function rawshapetoi_normal2(a: number): number;

export function rawvector_zyx(a: number): number;
export function rawsdpmatrix3_elements(a: number): number;
export function __wbg_rawdebugrenderpipeline_free(a: number): void;

@@ -373,3 +386,3 @@ export function rawdebugrenderpipeline_new(): number;

export function rawquerypipeline_new(): number;
export function rawquerypipeline_update(a: number, b: number, c: number, d: number): void;
export function rawquerypipeline_update(a: number, b: number, c: 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;

@@ -401,6 +414,24 @@ 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 __wbg_rawvector_free(a: number): void;
export function __wbg_rawsdpmatrix3_free(a: number): void;
export function rawvector_set_x(a: number, b: number): void;
export function rawvector_set_z(a: number, b: number): void;
export function rawcolliderset_isHandleValid(a: number, b: number): number;
export function rawshapecontact_point1(a: number): number;
export function rawshapecontact_normal2(a: number): number;
export function rawpointprojection_point(a: number): number;
export function rawshapecontact_point2(a: number): number;
export function rawshapetoi_witness1(a: number): number;
export function rawshapecollidertoi_witness1(a: number): number;
export function rawshapecontact_normal1(a: number): number;
export function rawshapecollidertoi_normal1(a: number): number;
export function rawshapecollidertoi_normal2(a: number): number;
export function rawshapetoi_witness2(a: number): number;
export function rawraycolliderintersection_featureId(a: number, b: number): void;
export function rawserializationpipeline_new(): number;
export function rawrayintersection_toi(a: number): number;
export function rawraycolliderintersection_toi(a: number): number;
export function rawraycolliderintersection_featureType(a: number): number;
export function rawrayintersection_toi(a: number): number;
export function rawraycollidertoi_toi(a: number): number;
export function rawshapetoi_toi(a: number): number;
export function rawshapecollidertoi_toi(a: number): number;
export function rawrotation_x(a: number): number;

@@ -411,15 +442,3 @@ export function rawrotation_z(a: number): number;

export function rawvector_z(a: number): number;
export function rawcolliderset_isHandleValid(a: number, b: number): number;
export function rawraycolliderintersection_featureId(a: number, b: number): void;
export function rawvector_set_x(a: number, b: number): void;
export function rawvector_set_z(a: number, b: number): void;
export function __wbg_rawserializationpipeline_free(a: number): void;
export function rawshapecontact_point1(a: number): number;
export function rawpointprojection_point(a: number): number;
export function rawshapetoi_witness1(a: number): number;
export function rawraycollidertoi_toi(a: number): number;
export function rawshapecollidertoi_toi(a: number): number;
export function rawshapecollidertoi_witness1(a: number): number;
export function rawshapecollidertoi_normal1(a: number): number;
export function rawshapecollidertoi_normal2(a: number): number;
export function rawkinematiccharactercontroller_minSlopeSlideAngle(a: number): number;
export function rawpointcolliderprojection_colliderHandle(a: number): number;

@@ -430,2 +449,3 @@ export function rawraycolliderintersection_colliderHandle(a: number): number;

export function rawcontactforceevent_collider1(a: number): number;
export function __wbg_rawserializationpipeline_free(a: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;

@@ -432,0 +452,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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc