@react-three/rapier 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/declarations/src/components/AnyCollider.d.ts +2 -2
  2. package/dist/declarations/src/components/InstancedRigidBodies.d.ts +2 -2
  3. package/dist/declarations/src/components/MeshCollider.d.ts +2 -2
  4. package/dist/declarations/src/components/Physics.d.ts +8 -4
  5. package/dist/declarations/src/components/RigidBody.d.ts +1 -1
  6. package/dist/declarations/src/hooks/hooks.d.ts +3 -3
  7. package/dist/declarations/src/hooks/joints.d.ts +1 -1
  8. package/dist/declarations/src/index.d.ts +15 -15
  9. package/dist/declarations/src/types.d.ts +2 -2
  10. package/dist/declarations/src/utils/interaction-groups.d.ts +1 -1
  11. package/dist/react-three-rapier.cjs.d.ts +1 -0
  12. package/dist/react-three-rapier.cjs.dev.js +148 -272
  13. package/dist/react-three-rapier.cjs.prod.js +148 -272
  14. package/dist/react-three-rapier.esm.js +148 -272
  15. package/package.json +8 -13
  16. package/readme.md +0 -2
  17. package/dist/declarations/src/components/Debug.d.ts +0 -2
  18. package/dist/declarations/src/components/FrameStepper.d.ts +0 -9
  19. package/dist/declarations/src/hooks/use-forwarded-ref.d.ts +0 -2
  20. package/dist/declarations/src/hooks/use-imperative-instance.d.ts +0 -5
  21. package/dist/declarations/src/utils/shared-objects.d.ts +0 -9
  22. package/dist/declarations/src/utils/singleton-proxy.d.ts +0 -11
  23. package/dist/declarations/src/utils/utils-collider.d.ts +0 -83
  24. package/dist/declarations/src/utils/utils-physics.d.ts +0 -1
  25. package/dist/declarations/src/utils/utils-rigidbody.d.ts +0 -24
  26. package/dist/declarations/src/utils/utils.d.ts +0 -14
@@ -1,7 +1,7 @@
1
1
  import { Collider } from "@dimforge/rapier3d-compat";
2
2
  import React, { ReactNode } from "react";
