@react-three/rapier 0.6.9 → 0.7.1
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.
- package/dist/declarations/src/AnyCollider.d.ts +6 -2
- package/dist/declarations/src/InstancedRigidBodies.d.ts +1 -1
- package/dist/declarations/src/MeshCollider.d.ts +1 -1
- package/dist/declarations/src/Physics.d.ts +32 -19
- package/dist/declarations/src/RigidBody.d.ts +0 -2
- package/dist/declarations/src/hooks.d.ts +3 -1
- package/dist/declarations/src/shared-objects.d.ts +3 -0
- package/dist/declarations/src/types.d.ts +48 -17
- package/dist/declarations/src/utils-collider.d.ts +36 -0
- package/dist/declarations/src/utils-rigidbody.d.ts +20 -0
- package/dist/declarations/src/utils.d.ts +5 -46
- package/dist/react-three-rapier.cjs.dev.js +775 -672
- package/dist/react-three-rapier.cjs.prod.js +775 -672
- package/dist/react-three-rapier.esm.js +776 -675
- package/package.json +1 -1
- package/readme.md +19 -3
@@ -1,6 +1,10 @@
|
|
1
|
-
import { ReactNode } from "react";
|
1
|
+
import React, { ReactNode } from "react";
|
2
2
|
import { UseColliderOptions, CuboidArgs, RoundCuboidArgs, BallArgs, CapsuleArgs, HeightfieldArgs, TrimeshArgs, ConeArgs, CylinderArgs, ConvexHullArgs } from "./types";
|
3
|
-
|
3
|
+
export interface ColliderProps extends UseColliderOptions<any> {
|
4
|
+
children?: ReactNode;
|
5
|
+
}
|
6
|
+
export declare const AnyCollider: React.MemoExoticComponent<(props: ColliderProps) => JSX.Element>;
|
7
|
+
declare type UseColliderOptionsRequiredArgs<T extends unknown[]> = Omit<UseColliderOptions<T>, "args"> & {
|
4
8
|
args: T;
|
5
9
|
children?: ReactNode;
|
6
10
|
};
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
2
2
|
import { InstancedRigidBodyApi } from "./api";
|
3
3
|
import { RigidBodyProps } from "./RigidBody";
|
4
4
|
import { Vector3Array } from "./types";
|
5
|
-
export interface InstancedRigidBodiesProps extends Omit<RigidBodyProps, "position" | "rotation"
|
5
|
+
export interface InstancedRigidBodiesProps extends Omit<RigidBodyProps, "position" | "rotation"> {
|
6
6
|
positions?: Vector3Array[];
|
7
7
|
rotations?: Vector3Array[];
|
8
8
|
scales?: Vector3Array[];
|
@@ -4,5 +4,5 @@ interface MeshColliderProps {
|
|
4
4
|
children: ReactNode;
|
5
5
|
type: RigidBodyAutoCollider;
|
6
6
|
}
|
7
|
-
export declare const MeshCollider: (
|
7
|
+
export declare const MeshCollider: (props: MeshColliderProps) => JSX.Element;
|
8
8
|
export {};
|
@@ -1,32 +1,51 @@
|
|
1
1
|
import React, { FC, ReactNode } from "react";
|
2
2
|
import type Rapier from "@dimforge/rapier3d-compat";
|
3
|
-
import { CollisionEnterHandler, CollisionExitHandler, RigidBodyAutoCollider, Vector3Array, WorldApi } from "./types";
|
4
|
-
import { ColliderHandle, RigidBodyHandle } from "@dimforge/rapier3d-compat";
|
3
|
+
import { CollisionEnterHandler, CollisionExitHandler, IntersectionEnterHandler, IntersectionExitHandler, RigidBodyAutoCollider, Vector3Array, WorldApi } from "./types";
|
4
|
+
import { Collider, ColliderHandle, RigidBody, RigidBodyHandle } from "@dimforge/rapier3d-compat";
|
5
5
|
import { Matrix4, Object3D, Vector3 } from "three";
|
6
|
+
export interface RigidBodyState {
|
7
|
+
rigidBody: RigidBody;
|
8
|
+
object: Object3D;
|
9
|
+
invertedWorldMatrix: Matrix4;
|
10
|
+
setMatrix: (matrix: Matrix4) => void;
|
11
|
+
getMatrix: (matrix: Matrix4) => Matrix4;
|
12
|
+
/**
|
13
|
+
* Required for instanced rigid bodies.
|
14
|
+
*/
|
15
|
+
scale: Vector3;
|
16
|
+
isSleeping: boolean;
|
17
|
+
}
|
18
|
+
export declare type RigidBodyStateMap = Map<RigidBody['handle'], RigidBodyState>;
|
19
|
+
export interface ColliderState {
|
20
|
+
collider: Collider;
|
21
|
+
object: Object3D;
|
22
|
+
/**
|
23
|
+
* The parent of which this collider needs to base its
|
24
|
+
* world position on
|
25
|
+
*/
|
26
|
+
worldParent: Object3D;
|
27
|
+
}
|
28
|
+
export declare type ColliderStateMap = Map<Collider['handle'], ColliderState>;
|
6
29
|
export interface RapierContext {
|
7
30
|
rapier: typeof Rapier;
|
8
31
|
world: WorldApi;
|
9
|
-
rigidBodyStates:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
getMatrix(): Matrix4;
|
14
|
-
worldScale: Vector3;
|
15
|
-
invertedMatrixWorld: Matrix4;
|
16
|
-
}>;
|
32
|
+
rigidBodyStates: RigidBodyStateMap;
|
33
|
+
colliderStates: ColliderStateMap;
|
34
|
+
rigidBodyEvents: EventMap;
|
35
|
+
colliderEvents: EventMap;
|
17
36
|
physicsOptions: {
|
18
37
|
colliders: RigidBodyAutoCollider;
|
19
38
|
};
|
20
|
-
rigidBodyEvents: EventMap;
|
21
|
-
colliderEvents: EventMap;
|
22
39
|
isPaused: boolean;
|
23
40
|
}
|
24
41
|
export declare const RapierContext: React.Context<RapierContext | undefined>;
|
25
|
-
declare type EventMap = Map<ColliderHandle | RigidBodyHandle, {
|
42
|
+
export declare type EventMap = Map<ColliderHandle | RigidBodyHandle, {
|
26
43
|
onSleep?(): void;
|
27
44
|
onWake?(): void;
|
28
45
|
onCollisionEnter?: CollisionEnterHandler;
|
29
46
|
onCollisionExit?: CollisionExitHandler;
|
47
|
+
onIntersectionEnter?: IntersectionEnterHandler;
|
48
|
+
onIntersectionExit?: IntersectionExitHandler;
|
30
49
|
}>;
|
31
50
|
interface RapierWorldProps {
|
32
51
|
children: ReactNode;
|
@@ -49,12 +68,6 @@ interface RapierWorldProps {
|
|
49
68
|
* @defaultValue 1/60
|
50
69
|
*/
|
51
70
|
timeStep?: number;
|
52
|
-
/**
|
53
|
-
* Maximum number of fixed steps to take per function call.
|
54
|
-
*
|
55
|
-
* @defaultValue 10
|
56
|
-
*/
|
57
|
-
maxSubSteps?: number;
|
58
71
|
/**
|
59
72
|
* Pause the physics simulation
|
60
73
|
*
|
@@ -7,13 +7,11 @@ import { RigidBodyApi, UseRigidBodyOptions } from "./types";
|
|
7
7
|
export declare const RigidBodyContext: React.Context<{
|
8
8
|
ref: RefObject<Object3D> | MutableRefObject<Object3D>;
|
9
9
|
api: RigidBodyApi | InstancedRigidBodyApi;
|
10
|
-
hasCollisionEvents: boolean;
|
11
10
|
options: UseRigidBodyOptions | InstancedRigidBodiesProps;
|
12
11
|
}>;
|
13
12
|
export declare const useRigidBodyContext: () => {
|
14
13
|
ref: RefObject<Object3D> | MutableRefObject<Object3D>;
|
15
14
|
api: RigidBodyApi | InstancedRigidBodyApi;
|
16
|
-
hasCollisionEvents: boolean;
|
17
15
|
options: UseRigidBodyOptions | InstancedRigidBodiesProps;
|
18
16
|
};
|
19
17
|
export interface RigidBodyProps extends UseRigidBodyOptions {
|
@@ -4,7 +4,9 @@ import { Object3D } from "three";
|
|
4
4
|
import type Rapier from "@dimforge/rapier3d-compat";
|
5
5
|
export declare const useRapier: () => RapierContext;
|
6
6
|
import { UseRigidBodyOptions, UseImpulseJoint, SphericalJointParams, FixedJointParams, PrismaticJointParams, RevoluteJointParams, RigidBodyApi, RigidBodyApiRef } from "./types";
|
7
|
-
|
7
|
+
import { ColliderProps, RigidBodyProps } from ".";
|
8
|
+
export declare const useChildColliderProps: <O extends Object3D<import("three").Event>>(ref: React.MutableRefObject<O | null | undefined>, options: RigidBodyProps, ignoreMeshColliders?: boolean) => ColliderProps[];
|
9
|
+
export declare const useRigidBody: <O extends Object3D<import("three").Event>>(options?: UseRigidBodyOptions) => [React.MutableRefObject<O>, import("./api").RigidBodyApi, ColliderProps[]];
|
8
10
|
export declare const useImpulseJoint: <T extends Rapier.ImpulseJoint>(body1: RigidBodyApiRef, body2: RigidBodyApiRef, params: Rapier.JointData) => {
|
9
11
|
raw: () => Rapier.ImpulseJoint | undefined;
|
10
12
|
readonly handle: number;
|
@@ -4,3 +4,6 @@ export declare const _euler: Euler;
|
|
4
4
|
export declare const _vector3: Vector3;
|
5
5
|
export declare const _object3d: Object3D<import("three").Event>;
|
6
6
|
export declare const _matrix4: Matrix4;
|
7
|
+
export declare const _position: Vector3;
|
8
|
+
export declare const _rotation: Quaternion;
|
9
|
+
export declare const _scale: Vector3;
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import { MutableRefObject } from "react";
|
2
2
|
import { CoefficientCombineRule, Collider as RapierCollider, InteractionGroups, RigidBody as RapierRigidBody, TempContactManifold } from "@dimforge/rapier3d-compat";
|
3
3
|
import { createColliderApi, createJointApi, createRigidBodyApi, createWorldApi } from "./api";
|
4
|
+
import { ColliderProps } from ".";
|
5
|
+
import { Object3DProps } from "@react-three/fiber";
|
6
|
+
import { Object3D } from "three";
|
4
7
|
export { CoefficientCombineRule as CoefficientCombineRule } from "@dimforge/rapier3d-compat";
|
5
8
|
export { RapierRigidBody, RapierCollider };
|
6
9
|
export declare type RefGetter<T> = MutableRefObject<() => T | undefined>;
|
@@ -66,20 +69,20 @@ export declare type RoundConvexMeshArgs = [
|
|
66
69
|
];
|
67
70
|
export declare type UseBodyOptions = Omit<UseRigidBodyOptions, "shape">;
|
68
71
|
export declare type RigidBodyTypeString = "fixed" | "dynamic" | "kinematicPosition" | "kinematicVelocity";
|
69
|
-
export declare type
|
72
|
+
export declare type ColliderShape = "cuboid" | "trimesh" | "ball" | "capsule" | "convexHull" | "heightfield" | "polyline" | "roundCuboid" | "cylinder" | "roundCylinder" | "cone" | "roundCone" | "convexMesh" | "roundConvexHull" | "roundConvexMesh";
|
70
73
|
export declare type Vector3Array = [x: number, y: number, z: number];
|
71
74
|
export declare type Boolean3Array = [x: boolean, y: boolean, z: boolean];
|
72
|
-
export interface UseColliderOptions<ColliderArgs
|
75
|
+
export interface UseColliderOptions<ColliderArgs extends Array<unknown>> {
|
73
76
|
/**
|
74
77
|
* The shape of your collider
|
75
78
|
*/
|
76
|
-
shape?:
|
79
|
+
shape?: ColliderShape;
|
77
80
|
/**
|
78
81
|
* Arguments to pass to the collider
|
79
82
|
*/
|
80
83
|
args?: ColliderArgs;
|
81
84
|
/**
|
82
|
-
* The mass of this
|
85
|
+
* The mass of this collider.
|
83
86
|
* The mass and density is automatically calculated based on the shape of the collider.
|
84
87
|
* Generally, it's not recommended to adjust the mass properties as it could lead to
|
85
88
|
* unexpected behaviors.
|
@@ -120,6 +123,14 @@ export interface UseColliderOptions<ColliderArgs> {
|
|
120
123
|
* The rotation of this collider relative to the rigid body
|
121
124
|
*/
|
122
125
|
rotation?: Vector3Array;
|
126
|
+
/**
|
127
|
+
* The rotation, as a Quaternion, of this collider relative to the rigid body
|
128
|
+
*/
|
129
|
+
quaternion?: Object3DProps['quaternion'];
|
130
|
+
/**
|
131
|
+
* The scale of this collider relative to the rigid body
|
132
|
+
*/
|
133
|
+
scale?: Object3DProps['scale'];
|
123
134
|
/**
|
124
135
|
* Callback when this collider collides with another collider.
|
125
136
|
*/
|
@@ -128,6 +139,14 @@ export interface UseColliderOptions<ColliderArgs> {
|
|
128
139
|
* Callback when this collider stops colliding with another collider.
|
129
140
|
*/
|
130
141
|
onCollisionExit?: CollisionExitHandler;
|
142
|
+
/**
|
143
|
+
* Callback when this collider, or another collider starts intersecting, and at least one of them is a `sensor`.
|
144
|
+
*/
|
145
|
+
onIntersectionEnter?: IntersectionEnterHandler;
|
146
|
+
/**
|
147
|
+
* Callback when this, or another collider stops intersecting, and at least one of them is a `sensor`.
|
148
|
+
*/
|
149
|
+
onIntersectionExit?: IntersectionExitHandler;
|
131
150
|
/**
|
132
151
|
* The bit mask configuring the groups and mask for collision handling.
|
133
152
|
*/
|
@@ -136,20 +155,36 @@ export interface UseColliderOptions<ColliderArgs> {
|
|
136
155
|
* The bit mask configuring the groups and mask for solver handling.
|
137
156
|
*/
|
138
157
|
solverGroups?: InteractionGroups;
|
158
|
+
/**
|
159
|
+
* Sets the uniform density of this collider.
|
160
|
+
*/
|
161
|
+
density?: number;
|
162
|
+
/**
|
163
|
+
* Sets whether or not this collider is a sensor.
|
164
|
+
*/
|
165
|
+
sensor?: boolean;
|
139
166
|
}
|
140
167
|
export declare type CollisionEnterPayload = {
|
141
|
-
|
168
|
+
rigidBody?: RapierRigidBody;
|
142
169
|
collider: RapierCollider;
|
143
170
|
manifold: TempContactManifold;
|
144
171
|
flipped: boolean;
|
172
|
+
rigidBodyObject?: Object3D;
|
173
|
+
colliderObject?: Object3D;
|
145
174
|
};
|
146
175
|
export declare type CollisionExitPayload = {
|
147
|
-
|
176
|
+
rigidBody?: RapierRigidBody;
|
148
177
|
collider: RapierCollider;
|
178
|
+
rigidBodyObject?: Object3D;
|
179
|
+
colliderObject?: Object3D;
|
149
180
|
};
|
181
|
+
export declare type IntersectionEnterPayload = CollisionExitPayload;
|
182
|
+
export declare type IntersectionExitPayload = CollisionExitPayload;
|
150
183
|
export declare type CollisionEnterHandler = (payload: CollisionEnterPayload) => void;
|
151
184
|
export declare type CollisionExitHandler = (payload: CollisionExitPayload) => void;
|
152
|
-
export
|
185
|
+
export declare type IntersectionEnterHandler = (payload: IntersectionEnterPayload) => void;
|
186
|
+
export declare type IntersectionExitHandler = (payload: IntersectionExitPayload) => void;
|
187
|
+
export interface UseRigidBodyOptions extends ColliderProps {
|
153
188
|
/**
|
154
189
|
* Specify the type of this rigid body
|
155
190
|
*/
|
@@ -162,11 +197,11 @@ export interface UseRigidBodyOptions {
|
|
162
197
|
linearDamping?: number;
|
163
198
|
/** The angular damping coefficient of this rigid-body.*/
|
164
199
|
angularDamping?: number;
|
165
|
-
/** The linear velocity of this body.
|
200
|
+
/** The initial linear velocity of this body.
|
166
201
|
* default: zero velocity
|
167
202
|
*/
|
168
203
|
linearVelocity?: Vector3Array;
|
169
|
-
/** The angular velocity of this body.
|
204
|
+
/** The initial angular velocity of this body.
|
170
205
|
* Default: zero velocity.
|
171
206
|
*/
|
172
207
|
angularVelocity?: Vector3Array;
|
@@ -209,14 +244,6 @@ export interface UseRigidBodyOptions {
|
|
209
244
|
* This does not affect any non-automatic child collider-components.
|
210
245
|
*/
|
211
246
|
restitution?: number;
|
212
|
-
/**
|
213
|
-
* Callback when this rigidbody collides with another rigidbody
|
214
|
-
*/
|
215
|
-
onCollisionEnter?: CollisionEnterHandler;
|
216
|
-
/**
|
217
|
-
* Callback when this rigidbody stops colliding with another rigidbody
|
218
|
-
*/
|
219
|
-
onCollisionExit?: CollisionExitHandler;
|
220
247
|
/**
|
221
248
|
* The default collision groups bitmask for all colliders in this rigid body.
|
222
249
|
* Can be customized per-collider.
|
@@ -245,6 +272,10 @@ export interface UseRigidBodyOptions {
|
|
245
272
|
* Allow rotation of this rigid-body only along specific axes.
|
246
273
|
*/
|
247
274
|
enabledTranslations?: Boolean3Array;
|
275
|
+
/**
|
276
|
+
* Passed down to the object3d representing this collider.
|
277
|
+
*/
|
278
|
+
userData?: Object3DProps['userData'];
|
248
279
|
}
|
249
280
|
export declare type SphericalJointParams = [
|
250
281
|
body1Anchor: Vector3Array,
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Collider, RigidBody } from "@dimforge/rapier3d-compat";
|
2
|
+
import { MutableRefObject } from "react";
|
3
|
+
import { Vector3, Object3D, BufferGeometry } from "three";
|
4
|
+
import { ColliderProps, RigidBodyProps } from ".";
|
5
|
+
import { WorldApi } from "./api";
|
6
|
+
import { ColliderState, ColliderStateMap, EventMap } from "./Physics";
|
7
|
+
import { ColliderShape, RigidBodyAutoCollider } from "./types";
|
8
|
+
export declare const scaleColliderArgs: (shape: ColliderShape, args: (number | ArrayLike<number> | {
|
9
|
+
x: number;
|
10
|
+
y: number;
|
11
|
+
z: number;
|
12
|
+
})[], scale: Vector3) => (number | ArrayLike<number> | {
|
13
|
+
x: number;
|
14
|
+
y: number;
|
15
|
+
z: number;
|
16
|
+
})[];
|
17
|
+
export declare const createColliderFromOptions: (options: ColliderProps, world: WorldApi, scale: Vector3, rigidBody?: RigidBody | undefined) => Collider;
|
18
|
+
declare type ImmutableColliderOptions = (keyof ColliderProps)[];
|
19
|
+
export declare const immutableColliderOptions: ImmutableColliderOptions;
|
20
|
+
export declare const setColliderOptions: (collider: Collider, options: ColliderProps, states: ColliderStateMap) => void;
|
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;
|
23
|
+
interface CreateColliderPropsFromChildren {
|
24
|
+
(options: {
|
25
|
+
object: Object3D;
|
26
|
+
ignoreMeshColliders: boolean;
|
27
|
+
options: RigidBodyProps;
|
28
|
+
}): ColliderProps[];
|
29
|
+
}
|
30
|
+
export declare const createColliderPropsFromChildren: CreateColliderPropsFromChildren;
|
31
|
+
export declare const getColliderArgsFromGeometry: (geometry: BufferGeometry, colliders: RigidBodyAutoCollider) => {
|
32
|
+
args: unknown[];
|
33
|
+
offset: Vector3;
|
34
|
+
};
|
35
|
+
export declare const useColliderEvents: (collidersRef: MutableRefObject<Collider[] | undefined>, props: ColliderProps, events: EventMap) => void;
|
36
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { RigidBody, RigidBodyDesc } from "@dimforge/rapier3d-compat";
|
2
|
+
import { MutableRefObject } from "react";
|
3
|
+
import { Matrix4, Object3D, Vector3 } from "three";
|
4
|
+
import { RigidBodyProps } from ".";
|
5
|
+
import { EventMap, RigidBodyState, RigidBodyStateMap } from "./Physics";
|
6
|
+
export declare const rigidBodyDescFromOptions: (options: RigidBodyProps) => RigidBodyDesc;
|
7
|
+
interface CreateRigidBodyStateOptions {
|
8
|
+
object: Object3D;
|
9
|
+
rigidBody: RigidBody;
|
10
|
+
setMatrix?: (matrix: Matrix4) => void;
|
11
|
+
getMatrix?: (matrix: Matrix4) => Matrix4;
|
12
|
+
worldScale?: Vector3;
|
13
|
+
}
|
14
|
+
export declare const createRigidBodyState: ({ rigidBody, object, setMatrix, getMatrix, worldScale }: CreateRigidBodyStateOptions) => RigidBodyState;
|
15
|
+
declare type ImmutableRigidBodyOptions = (keyof RigidBodyProps)[];
|
16
|
+
export declare const immutableRigidBodyOptions: ImmutableRigidBodyOptions;
|
17
|
+
export declare const setRigidBodyOptions: (rigidBody: RigidBody, options: RigidBodyProps, states: RigidBodyStateMap, updateTranslations?: boolean) => void;
|
18
|
+
export declare const useUpdateRigidBodyOptions: (rigidBodyRef: MutableRefObject<RigidBody | RigidBody[] | undefined>, props: RigidBodyProps, states: RigidBodyStateMap, updateTranslations?: boolean) => void;
|
19
|
+
export declare const useRigidBodyEvents: (rigidBodyRef: MutableRefObject<RigidBody | RigidBody[] | undefined>, props: RigidBodyProps, events: EventMap) => void;
|
20
|
+
export {};
|
@@ -1,50 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { Quaternion as RapierQuaternion, Vector3 as RapierVector3 } from "@dimforge/rapier3d-compat";
|
2
|
+
import { Vector3 } from "three";
|
3
|
+
import { RigidBodyTypeString, Vector3Array } from "./types";
|
4
4
|
export declare const vectorArrayToVector3: (arr: Vector3Array) => Vector3;
|
5
|
-
export declare const vector3ToQuaternion: (v: Vector3) => Quaternion;
|
5
|
+
export declare const vector3ToQuaternion: (v: Vector3) => import("three").Quaternion;
|
6
6
|
export declare const rapierVector3ToVector3: ({ x, y, z }: RapierVector3) => Vector3;
|
7
|
-
export declare const rapierQuaternionToQuaternion: ({ x, y, z, w }: RapierQuaternion) => Quaternion;
|
7
|
+
export declare const rapierQuaternionToQuaternion: ({ x, y, z, w }: RapierQuaternion) => import("three").Quaternion;
|
8
8
|
export declare const rigidBodyTypeFromString: (type: RigidBodyTypeString) => number;
|
9
|
-
export declare const decomposeMatrix4: (m: Matrix4) => {
|
10
|
-
position: Vector3;
|
11
|
-
rotation: Quaternion;
|
12
|
-
scale: Vector3;
|
13
|
-
};
|
14
|
-
export declare const scaleColliderArgs: (shape: RigidBodyShape, args: (number | ArrayLike<number> | {
|
15
|
-
x: number;
|
16
|
-
y: number;
|
17
|
-
z: number;
|
18
|
-
})[], scale: Vector3) => (number | ArrayLike<number> | {
|
19
|
-
x: number;
|
20
|
-
y: number;
|
21
|
-
z: number;
|
22
|
-
})[];
|
23
|
-
interface CreateColliderFromOptions {
|
24
|
-
<ColliderArgs>(options: {
|
25
|
-
options: UseColliderOptions<ColliderArgs>;
|
26
|
-
world: WorldApi;
|
27
|
-
rigidBody?: RigidBody;
|
28
|
-
scale: {
|
29
|
-
x: number;
|
30
|
-
y: number;
|
31
|
-
z: number;
|
32
|
-
};
|
33
|
-
hasCollisionEvents: boolean;
|
34
|
-
}): Collider;
|
35
|
-
}
|
36
|
-
export declare const createColliderFromOptions: CreateColliderFromOptions;
|
37
|
-
interface CreateCollidersFromChildren {
|
38
|
-
(options: {
|
39
|
-
object: Object3D;
|
40
|
-
rigidBody?: Pick<RigidBodyApi | RigidBody, "handle">;
|
41
|
-
options: UseRigidBodyOptions;
|
42
|
-
world: WorldApi;
|
43
|
-
ignoreMeshColliders: boolean;
|
44
|
-
}): Collider[];
|
45
|
-
}
|
46
|
-
export declare const createCollidersFromChildren: CreateCollidersFromChildren;
|
47
|
-
export declare const colliderDescFromGeometry: (geometry: BufferGeometry, colliders: RigidBodyAutoCollider, scale: Vector3, hasCollisionEvents: boolean) => ColliderDesc;
|
48
9
|
export declare const scaleVertices: (vertices: ArrayLike<number>, scale: Vector3) => number[];
|
49
|
-
export declare const rigidBodyDescFromOptions: (options: UseRigidBodyOptions) => RigidBodyDesc;
|
50
|
-
export {};
|