@react-three/rapier 0.7.6 → 0.8.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.
@@ -1,13 +1,5 @@
1
1
  import { FC } from "react";
2
2
  interface DebugProps {
3
- /**
4
- * The color of the wireframe representing an active collider that is affected by forces and not sleeping.
5
- */
6
- color?: string;
7
- /**
8
- * The color of the wireframe representing a static (fixed or kinematic) or sleeping collider.
9
- */
10
- sleepColor?: string;
11
3
  }
12
4
  export declare const Debug: FC<DebugProps>;
13
5
  export {};
@@ -1,4 +1,4 @@
1
- import { Collider, ColliderDesc, ImpulseJoint, JointData, RigidBody, RigidBodyDesc, World } from "@dimforge/rapier3d-compat";
1
+ import { Collider, ColliderDesc, DebugRenderBuffers, ImpulseJoint, JointData, RigidBody, RigidBodyDesc, World } from "@dimforge/rapier3d-compat";
2
2
  import { Quaternion, Vector3 } from "three";
3
3
  import { RefGetter } from "./types";
4
4
  declare type Vector3Object = {
@@ -101,12 +101,12 @@ export interface RigidBodyApi {
101
101
  */
102
102
  setNextKinematicRotation(rotation: Quaternion): void;
103
103
  /**
104
- * If this rigid body is kinematic, sets its future rotation after the next timestep integration.
104
+ * If this rigid body is kinematic, sets its future translation after the next timestep integration.
105
105
  *
106
- * This should be used instead of rigidBody.setRotation to make the dynamic object interacting with
107
- * this kinematic body behave as expected. Internally, Rapier will compute an artificial velocity
108
- * for this rigid-body from its current position and its next kinematic position. This velocity
109
- * will be used to compute forces on dynamic bodies interacting with this body.
106
+ * This should be used instead of rigidBody.setTranslation to make the dynamic object interacting with
107
+ * this kinematic body behave as expected. Internally, Rapier will compute an artificial velocity
108
+ * for this rigid-body from its current position and its next kinematic position. This velocity
109
+ * will be used to compute forces on dynamic bodies interacting with this body.
110
110
  */
111
111
  setNextKinematicTranslation(translation: Vector3Object): void;
112
112
  /**
@@ -160,6 +160,7 @@ export interface WorldApi {
160
160
  removeImpulseJoint(joint: ImpulseJoint, wakeUp?: boolean): void;
161
161
  forEachCollider(callback: (collider: Collider) => void): void;
162
162
  setGravity(gravity: Vector3): void;
163
+ debugRender(): DebugRenderBuffers;
163
164
  }
164
165
  export declare const createWorldApi: (ref: RefGetter<World>) => WorldApi;
165
166
  export declare const createJointApi: (ref: RefGetter<ImpulseJoint>) => {
@@ -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[] | undefined) => InteractionGroups;
34
+ export declare const interactionGroups: (memberships: number | number[], filters?: number | number[]) => InteractionGroups;
@@ -19,7 +19,7 @@ export declare type CuboidArgs = [
19
19
  halfDepth: number
20
20
  ];
21
21
  export declare type BallArgs = [radius: number];
22
- export declare type CapsuleArgs = [radius: number, height: number];
22
+ export declare type CapsuleArgs = [halfHeight: number, radius: number];
23
23
  export declare type ConvexHullArgs = [vertices: ArrayLike<number>];
24
24
  export declare type HeightfieldArgs = [
25
25
  width: number,
@@ -42,16 +42,16 @@ export declare type RoundCuboidArgs = [
42
42
  halfDepth: number,
43
43
  borderRadius: number
44
44
  ];
45
- export declare type CylinderArgs = [radius: number, height: number];
45
+ export declare type CylinderArgs = [halfHeight: number, radius: number];
46
46
  export declare type RoundCylinderArgs = [
47
+ halfHeight: number,
47
48
  radius: number,
48
- height: number,
49
49
  borderRadius: number
50
50
  ];
51
- export declare type ConeArgs = [radius: number, height: number];
51
+ export declare type ConeArgs = [halfHeight: number, radius: number];
52
52
  export declare type RoundConeArgs = [
53
+ halfHeight: number,
53
54
  radius: number,
54
- height: number,
55
55
  borderRadius: number
56
56
  ];
57
57
  export declare type ConvexMeshArgs = [
@@ -287,6 +287,10 @@ export interface UseRigidBodyOptions extends ColliderProps {
287
287
  * Passed down to the object3d representing this collider.
288
288
  */
289
289
  userData?: Object3DProps["userData"];
290
+ /**
291
+ * Include invisible objects on the collider creation estimation.
292
+ */
293
+ includeInvisible?: boolean;
290
294
  }
291
295
  export declare type SphericalJointParams = [
292
296
  body1Anchor: Vector3Array,
@@ -14,12 +14,12 @@ export declare const scaleColliderArgs: (shape: ColliderShape, args: (number | A
14
14
  y: number;
15
15
  z: number;
16
16
  })[];
17
- export declare const createColliderFromOptions: (options: ColliderProps, world: WorldApi, scale: Vector3, rigidBody?: RigidBody | undefined) => Collider;
17
+ export declare const createColliderFromOptions: (options: ColliderProps, world: WorldApi, scale: Vector3, rigidBody?: RigidBody) => Collider;
18
18
  declare type ImmutableColliderOptions = (keyof ColliderProps)[];
19
19
  export declare const immutableColliderOptions: ImmutableColliderOptions;
20
20
  export declare const setColliderOptions: (collider: Collider, options: ColliderProps, states: ColliderStateMap) => void;
21
21
  export declare const useUpdateColliderOptions: (collidersRef: MutableRefObject<Collider[]>, props: ColliderProps, states: ColliderStateMap) => void;
22
- export declare const createColliderState: (collider: Collider, object: Object3D, rigidBodyObject?: Object3D<import("three").Event> | null | undefined) => ColliderState;
22
+ export declare const createColliderState: (collider: Collider, object: Object3D, rigidBodyObject?: Object3D | null) => ColliderState;
23
23
  interface CreateColliderPropsFromChildren {
24
24
  (options: {
25
25
  object: Object3D;