3
- import { ColliderOptions, CuboidArgs, RoundCuboidArgs, BallArgs, CapsuleArgs, HeightfieldArgs, TrimeshArgs, ConeArgs, CylinderArgs, ConvexHullArgs, RoundCylinderArgs } from "../types";
4
- import { RoundConeArgs } from "../types";
3
+ import { ColliderOptions, CuboidArgs, RoundCuboidArgs, BallArgs, CapsuleArgs, HeightfieldArgs, TrimeshArgs, ConeArgs, CylinderArgs, ConvexHullArgs, RoundCylinderArgs } from "../types.js";
4
+ import { RoundConeArgs } from "../types.js";
5
5
  export interface ColliderProps extends ColliderOptions<any> {
6
6
  children?: ReactNode;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from "react";
2
- import { RigidBodyProps } from "./RigidBody";
3
- import { RapierRigidBody } from "../types";
2
+ import { RigidBodyProps } from "./RigidBody.js";
3
+ import { RapierRigidBody } from "../types.js";
4
4
  export declare type InstancedRigidBodyProps = RigidBodyProps & {
5
5
  key: string | number;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from "react";
2
- import { RigidBodyAutoCollider } from "../types";
2
+ import { RigidBodyAutoCollider } from "../types.js";
3
3
  export interface MeshColliderProps {
4
4
  children: ReactNode;
5
5
  type: RigidBodyAutoCollider;
@@ -8,4 +8,4 @@ export interface MeshColliderProps {
8
8
  * A mesh collider is a collider that is automatically generated from the geometry of the children.
9
9
  * @category Colliders
10
10
  */
11
- export declare const MeshCollider: React.MemoExoticComponent<(props: MeshColliderProps) => JSX.Element>;
11
+ export declare const MeshCollider: React.MemoExoticComponent<(props: MeshColliderProps) => import("react/jsx-runtime").JSX.Element>;
@@ -2,7 +2,7 @@ import type Rapier from "@dimforge/rapier3d-compat";
2
2
  import { Collider, ColliderHandle, RigidBody, RigidBodyHandle, World } from "@dimforge/rapier3d-compat";
3
3
  import React, { FC, ReactNode } from "react";
4
4
  import { Matrix4, Object3D, Vector3 } from "three";
5
- import { CollisionEnterHandler, CollisionExitHandler, ContactForceHandler, IntersectionEnterHandler, IntersectionExitHandler, RigidBodyAutoCollider, Vector3Tuple } from "../types";
5
+ import { CollisionEnterHandler, CollisionExitHandler, ContactForceHandler, IntersectionEnterHandler, IntersectionExitHandler, RigidBodyAutoCollider, Vector3Tuple } from "../types.js";
6
6
  export interface RigidBodyState {
7
7
  meshType: "instancedMesh" | "mesh";
8
8
  rigidBody: RigidBody;
@@ -197,11 +197,15 @@ export interface PhysicsProps {
197
197
  */
198
198
  maxCcdSubsteps?: number;
199
199
  /**
200
- * The Error Reduction Parameter in between 0 and 1, is the proportion of the positional error to be corrected at each time step.
200
+ * Directly affects the `erp` (Error Reduction Parameter) which is the proportion (0 to 1) of the positional error to be corrected at each time step.
201
+ * The higher this value is, the more the physics engine will try to correct errors.
201
202
  *
202
- * @defaultValue 0.8
203
+ * This prop is currently undocumented in the Rapier documentation.
204
+ *
205
+ * @see https://github.com/dimforge/rapier/pull/651 where this change was made to Rapier
206
+ * @defaultValue 30
203
207
  */
204
- erp?: number;
208
+ contactNaturalFrequency?: number;
205
209
  /**
206
210
  * The approximate size of most dynamic objects in the scene.
207
211
  *
@@ -1,7 +1,7 @@
1
1
  import React, { MutableRefObject, RefObject } from "react";
2
2
  import { ReactNode } from "react";
3
3
  import { Object3D } from "three";
4
- import { RapierRigidBody, RigidBodyOptions } from "../types";
4
+ import { RapierRigidBody, RigidBodyOptions } from "../types.js";
5
5
  export declare const RigidBodyContext: React.Context<{
6
6
  ref: RefObject<Object3D> | MutableRefObject<Object3D>;
7
7
  getRigidBody: () => RapierRigidBody;
@@ -1,7 +1,7 @@
1
1
  import React, { MutableRefObject } from "react";
2
- import { RapierContext, WorldStepCallback } from "../components/Physics";
2
+ import { RapierContext, WorldStepCallback } from "../components/Physics.js";
3
3
  import { Object3D } from "three";
4
- import { ColliderProps, RigidBodyProps } from "..";
4
+ import { ColliderProps, RigidBodyProps } from "../index.js";
5
5
  /**
6
6
  * Exposes the Rapier context, and world
7
7
  * @category Hooks
@@ -20,4 +20,4 @@ export declare const useAfterPhysicsStep: (callback: WorldStepCallback) => void;
20
20
  /**
21
21
  * @internal
22
22
  */
23
- export declare const useChildColliderProps: <O extends Object3D<import("three").Event>>(ref: React.MutableRefObject<O | null | undefined>, options: RigidBodyProps, ignoreMeshColliders?: boolean) => ColliderProps[];
23
+ export declare const useChildColliderProps: <O extends Object3D<import("three").Object3DEventMap>>(ref: React.MutableRefObject<O | null | undefined>, options: RigidBodyProps, ignoreMeshColliders?: boolean) => ColliderProps[];
@@ -1,6 +1,6 @@
1
1
  import { FixedImpulseJoint, ImpulseJoint, PrismaticImpulseJoint, RevoluteImpulseJoint, RopeImpulseJoint, SphericalImpulseJoint, SpringImpulseJoint } from "@dimforge/rapier3d-compat";
2
2
  import { RefObject } from "react";
3
- import { FixedJointParams, PrismaticJointParams, RapierRigidBody, RevoluteJointParams, RopeJointParams, SphericalJointParams, SpringJointParams, UseImpulseJoint } from "..";
3
+ import { FixedJointParams, PrismaticJointParams, RapierRigidBody, RevoluteJointParams, RopeJointParams, SphericalJointParams, SpringJointParams, UseImpulseJoint } from "../index.js";
4
4
  import type Rapier from "@dimforge/rapier3d-compat";
5
5
  /**
6
6
  * @internal
@@ -1,15 +1,15 @@
1
- export * from "./types";
2
- export type { RigidBodyProps } from "./components/RigidBody";
3
- export type { InstancedRigidBodiesProps, InstancedRigidBodyProps } from "./components/InstancedRigidBodies";
4
- export type { CylinderColliderProps, BallColliderProps, CapsuleColliderProps, ConeColliderProps, ConvexHullColliderProps, CuboidColliderProps, HeightfieldColliderProps, RoundCuboidColliderProps, TrimeshColliderProps, ColliderOptionsRequiredArgs } from "./components/AnyCollider";
5
- export type { PhysicsProps, RapierContext, WorldStepCallback } from "./components/Physics";
6
- export type { MeshColliderProps } from "./components/MeshCollider";
7
- export { Physics } from "./components/Physics";
8
- export { RigidBody } from "./components/RigidBody";
9
- export { MeshCollider } from "./components/MeshCollider";
10
- export { InstancedRigidBodies } from "./components/InstancedRigidBodies";
11
- export * from "./components/AnyCollider";
12
- export * from "./hooks/joints";
13
- export { useRapier, useBeforePhysicsStep, useAfterPhysicsStep } from "./hooks/hooks";
14
- export * from "./utils/interaction-groups";
15
- export * from "./utils/three-object-helpers";
1
+ export * from "./types.js";
2
+ export type { RigidBodyProps } from "./components/RigidBody.js";
3
+ export type { InstancedRigidBodiesProps, InstancedRigidBodyProps } from "./components/InstancedRigidBodies.js";
4
+ export type { CylinderColliderProps, BallColliderProps, CapsuleColliderProps, ConeColliderProps, ConvexHullColliderProps, CuboidColliderProps, HeightfieldColliderProps, RoundCuboidColliderProps, TrimeshColliderProps, ColliderOptionsRequiredArgs } from "./components/AnyCollider.js";
5
+ export type { PhysicsProps, RapierContext, WorldStepCallback } from "./components/Physics.js";
6
+ export type { MeshColliderProps } from "./components/MeshCollider.js";
7
+ export { Physics } from "./components/Physics.js";
8
+ export { RigidBody } from "./components/RigidBody.js";
9
+ export { MeshCollider } from "./components/MeshCollider.js";
10
+ export { InstancedRigidBodies } from "./components/InstancedRigidBodies.js";
11
+ export * from "./components/AnyCollider.js";
12
+ export * from "./hooks/joints.js";
13
+ export { useRapier, useBeforePhysicsStep, useAfterPhysicsStep } from "./hooks/hooks.js";
14
+ export * from "./utils/interaction-groups.js";
15
+ export * from "./utils/three-object-helpers.js";
@@ -3,8 +3,8 @@ import { ActiveCollisionTypes, CoefficientCombineRule, ImpulseJoint, Interaction
3
3
  import { Rotation, Vector } from "@dimforge/rapier3d-compat/math";
4
4
  import { Object3DProps, Quaternion, Vector3 } from "@react-three/fiber";
5
5
  import { Object3D } from "three";
6
- import { ColliderProps } from ".";
7
- import { RigidBodyState } from "./components/Physics";
6
+ import { ColliderProps } from "./index.js";
7
+ import { RigidBodyState } from "./components/Physics.js";
8
8
  export { CoefficientCombineRule as CoefficientCombineRule } from "@dimforge/rapier3d-compat";
9
9
  export { RapierCollider, RapierRigidBody };
10
10
  export declare type RefGetter<T> = MutableRefObject<() => T | undefined>;
@@ -31,4 +31,4 @@ import { InteractionGroups } from "@dimforge/rapier3d-compat";
31
31
  * @param filters Groups the interaction group should filter against. (Values can range from 0 to 15.)
32
32
  * @returns An InteractionGroup bitmask.
33
33
  */
34
- export declare const interactionGroups: (memberships: number | number[], filters?: number | number[]) => InteractionGroups;
34
+ export declare const interactionGroups: (memberships: number | number[], filters?: number | number[] | undefined) => InteractionGroups;
@@ -1 +1,2 @@
1
1
  export * from "./declarations/src/index";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhY3QtdGhyZWUtcmFwaWVyLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==