@gg-web-engine/rapier3d 0.0.24
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/README.md +17 -0
- package/dist/components/rapier-3d-rigid-body.component.d.ts +26 -0
- package/dist/components/rapier-3d-rigid-body.component.js +88 -0
- package/dist/components/rapier-3d-trigger.component.d.ts +17 -0
- package/dist/components/rapier-3d-trigger.component.js +41 -0
- package/dist/components/rapier-3d-world.component.d.ts +27 -0
- package/dist/components/rapier-3d-world.component.js +81 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/rapier-3d-factory.d.ts +22 -0
- package/dist/rapier-3d-factory.js +89 -0
- package/dist/rapier-3d-loader.d.ts +6 -0
- package/dist/rapier-3d-loader.js +7 -0
- package/etc/@dimforge/rapier3d/LICENSE +201 -0
- package/etc/@dimforge/rapier3d/README.md +33 -0
- package/etc/@dimforge/rapier3d/coarena.d.ts +15 -0
- package/etc/@dimforge/rapier3d/coarena.js +61 -0
- package/etc/@dimforge/rapier3d/coarena.js.map +1 -0
- package/etc/@dimforge/rapier3d/control/character_controller.d.ts +188 -0
- package/etc/@dimforge/rapier3d/control/character_controller.js +256 -0
- package/etc/@dimforge/rapier3d/control/character_controller.js.map +1 -0
- package/etc/@dimforge/rapier3d/control/index.d.ts +2 -0
- package/etc/@dimforge/rapier3d/control/index.js +5 -0
- package/etc/@dimforge/rapier3d/control/index.js.map +1 -0
- package/etc/@dimforge/rapier3d/control/ray_cast_vehicle_controller.d.ts +240 -0
- package/etc/@dimforge/rapier3d/control/ray_cast_vehicle_controller.js +362 -0
- package/etc/@dimforge/rapier3d/control/ray_cast_vehicle_controller.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/ccd_solver.d.ts +15 -0
- package/etc/@dimforge/rapier3d/dynamics/ccd_solver.js +22 -0
- package/etc/@dimforge/rapier3d/dynamics/ccd_solver.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/coefficient_combine_rule.d.ts +13 -0
- package/etc/@dimforge/rapier3d/dynamics/coefficient_combine_rule.js +15 -0
- package/etc/@dimforge/rapier3d/dynamics/coefficient_combine_rule.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/impulse_joint.d.ts +204 -0
- package/etc/@dimforge/rapier3d/dynamics/impulse_joint.js +335 -0
- package/etc/@dimforge/rapier3d/dynamics/impulse_joint.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/impulse_joint_set.d.ts +79 -0
- package/etc/@dimforge/rapier3d/dynamics/impulse_joint_set.js +123 -0
- package/etc/@dimforge/rapier3d/dynamics/impulse_joint_set.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/index.d.ts +10 -0
- package/etc/@dimforge/rapier3d/dynamics/index.js +11 -0
- package/etc/@dimforge/rapier3d/dynamics/index.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/integration_parameters.d.ts +55 -0
- package/etc/@dimforge/rapier3d/dynamics/integration_parameters.js +98 -0
- package/etc/@dimforge/rapier3d/dynamics/integration_parameters.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/island_manager.d.ts +24 -0
- package/etc/@dimforge/rapier3d/dynamics/island_manager.js +32 -0
- package/etc/@dimforge/rapier3d/dynamics/island_manager.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/multibody_joint.d.ts +42 -0
- package/etc/@dimforge/rapier3d/dynamics/multibody_joint.js +124 -0
- package/etc/@dimforge/rapier3d/dynamics/multibody_joint.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/multibody_joint_set.d.ts +76 -0
- package/etc/@dimforge/rapier3d/dynamics/multibody_joint_set.js +118 -0
- package/etc/@dimforge/rapier3d/dynamics/multibody_joint_set.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/rigid_body.d.ts +679 -0
- package/etc/@dimforge/rapier3d/dynamics/rigid_body.js +960 -0
- package/etc/@dimforge/rapier3d/dynamics/rigid_body.js.map +1 -0
- package/etc/@dimforge/rapier3d/dynamics/rigid_body_set.d.ts +78 -0
- package/etc/@dimforge/rapier3d/dynamics/rigid_body_set.js +147 -0
- package/etc/@dimforge/rapier3d/dynamics/rigid_body_set.js.map +1 -0
- package/etc/@dimforge/rapier3d/exports.d.ts +7 -0
- package/etc/@dimforge/rapier3d/exports.js +11 -0
- package/etc/@dimforge/rapier3d/exports.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/broad_phase.d.ts +15 -0
- package/etc/@dimforge/rapier3d/geometry/broad_phase.js +22 -0
- package/etc/@dimforge/rapier3d/geometry/broad_phase.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/collider.d.ts +763 -0
- package/etc/@dimforge/rapier3d/geometry/collider.js +1140 -0
- package/etc/@dimforge/rapier3d/geometry/collider.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/collider_set.d.ts +72 -0
- package/etc/@dimforge/rapier3d/geometry/collider_set.js +144 -0
- package/etc/@dimforge/rapier3d/geometry/collider_set.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/contact.d.ts +31 -0
- package/etc/@dimforge/rapier3d/geometry/contact.js +21 -0
- package/etc/@dimforge/rapier3d/geometry/contact.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/feature.d.ts +6 -0
- package/etc/@dimforge/rapier3d/geometry/feature.js +10 -0
- package/etc/@dimforge/rapier3d/geometry/feature.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/index.d.ts +11 -0
- package/etc/@dimforge/rapier3d/geometry/index.js +12 -0
- package/etc/@dimforge/rapier3d/geometry/index.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/interaction_groups.d.ts +18 -0
- package/etc/@dimforge/rapier3d/geometry/interaction_groups.js +2 -0
- package/etc/@dimforge/rapier3d/geometry/interaction_groups.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/narrow_phase.d.ts +71 -0
- package/etc/@dimforge/rapier3d/geometry/narrow_phase.js +148 -0
- package/etc/@dimforge/rapier3d/geometry/narrow_phase.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/point.d.ts +47 -0
- package/etc/@dimforge/rapier3d/geometry/point.js +48 -0
- package/etc/@dimforge/rapier3d/geometry/point.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/ray.d.ts +97 -0
- package/etc/@dimforge/rapier3d/geometry/ray.js +100 -0
- package/etc/@dimforge/rapier3d/geometry/ray.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/shape.d.ts +489 -0
- package/etc/@dimforge/rapier3d/geometry/shape.js +686 -0
- package/etc/@dimforge/rapier3d/geometry/shape.js.map +1 -0
- package/etc/@dimforge/rapier3d/geometry/toi.d.ts +46 -0
- package/etc/@dimforge/rapier3d/geometry/toi.js +37 -0
- package/etc/@dimforge/rapier3d/geometry/toi.js.map +1 -0
- package/etc/@dimforge/rapier3d/init.d.ts +1 -0
- package/etc/@dimforge/rapier3d/init.js +2 -0
- package/etc/@dimforge/rapier3d/init.js.map +1 -0
- package/etc/@dimforge/rapier3d/math.d.ts +94 -0
- package/etc/@dimforge/rapier3d/math.js +138 -0
- package/etc/@dimforge/rapier3d/math.js.map +1 -0
- package/etc/@dimforge/rapier3d/package.json +33 -0
- package/etc/@dimforge/rapier3d/pipeline/debug_render_pipeline.d.ts +39 -0
- package/etc/@dimforge/rapier3d/pipeline/debug_render_pipeline.js +38 -0
- package/etc/@dimforge/rapier3d/pipeline/debug_render_pipeline.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/event_queue.d.ts +101 -0
- package/etc/@dimforge/rapier3d/pipeline/event_queue.js +135 -0
- package/etc/@dimforge/rapier3d/pipeline/event_queue.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/index.d.ts +7 -0
- package/etc/@dimforge/rapier3d/pipeline/index.js +8 -0
- package/etc/@dimforge/rapier3d/pipeline/index.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/physics_hooks.d.ts +39 -0
- package/etc/@dimforge/rapier3d/pipeline/physics_hooks.js +13 -0
- package/etc/@dimforge/rapier3d/pipeline/physics_hooks.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/physics_pipeline.d.ts +12 -0
- package/etc/@dimforge/rapier3d/pipeline/physics_pipeline.js +24 -0
- package/etc/@dimforge/rapier3d/pipeline/physics_pipeline.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/query_pipeline.d.ts +190 -0
- package/etc/@dimforge/rapier3d/pipeline/query_pipeline.js +271 -0
- package/etc/@dimforge/rapier3d/pipeline/query_pipeline.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/serialization_pipeline.d.ts +37 -0
- package/etc/@dimforge/rapier3d/pipeline/serialization_pipeline.js +49 -0
- package/etc/@dimforge/rapier3d/pipeline/serialization_pipeline.js.map +1 -0
- package/etc/@dimforge/rapier3d/pipeline/world.d.ts +419 -0
- package/etc/@dimforge/rapier3d/pipeline/world.js +581 -0
- package/etc/@dimforge/rapier3d/pipeline/world.js.map +1 -0
- package/etc/@dimforge/rapier3d/rapier.d.ts +3 -0
- package/etc/@dimforge/rapier3d/rapier.js +4 -0
- package/etc/@dimforge/rapier3d/rapier.js.map +1 -0
- package/etc/@dimforge/rapier3d/rapier_wasm3d.d.ts +2921 -0
- package/etc/@dimforge/rapier3d/rapier_wasm3d.js +2 -0
- package/etc/@dimforge/rapier3d/rapier_wasm3d_bg.js +5585 -0
- package/etc/@dimforge/rapier3d/rapier_wasm3d_bg.wasm +0 -0
- package/etc/@dimforge/rapier3d/rapier_wasm3d_bg.wasm.d.ts +486 -0
- package/etc/@dimforge/rapier3d/raw.d.ts +1 -0
- package/etc/@dimforge/rapier3d/raw.js +2 -0
- package/etc/@dimforge/rapier3d/raw.js.map +1 -0
- package/package.json +43 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,2921 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function version(): string;
|
|
7
|
+
/**
|
|
8
|
+
*/
|
|
9
|
+
export enum RawJointType {
|
|
10
|
+
Revolute,
|
|
11
|
+
Fixed,
|
|
12
|
+
Prismatic,
|
|
13
|
+
Spherical,
|
|
14
|
+
Generic,
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
*/
|
|
18
|
+
export enum RawMotorModel {
|
|
19
|
+
AccelerationBased,
|
|
20
|
+
ForceBased,
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
*/
|
|
24
|
+
export enum RawJointAxis {
|
|
25
|
+
X,
|
|
26
|
+
Y,
|
|
27
|
+
Z,
|
|
28
|
+
AngX,
|
|
29
|
+
AngY,
|
|
30
|
+
AngZ,
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
*/
|
|
34
|
+
export enum RawRigidBodyType {
|
|
35
|
+
Dynamic,
|
|
36
|
+
Fixed,
|
|
37
|
+
KinematicPositionBased,
|
|
38
|
+
KinematicVelocityBased,
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
*/
|
|
42
|
+
export enum RawFeatureType {
|
|
43
|
+
Vertex,
|
|
44
|
+
Edge,
|
|
45
|
+
Face,
|
|
46
|
+
Unknown,
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
*/
|
|
50
|
+
export enum RawShapeType {
|
|
51
|
+
Ball,
|
|
52
|
+
Cuboid,
|
|
53
|
+
Capsule,
|
|
54
|
+
Segment,
|
|
55
|
+
Polyline,
|
|
56
|
+
Triangle,
|
|
57
|
+
TriMesh,
|
|
58
|
+
HeightField,
|
|
59
|
+
Compound,
|
|
60
|
+
ConvexPolyhedron,
|
|
61
|
+
Cylinder,
|
|
62
|
+
Cone,
|
|
63
|
+
RoundCuboid,
|
|
64
|
+
RoundTriangle,
|
|
65
|
+
RoundCylinder,
|
|
66
|
+
RoundCone,
|
|
67
|
+
RoundConvexPolyhedron,
|
|
68
|
+
HalfSpace,
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
*/
|
|
72
|
+
export class RawBroadPhase {
|
|
73
|
+
free(): void;
|
|
74
|
+
/**
|
|
75
|
+
*/
|
|
76
|
+
constructor();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
*/
|
|
80
|
+
export class RawCCDSolver {
|
|
81
|
+
free(): void;
|
|
82
|
+
/**
|
|
83
|
+
*/
|
|
84
|
+
constructor();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
*/
|
|
88
|
+
export class RawCharacterCollision {
|
|
89
|
+
free(): void;
|
|
90
|
+
/**
|
|
91
|
+
*/
|
|
92
|
+
constructor();
|
|
93
|
+
/**
|
|
94
|
+
* @returns {number}
|
|
95
|
+
*/
|
|
96
|
+
handle(): number;
|
|
97
|
+
/**
|
|
98
|
+
* @returns {RawVector}
|
|
99
|
+
*/
|
|
100
|
+
translationDeltaApplied(): RawVector;
|
|
101
|
+
/**
|
|
102
|
+
* @returns {RawVector}
|
|
103
|
+
*/
|
|
104
|
+
translationDeltaRemaining(): RawVector;
|
|
105
|
+
/**
|
|
106
|
+
* @returns {number}
|
|
107
|
+
*/
|
|
108
|
+
toi(): number;
|
|
109
|
+
/**
|
|
110
|
+
* @returns {RawVector}
|
|
111
|
+
*/
|
|
112
|
+
worldWitness1(): RawVector;
|
|
113
|
+
/**
|
|
114
|
+
* @returns {RawVector}
|
|
115
|
+
*/
|
|
116
|
+
worldWitness2(): RawVector;
|
|
117
|
+
/**
|
|
118
|
+
* @returns {RawVector}
|
|
119
|
+
*/
|
|
120
|
+
worldNormal1(): RawVector;
|
|
121
|
+
/**
|
|
122
|
+
* @returns {RawVector}
|
|
123
|
+
*/
|
|
124
|
+
worldNormal2(): RawVector;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
*/
|
|
128
|
+
export class RawColliderSet {
|
|
129
|
+
free(): void;
|
|
130
|
+
/**
|
|
131
|
+
* The world-space translation of this collider.
|
|
132
|
+
* @param {number} handle
|
|
133
|
+
* @returns {RawVector}
|
|
134
|
+
*/
|
|
135
|
+
coTranslation(handle: number): RawVector;
|
|
136
|
+
/**
|
|
137
|
+
* The world-space orientation of this collider.
|
|
138
|
+
* @param {number} handle
|
|
139
|
+
* @returns {RawRotation}
|
|
140
|
+
*/
|
|
141
|
+
coRotation(handle: number): RawRotation;
|
|
142
|
+
/**
|
|
143
|
+
* Sets the translation of this collider.
|
|
144
|
+
*
|
|
145
|
+
* # Parameters
|
|
146
|
+
* - `x`: the world-space position of the collider along the `x` axis.
|
|
147
|
+
* - `y`: the world-space position of the collider along the `y` axis.
|
|
148
|
+
* - `z`: the world-space position of the collider along the `z` axis.
|
|
149
|
+
* - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it
|
|
150
|
+
* wasn't moving before modifying its position.
|
|
151
|
+
* @param {number} handle
|
|
152
|
+
* @param {number} x
|
|
153
|
+
* @param {number} y
|
|
154
|
+
* @param {number} z
|
|
155
|
+
*/
|
|
156
|
+
coSetTranslation(handle: number, x: number, y: number, z: number): void;
|
|
157
|
+
/**
|
|
158
|
+
* @param {number} handle
|
|
159
|
+
* @param {number} x
|
|
160
|
+
* @param {number} y
|
|
161
|
+
* @param {number} z
|
|
162
|
+
*/
|
|
163
|
+
coSetTranslationWrtParent(handle: number, x: number, y: number, z: number): void;
|
|
164
|
+
/**
|
|
165
|
+
* Sets the rotation quaternion of this collider.
|
|
166
|
+
*
|
|
167
|
+
* This does nothing if a zero quaternion is provided.
|
|
168
|
+
*
|
|
169
|
+
* # Parameters
|
|
170
|
+
* - `x`: the first vector component of the quaternion.
|
|
171
|
+
* - `y`: the second vector component of the quaternion.
|
|
172
|
+
* - `z`: the third vector component of the quaternion.
|
|
173
|
+
* - `w`: the scalar component of the quaternion.
|
|
174
|
+
* - `wakeUp`: forces the collider to wake-up so it is properly affected by forces if it
|
|
175
|
+
* wasn't moving before modifying its position.
|
|
176
|
+
* @param {number} handle
|
|
177
|
+
* @param {number} x
|
|
178
|
+
* @param {number} y
|
|
179
|
+
* @param {number} z
|
|
180
|
+
* @param {number} w
|
|
181
|
+
*/
|
|
182
|
+
coSetRotation(handle: number, x: number, y: number, z: number, w: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* @param {number} handle
|
|
185
|
+
* @param {number} x
|
|
186
|
+
* @param {number} y
|
|
187
|
+
* @param {number} z
|
|
188
|
+
* @param {number} w
|
|
189
|
+
*/
|
|
190
|
+
coSetRotationWrtParent(handle: number, x: number, y: number, z: number, w: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* Is this collider a sensor?
|
|
193
|
+
* @param {number} handle
|
|
194
|
+
* @returns {boolean}
|
|
195
|
+
*/
|
|
196
|
+
coIsSensor(handle: number): boolean;
|
|
197
|
+
/**
|
|
198
|
+
* The type of the shape of this collider.
|
|
199
|
+
* @param {number} handle
|
|
200
|
+
* @returns {number}
|
|
201
|
+
*/
|
|
202
|
+
coShapeType(handle: number): number;
|
|
203
|
+
/**
|
|
204
|
+
* @param {number} handle
|
|
205
|
+
* @returns {RawVector | undefined}
|
|
206
|
+
*/
|
|
207
|
+
coHalfspaceNormal(handle: number): RawVector | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* The half-extents of this collider if it is has a cuboid shape.
|
|
210
|
+
* @param {number} handle
|
|
211
|
+
* @returns {RawVector | undefined}
|
|
212
|
+
*/
|
|
213
|
+
coHalfExtents(handle: number): RawVector | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Set the half-extents of this collider if it has a cuboid shape.
|
|
216
|
+
* @param {number} handle
|
|
217
|
+
* @param {RawVector} newHalfExtents
|
|
218
|
+
*/
|
|
219
|
+
coSetHalfExtents(handle: number, newHalfExtents: RawVector): void;
|
|
220
|
+
/**
|
|
221
|
+
* The radius of this collider if it is a ball, capsule, cylinder, or cone shape.
|
|
222
|
+
* @param {number} handle
|
|
223
|
+
* @returns {number | undefined}
|
|
224
|
+
*/
|
|
225
|
+
coRadius(handle: number): number | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* Set the radius of this collider if it is a ball, capsule, cylinder, or cone shape.
|
|
228
|
+
* @param {number} handle
|
|
229
|
+
* @param {number} newRadius
|
|
230
|
+
*/
|
|
231
|
+
coSetRadius(handle: number, newRadius: number): void;
|
|
232
|
+
/**
|
|
233
|
+
* The half height of this collider if it is a capsule, cylinder, or cone shape.
|
|
234
|
+
* @param {number} handle
|
|
235
|
+
* @returns {number | undefined}
|
|
236
|
+
*/
|
|
237
|
+
coHalfHeight(handle: number): number | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Set the half height of this collider if it is a capsule, cylinder, or cone shape.
|
|
240
|
+
* @param {number} handle
|
|
241
|
+
* @param {number} newHalfheight
|
|
242
|
+
*/
|
|
243
|
+
coSetHalfHeight(handle: number, newHalfheight: number): void;
|
|
244
|
+
/**
|
|
245
|
+
* The radius of the round edges of this collider.
|
|
246
|
+
* @param {number} handle
|
|
247
|
+
* @returns {number | undefined}
|
|
248
|
+
*/
|
|
249
|
+
coRoundRadius(handle: number): number | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* Set the radius of the round edges of this collider.
|
|
252
|
+
* @param {number} handle
|
|
253
|
+
* @param {number} newBorderRadius
|
|
254
|
+
*/
|
|
255
|
+
coSetRoundRadius(handle: number, newBorderRadius: number): void;
|
|
256
|
+
/**
|
|
257
|
+
* The vertices of this triangle mesh, polyline, convex polyhedron, segment, triangle or convex polyhedron, if it is one.
|
|
258
|
+
* @param {number} handle
|
|
259
|
+
* @returns {Float32Array | undefined}
|
|
260
|
+
*/
|
|
261
|
+
coVertices(handle: number): Float32Array | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* The indices of this triangle mesh, polyline, or convex polyhedron, if it is one.
|
|
264
|
+
* @param {number} handle
|
|
265
|
+
* @returns {Uint32Array | undefined}
|
|
266
|
+
*/
|
|
267
|
+
coIndices(handle: number): Uint32Array | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* The height of this heightfield if it is one.
|
|
270
|
+
* @param {number} handle
|
|
271
|
+
* @returns {Float32Array | undefined}
|
|
272
|
+
*/
|
|
273
|
+
coHeightfieldHeights(handle: number): Float32Array | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* The scaling factor applied of this heightfield if it is one.
|
|
276
|
+
* @param {number} handle
|
|
277
|
+
* @returns {RawVector | undefined}
|
|
278
|
+
*/
|
|
279
|
+
coHeightfieldScale(handle: number): RawVector | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* The number of rows on this heightfield's height matrix, if it is one.
|
|
282
|
+
* @param {number} handle
|
|
283
|
+
* @returns {number | undefined}
|
|
284
|
+
*/
|
|
285
|
+
coHeightfieldNRows(handle: number): number | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* The number of columns on this heightfield's height matrix, if it is one.
|
|
288
|
+
* @param {number} handle
|
|
289
|
+
* @returns {number | undefined}
|
|
290
|
+
*/
|
|
291
|
+
coHeightfieldNCols(handle: number): number | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* The unique integer identifier of the collider this collider is attached to.
|
|
294
|
+
* @param {number} handle
|
|
295
|
+
* @returns {number | undefined}
|
|
296
|
+
*/
|
|
297
|
+
coParent(handle: number): number | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* @param {number} handle
|
|
300
|
+
* @param {boolean} enabled
|
|
301
|
+
*/
|
|
302
|
+
coSetEnabled(handle: number, enabled: boolean): void;
|
|
303
|
+
/**
|
|
304
|
+
* @param {number} handle
|
|
305
|
+
* @returns {boolean}
|
|
306
|
+
*/
|
|
307
|
+
coIsEnabled(handle: number): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* The friction coefficient of this collider.
|
|
310
|
+
* @param {number} handle
|
|
311
|
+
* @returns {number}
|
|
312
|
+
*/
|
|
313
|
+
coFriction(handle: number): number;
|
|
314
|
+
/**
|
|
315
|
+
* The restitution coefficient of this collider.
|
|
316
|
+
* @param {number} handle
|
|
317
|
+
* @returns {number}
|
|
318
|
+
*/
|
|
319
|
+
coRestitution(handle: number): number;
|
|
320
|
+
/**
|
|
321
|
+
* The density of this collider.
|
|
322
|
+
* @param {number} handle
|
|
323
|
+
* @returns {number}
|
|
324
|
+
*/
|
|
325
|
+
coDensity(handle: number): number;
|
|
326
|
+
/**
|
|
327
|
+
* The mass of this collider.
|
|
328
|
+
* @param {number} handle
|
|
329
|
+
* @returns {number}
|
|
330
|
+
*/
|
|
331
|
+
coMass(handle: number): number;
|
|
332
|
+
/**
|
|
333
|
+
* The volume of this collider.
|
|
334
|
+
* @param {number} handle
|
|
335
|
+
* @returns {number}
|
|
336
|
+
*/
|
|
337
|
+
coVolume(handle: number): number;
|
|
338
|
+
/**
|
|
339
|
+
* The collision groups of this collider.
|
|
340
|
+
* @param {number} handle
|
|
341
|
+
* @returns {number}
|
|
342
|
+
*/
|
|
343
|
+
coCollisionGroups(handle: number): number;
|
|
344
|
+
/**
|
|
345
|
+
* The solver groups of this collider.
|
|
346
|
+
* @param {number} handle
|
|
347
|
+
* @returns {number}
|
|
348
|
+
*/
|
|
349
|
+
coSolverGroups(handle: number): number;
|
|
350
|
+
/**
|
|
351
|
+
* The physics hooks enabled for this collider.
|
|
352
|
+
* @param {number} handle
|
|
353
|
+
* @returns {number}
|
|
354
|
+
*/
|
|
355
|
+
coActiveHooks(handle: number): number;
|
|
356
|
+
/**
|
|
357
|
+
* The collision types enabled for this collider.
|
|
358
|
+
* @param {number} handle
|
|
359
|
+
* @returns {number}
|
|
360
|
+
*/
|
|
361
|
+
coActiveCollisionTypes(handle: number): number;
|
|
362
|
+
/**
|
|
363
|
+
* The events enabled for this collider.
|
|
364
|
+
* @param {number} handle
|
|
365
|
+
* @returns {number}
|
|
366
|
+
*/
|
|
367
|
+
coActiveEvents(handle: number): number;
|
|
368
|
+
/**
|
|
369
|
+
* The total force magnitude beyond which a contact force event can be emitted.
|
|
370
|
+
* @param {number} handle
|
|
371
|
+
* @returns {number}
|
|
372
|
+
*/
|
|
373
|
+
coContactForceEventThreshold(handle: number): number;
|
|
374
|
+
/**
|
|
375
|
+
* @param {number} handle
|
|
376
|
+
* @param {RawVector} point
|
|
377
|
+
* @returns {boolean}
|
|
378
|
+
*/
|
|
379
|
+
coContainsPoint(handle: number, point: RawVector): boolean;
|
|
380
|
+
/**
|
|
381
|
+
* @param {number} handle
|
|
382
|
+
* @param {RawVector} colliderVel
|
|
383
|
+
* @param {RawShape} shape2
|
|
384
|
+
* @param {RawVector} shape2Pos
|
|
385
|
+
* @param {RawRotation} shape2Rot
|
|
386
|
+
* @param {RawVector} shape2Vel
|
|
387
|
+
* @param {number} maxToi
|
|
388
|
+
* @param {boolean} stop_at_penetration
|
|
389
|
+
* @returns {RawShapeTOI | undefined}
|
|
390
|
+
*/
|
|
391
|
+
coCastShape(handle: number, colliderVel: RawVector, shape2: RawShape, shape2Pos: RawVector, shape2Rot: RawRotation, shape2Vel: RawVector, maxToi: number, stop_at_penetration: boolean): RawShapeTOI | undefined;
|
|
392
|
+
/**
|
|
393
|
+
* @param {number} handle
|
|
394
|
+
* @param {RawVector} collider1Vel
|
|
395
|
+
* @param {number} collider2handle
|
|
396
|
+
* @param {RawVector} collider2Vel
|
|
397
|
+
* @param {number} max_toi
|
|
398
|
+
* @param {boolean} stop_at_penetration
|
|
399
|
+
* @returns {RawShapeColliderTOI | undefined}
|
|
400
|
+
*/
|
|
401
|
+
coCastCollider(handle: number, collider1Vel: RawVector, collider2handle: number, collider2Vel: RawVector, max_toi: number, stop_at_penetration: boolean): RawShapeColliderTOI | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* @param {number} handle
|
|
404
|
+
* @param {RawShape} shape2
|
|
405
|
+
* @param {RawVector} shapePos2
|
|
406
|
+
* @param {RawRotation} shapeRot2
|
|
407
|
+
* @returns {boolean}
|
|
408
|
+
*/
|
|
409
|
+
coIntersectsShape(handle: number, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation): boolean;
|
|
410
|
+
/**
|
|
411
|
+
* @param {number} handle
|
|
412
|
+
* @param {RawShape} shape2
|
|
413
|
+
* @param {RawVector} shapePos2
|
|
414
|
+
* @param {RawRotation} shapeRot2
|
|
415
|
+
* @param {number} prediction
|
|
416
|
+
* @returns {RawShapeContact | undefined}
|
|
417
|
+
*/
|
|
418
|
+
coContactShape(handle: number, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation, prediction: number): RawShapeContact | undefined;
|
|
419
|
+
/**
|
|
420
|
+
* @param {number} handle
|
|
421
|
+
* @param {number} collider2handle
|
|
422
|
+
* @param {number} prediction
|
|
423
|
+
* @returns {RawShapeContact | undefined}
|
|
424
|
+
*/
|
|
425
|
+
coContactCollider(handle: number, collider2handle: number, prediction: number): RawShapeContact | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* @param {number} handle
|
|
428
|
+
* @param {RawVector} point
|
|
429
|
+
* @param {boolean} solid
|
|
430
|
+
* @returns {RawPointProjection}
|
|
431
|
+
*/
|
|
432
|
+
coProjectPoint(handle: number, point: RawVector, solid: boolean): RawPointProjection;
|
|
433
|
+
/**
|
|
434
|
+
* @param {number} handle
|
|
435
|
+
* @param {RawVector} rayOrig
|
|
436
|
+
* @param {RawVector} rayDir
|
|
437
|
+
* @param {number} maxToi
|
|
438
|
+
* @returns {boolean}
|
|
439
|
+
*/
|
|
440
|
+
coIntersectsRay(handle: number, rayOrig: RawVector, rayDir: RawVector, maxToi: number): boolean;
|
|
441
|
+
/**
|
|
442
|
+
* @param {number} handle
|
|
443
|
+
* @param {RawVector} rayOrig
|
|
444
|
+
* @param {RawVector} rayDir
|
|
445
|
+
* @param {number} maxToi
|
|
446
|
+
* @param {boolean} solid
|
|
447
|
+
* @returns {number}
|
|
448
|
+
*/
|
|
449
|
+
coCastRay(handle: number, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): number;
|
|
450
|
+
/**
|
|
451
|
+
* @param {number} handle
|
|
452
|
+
* @param {RawVector} rayOrig
|
|
453
|
+
* @param {RawVector} rayDir
|
|
454
|
+
* @param {number} maxToi
|
|
455
|
+
* @param {boolean} solid
|
|
456
|
+
* @returns {RawRayIntersection | undefined}
|
|
457
|
+
*/
|
|
458
|
+
coCastRayAndGetNormal(handle: number, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): RawRayIntersection | undefined;
|
|
459
|
+
/**
|
|
460
|
+
* @param {number} handle
|
|
461
|
+
* @param {boolean} is_sensor
|
|
462
|
+
*/
|
|
463
|
+
coSetSensor(handle: number, is_sensor: boolean): void;
|
|
464
|
+
/**
|
|
465
|
+
* @param {number} handle
|
|
466
|
+
* @param {number} restitution
|
|
467
|
+
*/
|
|
468
|
+
coSetRestitution(handle: number, restitution: number): void;
|
|
469
|
+
/**
|
|
470
|
+
* @param {number} handle
|
|
471
|
+
* @param {number} friction
|
|
472
|
+
*/
|
|
473
|
+
coSetFriction(handle: number, friction: number): void;
|
|
474
|
+
/**
|
|
475
|
+
* @param {number} handle
|
|
476
|
+
* @returns {number}
|
|
477
|
+
*/
|
|
478
|
+
coFrictionCombineRule(handle: number): number;
|
|
479
|
+
/**
|
|
480
|
+
* @param {number} handle
|
|
481
|
+
* @param {number} rule
|
|
482
|
+
*/
|
|
483
|
+
coSetFrictionCombineRule(handle: number, rule: number): void;
|
|
484
|
+
/**
|
|
485
|
+
* @param {number} handle
|
|
486
|
+
* @returns {number}
|
|
487
|
+
*/
|
|
488
|
+
coRestitutionCombineRule(handle: number): number;
|
|
489
|
+
/**
|
|
490
|
+
* @param {number} handle
|
|
491
|
+
* @param {number} rule
|
|
492
|
+
*/
|
|
493
|
+
coSetRestitutionCombineRule(handle: number, rule: number): void;
|
|
494
|
+
/**
|
|
495
|
+
* @param {number} handle
|
|
496
|
+
* @param {number} groups
|
|
497
|
+
*/
|
|
498
|
+
coSetCollisionGroups(handle: number, groups: number): void;
|
|
499
|
+
/**
|
|
500
|
+
* @param {number} handle
|
|
501
|
+
* @param {number} groups
|
|
502
|
+
*/
|
|
503
|
+
coSetSolverGroups(handle: number, groups: number): void;
|
|
504
|
+
/**
|
|
505
|
+
* @param {number} handle
|
|
506
|
+
* @param {number} hooks
|
|
507
|
+
*/
|
|
508
|
+
coSetActiveHooks(handle: number, hooks: number): void;
|
|
509
|
+
/**
|
|
510
|
+
* @param {number} handle
|
|
511
|
+
* @param {number} events
|
|
512
|
+
*/
|
|
513
|
+
coSetActiveEvents(handle: number, events: number): void;
|
|
514
|
+
/**
|
|
515
|
+
* @param {number} handle
|
|
516
|
+
* @param {number} types
|
|
517
|
+
*/
|
|
518
|
+
coSetActiveCollisionTypes(handle: number, types: number): void;
|
|
519
|
+
/**
|
|
520
|
+
* @param {number} handle
|
|
521
|
+
* @param {RawShape} shape
|
|
522
|
+
*/
|
|
523
|
+
coSetShape(handle: number, shape: RawShape): void;
|
|
524
|
+
/**
|
|
525
|
+
* @param {number} handle
|
|
526
|
+
* @param {number} threshold
|
|
527
|
+
*/
|
|
528
|
+
coSetContactForceEventThreshold(handle: number, threshold: number): void;
|
|
529
|
+
/**
|
|
530
|
+
* @param {number} handle
|
|
531
|
+
* @param {number} density
|
|
532
|
+
*/
|
|
533
|
+
coSetDensity(handle: number, density: number): void;
|
|
534
|
+
/**
|
|
535
|
+
* @param {number} handle
|
|
536
|
+
* @param {number} mass
|
|
537
|
+
*/
|
|
538
|
+
coSetMass(handle: number, mass: number): void;
|
|
539
|
+
/**
|
|
540
|
+
* @param {number} handle
|
|
541
|
+
* @param {number} mass
|
|
542
|
+
* @param {RawVector} centerOfMass
|
|
543
|
+
* @param {RawVector} principalAngularInertia
|
|
544
|
+
* @param {RawRotation} angularInertiaFrame
|
|
545
|
+
*/
|
|
546
|
+
coSetMassProperties(handle: number, mass: number, centerOfMass: RawVector, principalAngularInertia: RawVector, angularInertiaFrame: RawRotation): void;
|
|
547
|
+
/**
|
|
548
|
+
*/
|
|
549
|
+
constructor();
|
|
550
|
+
/**
|
|
551
|
+
* @returns {number}
|
|
552
|
+
*/
|
|
553
|
+
len(): number;
|
|
554
|
+
/**
|
|
555
|
+
* @param {number} handle
|
|
556
|
+
* @returns {boolean}
|
|
557
|
+
*/
|
|
558
|
+
contains(handle: number): boolean;
|
|
559
|
+
/**
|
|
560
|
+
* @param {boolean} enabled
|
|
561
|
+
* @param {RawShape} shape
|
|
562
|
+
* @param {RawVector} translation
|
|
563
|
+
* @param {RawRotation} rotation
|
|
564
|
+
* @param {number} massPropsMode
|
|
565
|
+
* @param {number} mass
|
|
566
|
+
* @param {RawVector} centerOfMass
|
|
567
|
+
* @param {RawVector} principalAngularInertia
|
|
568
|
+
* @param {RawRotation} angularInertiaFrame
|
|
569
|
+
* @param {number} density
|
|
570
|
+
* @param {number} friction
|
|
571
|
+
* @param {number} restitution
|
|
572
|
+
* @param {number} frictionCombineRule
|
|
573
|
+
* @param {number} restitutionCombineRule
|
|
574
|
+
* @param {boolean} isSensor
|
|
575
|
+
* @param {number} collisionGroups
|
|
576
|
+
* @param {number} solverGroups
|
|
577
|
+
* @param {number} activeCollisionTypes
|
|
578
|
+
* @param {number} activeHooks
|
|
579
|
+
* @param {number} activeEvents
|
|
580
|
+
* @param {number} contactForceEventThreshold
|
|
581
|
+
* @param {boolean} hasParent
|
|
582
|
+
* @param {number} parent
|
|
583
|
+
* @param {RawRigidBodySet} bodies
|
|
584
|
+
* @returns {number | undefined}
|
|
585
|
+
*/
|
|
586
|
+
createCollider(enabled: boolean, shape: RawShape, translation: RawVector, rotation: RawRotation, massPropsMode: number, mass: number, centerOfMass: RawVector, principalAngularInertia: RawVector, angularInertiaFrame: RawRotation, density: number, friction: number, restitution: number, frictionCombineRule: number, restitutionCombineRule: number, isSensor: boolean, collisionGroups: number, solverGroups: number, activeCollisionTypes: number, activeHooks: number, activeEvents: number, contactForceEventThreshold: number, hasParent: boolean, parent: number, bodies: RawRigidBodySet): number | undefined;
|
|
587
|
+
/**
|
|
588
|
+
* Removes a collider from this set and wake-up the rigid-body it is attached to.
|
|
589
|
+
* @param {number} handle
|
|
590
|
+
* @param {RawIslandManager} islands
|
|
591
|
+
* @param {RawRigidBodySet} bodies
|
|
592
|
+
* @param {boolean} wakeUp
|
|
593
|
+
*/
|
|
594
|
+
remove(handle: number, islands: RawIslandManager, bodies: RawRigidBodySet, wakeUp: boolean): void;
|
|
595
|
+
/**
|
|
596
|
+
* Checks if a collider with the given integer handle exists.
|
|
597
|
+
* @param {number} handle
|
|
598
|
+
* @returns {boolean}
|
|
599
|
+
*/
|
|
600
|
+
isHandleValid(handle: number): boolean;
|
|
601
|
+
/**
|
|
602
|
+
* Applies the given JavaScript function to the integer handle of each collider managed by this collider set.
|
|
603
|
+
*
|
|
604
|
+
* # Parameters
|
|
605
|
+
* - `f(handle)`: the function to apply to the integer handle of each collider managed by this collider set. Called as `f(handle)`.
|
|
606
|
+
* @param {Function} f
|
|
607
|
+
*/
|
|
608
|
+
forEachColliderHandle(f: Function): void;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
*/
|
|
612
|
+
export class RawContactForceEvent {
|
|
613
|
+
free(): void;
|
|
614
|
+
/**
|
|
615
|
+
* The first collider involved in the contact.
|
|
616
|
+
* @returns {number}
|
|
617
|
+
*/
|
|
618
|
+
collider1(): number;
|
|
619
|
+
/**
|
|
620
|
+
* The second collider involved in the contact.
|
|
621
|
+
* @returns {number}
|
|
622
|
+
*/
|
|
623
|
+
collider2(): number;
|
|
624
|
+
/**
|
|
625
|
+
* The sum of all the forces between the two colliders.
|
|
626
|
+
* @returns {RawVector}
|
|
627
|
+
*/
|
|
628
|
+
total_force(): RawVector;
|
|
629
|
+
/**
|
|
630
|
+
* The sum of the magnitudes of each force between the two colliders.
|
|
631
|
+
*
|
|
632
|
+
* Note that this is **not** the same as the magnitude of `self.total_force`.
|
|
633
|
+
* Here we are summing the magnitude of all the forces, instead of taking
|
|
634
|
+
* the magnitude of their sum.
|
|
635
|
+
* @returns {number}
|
|
636
|
+
*/
|
|
637
|
+
total_force_magnitude(): number;
|
|
638
|
+
/**
|
|
639
|
+
* The world-space (unit) direction of the force with strongest magnitude.
|
|
640
|
+
* @returns {RawVector}
|
|
641
|
+
*/
|
|
642
|
+
max_force_direction(): RawVector;
|
|
643
|
+
/**
|
|
644
|
+
* The magnitude of the largest force at a contact point of this contact pair.
|
|
645
|
+
* @returns {number}
|
|
646
|
+
*/
|
|
647
|
+
max_force_magnitude(): number;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
*/
|
|
651
|
+
export class RawContactManifold {
|
|
652
|
+
free(): void;
|
|
653
|
+
/**
|
|
654
|
+
* @returns {RawVector}
|
|
655
|
+
*/
|
|
656
|
+
normal(): RawVector;
|
|
657
|
+
/**
|
|
658
|
+
* @returns {RawVector}
|
|
659
|
+
*/
|
|
660
|
+
local_n1(): RawVector;
|
|
661
|
+
/**
|
|
662
|
+
* @returns {RawVector}
|
|
663
|
+
*/
|
|
664
|
+
local_n2(): RawVector;
|
|
665
|
+
/**
|
|
666
|
+
* @returns {number}
|
|
667
|
+
*/
|
|
668
|
+
subshape1(): number;
|
|
669
|
+
/**
|
|
670
|
+
* @returns {number}
|
|
671
|
+
*/
|
|
672
|
+
subshape2(): number;
|
|
673
|
+
/**
|
|
674
|
+
* @returns {number}
|
|
675
|
+
*/
|
|
676
|
+
num_contacts(): number;
|
|
677
|
+
/**
|
|
678
|
+
* @param {number} i
|
|
679
|
+
* @returns {RawVector | undefined}
|
|
680
|
+
*/
|
|
681
|
+
contact_local_p1(i: number): RawVector | undefined;
|
|
682
|
+
/**
|
|
683
|
+
* @param {number} i
|
|
684
|
+
* @returns {RawVector | undefined}
|
|
685
|
+
*/
|
|
686
|
+
contact_local_p2(i: number): RawVector | undefined;
|
|
687
|
+
/**
|
|
688
|
+
* @param {number} i
|
|
689
|
+
* @returns {number}
|
|
690
|
+
*/
|
|
691
|
+
contact_dist(i: number): number;
|
|
692
|
+
/**
|
|
693
|
+
* @param {number} i
|
|
694
|
+
* @returns {number}
|
|
695
|
+
*/
|
|
696
|
+
contact_fid1(i: number): number;
|
|
697
|
+
/**
|
|
698
|
+
* @param {number} i
|
|
699
|
+
* @returns {number}
|
|
700
|
+
*/
|
|
701
|
+
contact_fid2(i: number): number;
|
|
702
|
+
/**
|
|
703
|
+
* @param {number} i
|
|
704
|
+
* @returns {number}
|
|
705
|
+
*/
|
|
706
|
+
contact_impulse(i: number): number;
|
|
707
|
+
/**
|
|
708
|
+
* @param {number} i
|
|
709
|
+
* @returns {number}
|
|
710
|
+
*/
|
|
711
|
+
contact_tangent_impulse_x(i: number): number;
|
|
712
|
+
/**
|
|
713
|
+
* @param {number} i
|
|
714
|
+
* @returns {number}
|
|
715
|
+
*/
|
|
716
|
+
contact_tangent_impulse_y(i: number): number;
|
|
717
|
+
/**
|
|
718
|
+
* @returns {number}
|
|
719
|
+
*/
|
|
720
|
+
num_solver_contacts(): number;
|
|
721
|
+
/**
|
|
722
|
+
* @param {number} i
|
|
723
|
+
* @returns {RawVector | undefined}
|
|
724
|
+
*/
|
|
725
|
+
solver_contact_point(i: number): RawVector | undefined;
|
|
726
|
+
/**
|
|
727
|
+
* @param {number} i
|
|
728
|
+
* @returns {number}
|
|
729
|
+
*/
|
|
730
|
+
solver_contact_dist(i: number): number;
|
|
731
|
+
/**
|
|
732
|
+
* @param {number} i
|
|
733
|
+
* @returns {number}
|
|
734
|
+
*/
|
|
735
|
+
solver_contact_friction(i: number): number;
|
|
736
|
+
/**
|
|
737
|
+
* @param {number} i
|
|
738
|
+
* @returns {number}
|
|
739
|
+
*/
|
|
740
|
+
solver_contact_restitution(i: number): number;
|
|
741
|
+
/**
|
|
742
|
+
* @param {number} i
|
|
743
|
+
* @returns {RawVector}
|
|
744
|
+
*/
|
|
745
|
+
solver_contact_tangent_velocity(i: number): RawVector;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
*/
|
|
749
|
+
export class RawContactPair {
|
|
750
|
+
free(): void;
|
|
751
|
+
/**
|
|
752
|
+
* @returns {number}
|
|
753
|
+
*/
|
|
754
|
+
collider1(): number;
|
|
755
|
+
/**
|
|
756
|
+
* @returns {number}
|
|
757
|
+
*/
|
|
758
|
+
collider2(): number;
|
|
759
|
+
/**
|
|
760
|
+
* @returns {number}
|
|
761
|
+
*/
|
|
762
|
+
numContactManifolds(): number;
|
|
763
|
+
/**
|
|
764
|
+
* @param {number} i
|
|
765
|
+
* @returns {RawContactManifold | undefined}
|
|
766
|
+
*/
|
|
767
|
+
contactManifold(i: number): RawContactManifold | undefined;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
*/
|
|
771
|
+
export class RawDebugRenderPipeline {
|
|
772
|
+
free(): void;
|
|
773
|
+
/**
|
|
774
|
+
*/
|
|
775
|
+
constructor();
|
|
776
|
+
/**
|
|
777
|
+
* @returns {Float32Array}
|
|
778
|
+
*/
|
|
779
|
+
vertices(): Float32Array;
|
|
780
|
+
/**
|
|
781
|
+
* @returns {Float32Array}
|
|
782
|
+
*/
|
|
783
|
+
colors(): Float32Array;
|
|
784
|
+
/**
|
|
785
|
+
* @param {RawRigidBodySet} bodies
|
|
786
|
+
* @param {RawColliderSet} colliders
|
|
787
|
+
* @param {RawImpulseJointSet} impulse_joints
|
|
788
|
+
* @param {RawMultibodyJointSet} multibody_joints
|
|
789
|
+
* @param {RawNarrowPhase} narrow_phase
|
|
790
|
+
*/
|
|
791
|
+
render(bodies: RawRigidBodySet, colliders: RawColliderSet, impulse_joints: RawImpulseJointSet, multibody_joints: RawMultibodyJointSet, narrow_phase: RawNarrowPhase): void;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
*/
|
|
795
|
+
export class RawDeserializedWorld {
|
|
796
|
+
free(): void;
|
|
797
|
+
/**
|
|
798
|
+
* @returns {RawVector | undefined}
|
|
799
|
+
*/
|
|
800
|
+
takeGravity(): RawVector | undefined;
|
|
801
|
+
/**
|
|
802
|
+
* @returns {RawIntegrationParameters | undefined}
|
|
803
|
+
*/
|
|
804
|
+
takeIntegrationParameters(): RawIntegrationParameters | undefined;
|
|
805
|
+
/**
|
|
806
|
+
* @returns {RawIslandManager | undefined}
|
|
807
|
+
*/
|
|
808
|
+
takeIslandManager(): RawIslandManager | undefined;
|
|
809
|
+
/**
|
|
810
|
+
* @returns {RawBroadPhase | undefined}
|
|
811
|
+
*/
|
|
812
|
+
takeBroadPhase(): RawBroadPhase | undefined;
|
|
813
|
+
/**
|
|
814
|
+
* @returns {RawNarrowPhase | undefined}
|
|
815
|
+
*/
|
|
816
|
+
takeNarrowPhase(): RawNarrowPhase | undefined;
|
|
817
|
+
/**
|
|
818
|
+
* @returns {RawRigidBodySet | undefined}
|
|
819
|
+
*/
|
|
820
|
+
takeBodies(): RawRigidBodySet | undefined;
|
|
821
|
+
/**
|
|
822
|
+
* @returns {RawColliderSet | undefined}
|
|
823
|
+
*/
|
|
824
|
+
takeColliders(): RawColliderSet | undefined;
|
|
825
|
+
/**
|
|
826
|
+
* @returns {RawImpulseJointSet | undefined}
|
|
827
|
+
*/
|
|
828
|
+
takeImpulseJoints(): RawImpulseJointSet | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* @returns {RawMultibodyJointSet | undefined}
|
|
831
|
+
*/
|
|
832
|
+
takeMultibodyJoints(): RawMultibodyJointSet | undefined;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
*/
|
|
836
|
+
export class RawDynamicRayCastVehicleController {
|
|
837
|
+
free(): void;
|
|
838
|
+
/**
|
|
839
|
+
* @param {number} chassis
|
|
840
|
+
*/
|
|
841
|
+
constructor(chassis: number);
|
|
842
|
+
/**
|
|
843
|
+
* @returns {number}
|
|
844
|
+
*/
|
|
845
|
+
current_vehicle_speed(): number;
|
|
846
|
+
/**
|
|
847
|
+
* @returns {number}
|
|
848
|
+
*/
|
|
849
|
+
chassis(): number;
|
|
850
|
+
/**
|
|
851
|
+
* @returns {number}
|
|
852
|
+
*/
|
|
853
|
+
index_up_axis(): number;
|
|
854
|
+
/**
|
|
855
|
+
* @param {number} axis
|
|
856
|
+
*/
|
|
857
|
+
set_index_up_axis(axis: number): void;
|
|
858
|
+
/**
|
|
859
|
+
* @returns {number}
|
|
860
|
+
*/
|
|
861
|
+
index_forward_axis(): number;
|
|
862
|
+
/**
|
|
863
|
+
* @param {number} axis
|
|
864
|
+
*/
|
|
865
|
+
set_index_forward_axis(axis: number): void;
|
|
866
|
+
/**
|
|
867
|
+
* @param {RawVector} chassis_connection_cs
|
|
868
|
+
* @param {RawVector} direction_cs
|
|
869
|
+
* @param {RawVector} axle_cs
|
|
870
|
+
* @param {number} suspension_rest_length
|
|
871
|
+
* @param {number} radius
|
|
872
|
+
*/
|
|
873
|
+
add_wheel(chassis_connection_cs: RawVector, direction_cs: RawVector, axle_cs: RawVector, suspension_rest_length: number, radius: number): void;
|
|
874
|
+
/**
|
|
875
|
+
* @returns {number}
|
|
876
|
+
*/
|
|
877
|
+
num_wheels(): number;
|
|
878
|
+
/**
|
|
879
|
+
* @param {number} dt
|
|
880
|
+
* @param {RawRigidBodySet} bodies
|
|
881
|
+
* @param {RawColliderSet} colliders
|
|
882
|
+
* @param {RawQueryPipeline} queries
|
|
883
|
+
* @param {number} filter_flags
|
|
884
|
+
* @param {number | undefined} filter_groups
|
|
885
|
+
* @param {Function} filter_predicate
|
|
886
|
+
*/
|
|
887
|
+
update_vehicle(dt: number, bodies: RawRigidBodySet, colliders: RawColliderSet, queries: RawQueryPipeline, filter_flags: number, filter_groups: number | undefined, filter_predicate: Function): void;
|
|
888
|
+
/**
|
|
889
|
+
* @param {number} i
|
|
890
|
+
* @returns {RawVector | undefined}
|
|
891
|
+
*/
|
|
892
|
+
wheel_chassis_connection_point_cs(i: number): RawVector | undefined;
|
|
893
|
+
/**
|
|
894
|
+
* @param {number} i
|
|
895
|
+
* @param {RawVector} value
|
|
896
|
+
*/
|
|
897
|
+
set_wheel_chassis_connection_point_cs(i: number, value: RawVector): void;
|
|
898
|
+
/**
|
|
899
|
+
* @param {number} i
|
|
900
|
+
* @returns {number | undefined}
|
|
901
|
+
*/
|
|
902
|
+
wheel_suspension_rest_length(i: number): number | undefined;
|
|
903
|
+
/**
|
|
904
|
+
* @param {number} i
|
|
905
|
+
* @param {number} value
|
|
906
|
+
*/
|
|
907
|
+
set_wheel_suspension_rest_length(i: number, value: number): void;
|
|
908
|
+
/**
|
|
909
|
+
* @param {number} i
|
|
910
|
+
* @returns {number | undefined}
|
|
911
|
+
*/
|
|
912
|
+
wheel_max_suspension_travel(i: number): number | undefined;
|
|
913
|
+
/**
|
|
914
|
+
* @param {number} i
|
|
915
|
+
* @param {number} value
|
|
916
|
+
*/
|
|
917
|
+
set_wheel_max_suspension_travel(i: number, value: number): void;
|
|
918
|
+
/**
|
|
919
|
+
* @param {number} i
|
|
920
|
+
* @returns {number | undefined}
|
|
921
|
+
*/
|
|
922
|
+
wheel_radius(i: number): number | undefined;
|
|
923
|
+
/**
|
|
924
|
+
* @param {number} i
|
|
925
|
+
* @param {number} value
|
|
926
|
+
*/
|
|
927
|
+
set_wheel_radius(i: number, value: number): void;
|
|
928
|
+
/**
|
|
929
|
+
* @param {number} i
|
|
930
|
+
* @returns {number | undefined}
|
|
931
|
+
*/
|
|
932
|
+
wheel_suspension_stiffness(i: number): number | undefined;
|
|
933
|
+
/**
|
|
934
|
+
* @param {number} i
|
|
935
|
+
* @param {number} value
|
|
936
|
+
*/
|
|
937
|
+
set_wheel_suspension_stiffness(i: number, value: number): void;
|
|
938
|
+
/**
|
|
939
|
+
* @param {number} i
|
|
940
|
+
* @returns {number | undefined}
|
|
941
|
+
*/
|
|
942
|
+
wheel_suspension_compression(i: number): number | undefined;
|
|
943
|
+
/**
|
|
944
|
+
* @param {number} i
|
|
945
|
+
* @param {number} value
|
|
946
|
+
*/
|
|
947
|
+
set_wheel_suspension_compression(i: number, value: number): void;
|
|
948
|
+
/**
|
|
949
|
+
* @param {number} i
|
|
950
|
+
* @returns {number | undefined}
|
|
951
|
+
*/
|
|
952
|
+
wheel_suspension_relaxation(i: number): number | undefined;
|
|
953
|
+
/**
|
|
954
|
+
* @param {number} i
|
|
955
|
+
* @param {number} value
|
|
956
|
+
*/
|
|
957
|
+
set_wheel_suspension_relaxation(i: number, value: number): void;
|
|
958
|
+
/**
|
|
959
|
+
* @param {number} i
|
|
960
|
+
* @returns {number | undefined}
|
|
961
|
+
*/
|
|
962
|
+
wheel_max_suspension_force(i: number): number | undefined;
|
|
963
|
+
/**
|
|
964
|
+
* @param {number} i
|
|
965
|
+
* @param {number} value
|
|
966
|
+
*/
|
|
967
|
+
set_wheel_max_suspension_force(i: number, value: number): void;
|
|
968
|
+
/**
|
|
969
|
+
* @param {number} i
|
|
970
|
+
* @returns {number | undefined}
|
|
971
|
+
*/
|
|
972
|
+
wheel_brake(i: number): number | undefined;
|
|
973
|
+
/**
|
|
974
|
+
* @param {number} i
|
|
975
|
+
* @param {number} value
|
|
976
|
+
*/
|
|
977
|
+
set_wheel_brake(i: number, value: number): void;
|
|
978
|
+
/**
|
|
979
|
+
* @param {number} i
|
|
980
|
+
* @returns {number | undefined}
|
|
981
|
+
*/
|
|
982
|
+
wheel_steering(i: number): number | undefined;
|
|
983
|
+
/**
|
|
984
|
+
* @param {number} i
|
|
985
|
+
* @param {number} value
|
|
986
|
+
*/
|
|
987
|
+
set_wheel_steering(i: number, value: number): void;
|
|
988
|
+
/**
|
|
989
|
+
* @param {number} i
|
|
990
|
+
* @returns {number | undefined}
|
|
991
|
+
*/
|
|
992
|
+
wheel_engine_force(i: number): number | undefined;
|
|
993
|
+
/**
|
|
994
|
+
* @param {number} i
|
|
995
|
+
* @param {number} value
|
|
996
|
+
*/
|
|
997
|
+
set_wheel_engine_force(i: number, value: number): void;
|
|
998
|
+
/**
|
|
999
|
+
* @param {number} i
|
|
1000
|
+
* @returns {RawVector | undefined}
|
|
1001
|
+
*/
|
|
1002
|
+
wheel_direction_cs(i: number): RawVector | undefined;
|
|
1003
|
+
/**
|
|
1004
|
+
* @param {number} i
|
|
1005
|
+
* @param {RawVector} value
|
|
1006
|
+
*/
|
|
1007
|
+
set_wheel_direction_cs(i: number, value: RawVector): void;
|
|
1008
|
+
/**
|
|
1009
|
+
* @param {number} i
|
|
1010
|
+
* @returns {RawVector | undefined}
|
|
1011
|
+
*/
|
|
1012
|
+
wheel_axle_cs(i: number): RawVector | undefined;
|
|
1013
|
+
/**
|
|
1014
|
+
* @param {number} i
|
|
1015
|
+
* @param {RawVector} value
|
|
1016
|
+
*/
|
|
1017
|
+
set_wheel_axle_cs(i: number, value: RawVector): void;
|
|
1018
|
+
/**
|
|
1019
|
+
* @param {number} i
|
|
1020
|
+
* @returns {number | undefined}
|
|
1021
|
+
*/
|
|
1022
|
+
wheel_friction_slip(i: number): number | undefined;
|
|
1023
|
+
/**
|
|
1024
|
+
* @param {number} i
|
|
1025
|
+
* @param {number} value
|
|
1026
|
+
*/
|
|
1027
|
+
set_wheel_friction_slip(i: number, value: number): void;
|
|
1028
|
+
/**
|
|
1029
|
+
* @param {number} i
|
|
1030
|
+
* @returns {number | undefined}
|
|
1031
|
+
*/
|
|
1032
|
+
wheel_rotation(i: number): number | undefined;
|
|
1033
|
+
/**
|
|
1034
|
+
* @param {number} i
|
|
1035
|
+
* @returns {number | undefined}
|
|
1036
|
+
*/
|
|
1037
|
+
wheel_forward_impulse(i: number): number | undefined;
|
|
1038
|
+
/**
|
|
1039
|
+
* @param {number} i
|
|
1040
|
+
* @returns {number | undefined}
|
|
1041
|
+
*/
|
|
1042
|
+
wheel_side_impulse(i: number): number | undefined;
|
|
1043
|
+
/**
|
|
1044
|
+
* @param {number} i
|
|
1045
|
+
* @returns {number | undefined}
|
|
1046
|
+
*/
|
|
1047
|
+
wheel_suspension_force(i: number): number | undefined;
|
|
1048
|
+
/**
|
|
1049
|
+
* @param {number} i
|
|
1050
|
+
* @returns {RawVector | undefined}
|
|
1051
|
+
*/
|
|
1052
|
+
wheel_contact_normal_ws(i: number): RawVector | undefined;
|
|
1053
|
+
/**
|
|
1054
|
+
* @param {number} i
|
|
1055
|
+
* @returns {RawVector | undefined}
|
|
1056
|
+
*/
|
|
1057
|
+
wheel_contact_point_ws(i: number): RawVector | undefined;
|
|
1058
|
+
/**
|
|
1059
|
+
* @param {number} i
|
|
1060
|
+
* @returns {number | undefined}
|
|
1061
|
+
*/
|
|
1062
|
+
wheel_suspension_length(i: number): number | undefined;
|
|
1063
|
+
/**
|
|
1064
|
+
* @param {number} i
|
|
1065
|
+
* @returns {RawVector | undefined}
|
|
1066
|
+
*/
|
|
1067
|
+
wheel_hard_point_ws(i: number): RawVector | undefined;
|
|
1068
|
+
/**
|
|
1069
|
+
* @param {number} i
|
|
1070
|
+
* @returns {boolean}
|
|
1071
|
+
*/
|
|
1072
|
+
wheel_is_in_contact(i: number): boolean;
|
|
1073
|
+
/**
|
|
1074
|
+
* @param {number} i
|
|
1075
|
+
* @returns {number | undefined}
|
|
1076
|
+
*/
|
|
1077
|
+
wheel_ground_object(i: number): number | undefined;
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* A structure responsible for collecting events generated
|
|
1081
|
+
* by the physics engine.
|
|
1082
|
+
*/
|
|
1083
|
+
export class RawEventQueue {
|
|
1084
|
+
free(): void;
|
|
1085
|
+
/**
|
|
1086
|
+
* Creates a new event collector.
|
|
1087
|
+
*
|
|
1088
|
+
* # Parameters
|
|
1089
|
+
* - `autoDrain`: setting this to `true` is strongly recommended. If true, the collector will
|
|
1090
|
+
* be automatically drained before each `world.step(collector)`. If false, the collector will
|
|
1091
|
+
* keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of
|
|
1092
|
+
* RAM if no drain is performed.
|
|
1093
|
+
* @param {boolean} autoDrain
|
|
1094
|
+
*/
|
|
1095
|
+
constructor(autoDrain: boolean);
|
|
1096
|
+
/**
|
|
1097
|
+
* Applies the given javascript closure on each collision event of this collector, then clear
|
|
1098
|
+
* the internal collision event buffer.
|
|
1099
|
+
*
|
|
1100
|
+
* # Parameters
|
|
1101
|
+
* - `f(handle1, handle2, started)`: JavaScript closure applied to each collision event. The
|
|
1102
|
+
* closure should take three arguments: two integers representing the handles of the colliders
|
|
1103
|
+
* involved in the collision, and a boolean indicating if the collision started (true) or stopped
|
|
1104
|
+
* (false).
|
|
1105
|
+
* @param {Function} f
|
|
1106
|
+
*/
|
|
1107
|
+
drainCollisionEvents(f: Function): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* @param {Function} f
|
|
1110
|
+
*/
|
|
1111
|
+
drainContactForceEvents(f: Function): void;
|
|
1112
|
+
/**
|
|
1113
|
+
* Removes all events contained by this collector.
|
|
1114
|
+
*/
|
|
1115
|
+
clear(): void;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
*/
|
|
1119
|
+
export class RawGenericJoint {
|
|
1120
|
+
free(): void;
|
|
1121
|
+
/**
|
|
1122
|
+
* Create a new joint descriptor that builds spehrical joints.
|
|
1123
|
+
*
|
|
1124
|
+
* A spherical joints allows three relative rotational degrees of freedom
|
|
1125
|
+
* by preventing any relative translation between the anchors of the
|
|
1126
|
+
* two attached rigid-bodies.
|
|
1127
|
+
* @param {RawVector} anchor1
|
|
1128
|
+
* @param {RawVector} anchor2
|
|
1129
|
+
* @returns {RawGenericJoint}
|
|
1130
|
+
*/
|
|
1131
|
+
static spherical(anchor1: RawVector, anchor2: RawVector): RawGenericJoint;
|
|
1132
|
+
/**
|
|
1133
|
+
* Creates a new joint descriptor that builds a Prismatic joint.
|
|
1134
|
+
*
|
|
1135
|
+
* A prismatic joint removes all the degrees of freedom between the
|
|
1136
|
+
* affected bodies, except for the translation along one axis.
|
|
1137
|
+
*
|
|
1138
|
+
* Returns `None` if any of the provided axes cannot be normalized.
|
|
1139
|
+
* @param {RawVector} anchor1
|
|
1140
|
+
* @param {RawVector} anchor2
|
|
1141
|
+
* @param {RawVector} axis
|
|
1142
|
+
* @param {boolean} limitsEnabled
|
|
1143
|
+
* @param {number} limitsMin
|
|
1144
|
+
* @param {number} limitsMax
|
|
1145
|
+
* @returns {RawGenericJoint | undefined}
|
|
1146
|
+
*/
|
|
1147
|
+
static prismatic(anchor1: RawVector, anchor2: RawVector, axis: RawVector, limitsEnabled: boolean, limitsMin: number, limitsMax: number): RawGenericJoint | undefined;
|
|
1148
|
+
/**
|
|
1149
|
+
* Creates a new joint descriptor that builds a Fixed joint.
|
|
1150
|
+
*
|
|
1151
|
+
* A fixed joint removes all the degrees of freedom between the affected bodies.
|
|
1152
|
+
* @param {RawVector} anchor1
|
|
1153
|
+
* @param {RawRotation} axes1
|
|
1154
|
+
* @param {RawVector} anchor2
|
|
1155
|
+
* @param {RawRotation} axes2
|
|
1156
|
+
* @returns {RawGenericJoint}
|
|
1157
|
+
*/
|
|
1158
|
+
static fixed(anchor1: RawVector, axes1: RawRotation, anchor2: RawVector, axes2: RawRotation): RawGenericJoint;
|
|
1159
|
+
/**
|
|
1160
|
+
* Create a new joint descriptor that builds Revolute joints.
|
|
1161
|
+
*
|
|
1162
|
+
* A revolute joint removes all degrees of freedom between the affected
|
|
1163
|
+
* bodies except for the rotation along one axis.
|
|
1164
|
+
* @param {RawVector} anchor1
|
|
1165
|
+
* @param {RawVector} anchor2
|
|
1166
|
+
* @param {RawVector} axis
|
|
1167
|
+
* @returns {RawGenericJoint | undefined}
|
|
1168
|
+
*/
|
|
1169
|
+
static revolute(anchor1: RawVector, anchor2: RawVector, axis: RawVector): RawGenericJoint | undefined;
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
*/
|
|
1173
|
+
export class RawImpulseJointSet {
|
|
1174
|
+
free(): void;
|
|
1175
|
+
/**
|
|
1176
|
+
* The type of this joint.
|
|
1177
|
+
* @param {number} handle
|
|
1178
|
+
* @returns {number}
|
|
1179
|
+
*/
|
|
1180
|
+
jointType(handle: number): number;
|
|
1181
|
+
/**
|
|
1182
|
+
* The unique integer identifier of the first rigid-body this joint it attached to.
|
|
1183
|
+
* @param {number} handle
|
|
1184
|
+
* @returns {number}
|
|
1185
|
+
*/
|
|
1186
|
+
jointBodyHandle1(handle: number): number;
|
|
1187
|
+
/**
|
|
1188
|
+
* The unique integer identifier of the second rigid-body this joint is attached to.
|
|
1189
|
+
* @param {number} handle
|
|
1190
|
+
* @returns {number}
|
|
1191
|
+
*/
|
|
1192
|
+
jointBodyHandle2(handle: number): number;
|
|
1193
|
+
/**
|
|
1194
|
+
* The angular part of the joint’s local frame relative to the first rigid-body it is attached to.
|
|
1195
|
+
* @param {number} handle
|
|
1196
|
+
* @returns {RawRotation}
|
|
1197
|
+
*/
|
|
1198
|
+
jointFrameX1(handle: number): RawRotation;
|
|
1199
|
+
/**
|
|
1200
|
+
* The angular part of the joint’s local frame relative to the second rigid-body it is attached to.
|
|
1201
|
+
* @param {number} handle
|
|
1202
|
+
* @returns {RawRotation}
|
|
1203
|
+
*/
|
|
1204
|
+
jointFrameX2(handle: number): RawRotation;
|
|
1205
|
+
/**
|
|
1206
|
+
* The position of the first anchor of this joint.
|
|
1207
|
+
*
|
|
1208
|
+
* The first anchor gives the position of the points application point on the
|
|
1209
|
+
* local frame of the first rigid-body it is attached to.
|
|
1210
|
+
* @param {number} handle
|
|
1211
|
+
* @returns {RawVector}
|
|
1212
|
+
*/
|
|
1213
|
+
jointAnchor1(handle: number): RawVector;
|
|
1214
|
+
/**
|
|
1215
|
+
* The position of the second anchor of this joint.
|
|
1216
|
+
*
|
|
1217
|
+
* The second anchor gives the position of the points application point on the
|
|
1218
|
+
* local frame of the second rigid-body it is attached to.
|
|
1219
|
+
* @param {number} handle
|
|
1220
|
+
* @returns {RawVector}
|
|
1221
|
+
*/
|
|
1222
|
+
jointAnchor2(handle: number): RawVector;
|
|
1223
|
+
/**
|
|
1224
|
+
* Sets the position of the first local anchor
|
|
1225
|
+
* @param {number} handle
|
|
1226
|
+
* @param {RawVector} newPos
|
|
1227
|
+
*/
|
|
1228
|
+
jointSetAnchor1(handle: number, newPos: RawVector): void;
|
|
1229
|
+
/**
|
|
1230
|
+
* Sets the position of the second local anchor
|
|
1231
|
+
* @param {number} handle
|
|
1232
|
+
* @param {RawVector} newPos
|
|
1233
|
+
*/
|
|
1234
|
+
jointSetAnchor2(handle: number, newPos: RawVector): void;
|
|
1235
|
+
/**
|
|
1236
|
+
* Are contacts between the rigid-bodies attached by this joint enabled?
|
|
1237
|
+
* @param {number} handle
|
|
1238
|
+
* @returns {boolean}
|
|
1239
|
+
*/
|
|
1240
|
+
jointContactsEnabled(handle: number): boolean;
|
|
1241
|
+
/**
|
|
1242
|
+
* Sets whether contacts are enabled between the rigid-bodies attached by this joint.
|
|
1243
|
+
* @param {number} handle
|
|
1244
|
+
* @param {boolean} enabled
|
|
1245
|
+
*/
|
|
1246
|
+
jointSetContactsEnabled(handle: number, enabled: boolean): void;
|
|
1247
|
+
/**
|
|
1248
|
+
* Are the limits for this joint enabled?
|
|
1249
|
+
* @param {number} handle
|
|
1250
|
+
* @param {number} axis
|
|
1251
|
+
* @returns {boolean}
|
|
1252
|
+
*/
|
|
1253
|
+
jointLimitsEnabled(handle: number, axis: number): boolean;
|
|
1254
|
+
/**
|
|
1255
|
+
* Return the lower limit along the given joint axis.
|
|
1256
|
+
* @param {number} handle
|
|
1257
|
+
* @param {number} axis
|
|
1258
|
+
* @returns {number}
|
|
1259
|
+
*/
|
|
1260
|
+
jointLimitsMin(handle: number, axis: number): number;
|
|
1261
|
+
/**
|
|
1262
|
+
* If this is a prismatic joint, returns its upper limit.
|
|
1263
|
+
* @param {number} handle
|
|
1264
|
+
* @param {number} axis
|
|
1265
|
+
* @returns {number}
|
|
1266
|
+
*/
|
|
1267
|
+
jointLimitsMax(handle: number, axis: number): number;
|
|
1268
|
+
/**
|
|
1269
|
+
* Enables and sets the joint limits
|
|
1270
|
+
* @param {number} handle
|
|
1271
|
+
* @param {number} axis
|
|
1272
|
+
* @param {number} min
|
|
1273
|
+
* @param {number} max
|
|
1274
|
+
*/
|
|
1275
|
+
jointSetLimits(handle: number, axis: number, min: number, max: number): void;
|
|
1276
|
+
/**
|
|
1277
|
+
* @param {number} handle
|
|
1278
|
+
* @param {number} axis
|
|
1279
|
+
* @param {number} model
|
|
1280
|
+
*/
|
|
1281
|
+
jointConfigureMotorModel(handle: number, axis: number, model: number): void;
|
|
1282
|
+
/**
|
|
1283
|
+
* @param {number} handle
|
|
1284
|
+
* @param {number} axis
|
|
1285
|
+
* @param {number} targetVel
|
|
1286
|
+
* @param {number} factor
|
|
1287
|
+
*/
|
|
1288
|
+
jointConfigureMotorVelocity(handle: number, axis: number, targetVel: number, factor: number): void;
|
|
1289
|
+
/**
|
|
1290
|
+
* @param {number} handle
|
|
1291
|
+
* @param {number} axis
|
|
1292
|
+
* @param {number} targetPos
|
|
1293
|
+
* @param {number} stiffness
|
|
1294
|
+
* @param {number} damping
|
|
1295
|
+
*/
|
|
1296
|
+
jointConfigureMotorPosition(handle: number, axis: number, targetPos: number, stiffness: number, damping: number): void;
|
|
1297
|
+
/**
|
|
1298
|
+
* @param {number} handle
|
|
1299
|
+
* @param {number} axis
|
|
1300
|
+
* @param {number} targetPos
|
|
1301
|
+
* @param {number} targetVel
|
|
1302
|
+
* @param {number} stiffness
|
|
1303
|
+
* @param {number} damping
|
|
1304
|
+
*/
|
|
1305
|
+
jointConfigureMotor(handle: number, axis: number, targetPos: number, targetVel: number, stiffness: number, damping: number): void;
|
|
1306
|
+
/**
|
|
1307
|
+
*/
|
|
1308
|
+
constructor();
|
|
1309
|
+
/**
|
|
1310
|
+
* @param {RawGenericJoint} params
|
|
1311
|
+
* @param {number} parent1
|
|
1312
|
+
* @param {number} parent2
|
|
1313
|
+
* @param {boolean} wake_up
|
|
1314
|
+
* @returns {number}
|
|
1315
|
+
*/
|
|
1316
|
+
createJoint(params: RawGenericJoint, parent1: number, parent2: number, wake_up: boolean): number;
|
|
1317
|
+
/**
|
|
1318
|
+
* @param {number} handle
|
|
1319
|
+
* @param {boolean} wakeUp
|
|
1320
|
+
*/
|
|
1321
|
+
remove(handle: number, wakeUp: boolean): void;
|
|
1322
|
+
/**
|
|
1323
|
+
* @returns {number}
|
|
1324
|
+
*/
|
|
1325
|
+
len(): number;
|
|
1326
|
+
/**
|
|
1327
|
+
* @param {number} handle
|
|
1328
|
+
* @returns {boolean}
|
|
1329
|
+
*/
|
|
1330
|
+
contains(handle: number): boolean;
|
|
1331
|
+
/**
|
|
1332
|
+
* Applies the given JavaScript function to the integer handle of each joint managed by this physics world.
|
|
1333
|
+
*
|
|
1334
|
+
* # Parameters
|
|
1335
|
+
* - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`.
|
|
1336
|
+
* @param {Function} f
|
|
1337
|
+
*/
|
|
1338
|
+
forEachJointHandle(f: Function): void;
|
|
1339
|
+
/**
|
|
1340
|
+
* Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body.
|
|
1341
|
+
*
|
|
1342
|
+
* # Parameters
|
|
1343
|
+
* - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`.
|
|
1344
|
+
* @param {number} body
|
|
1345
|
+
* @param {Function} f
|
|
1346
|
+
*/
|
|
1347
|
+
forEachJointAttachedToRigidBody(body: number, f: Function): void;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
*/
|
|
1351
|
+
export class RawIntegrationParameters {
|
|
1352
|
+
free(): void;
|
|
1353
|
+
/**
|
|
1354
|
+
*/
|
|
1355
|
+
constructor();
|
|
1356
|
+
/**
|
|
1357
|
+
*/
|
|
1358
|
+
allowedLinearError: number;
|
|
1359
|
+
/**
|
|
1360
|
+
*/
|
|
1361
|
+
dt: number;
|
|
1362
|
+
/**
|
|
1363
|
+
*/
|
|
1364
|
+
erp: number;
|
|
1365
|
+
/**
|
|
1366
|
+
*/
|
|
1367
|
+
maxCcdSubsteps: number;
|
|
1368
|
+
/**
|
|
1369
|
+
*/
|
|
1370
|
+
maxStabilizationIterations: number;
|
|
1371
|
+
/**
|
|
1372
|
+
*/
|
|
1373
|
+
maxVelocityFrictionIterations: number;
|
|
1374
|
+
/**
|
|
1375
|
+
*/
|
|
1376
|
+
maxVelocityIterations: number;
|
|
1377
|
+
/**
|
|
1378
|
+
*/
|
|
1379
|
+
minIslandSize: number;
|
|
1380
|
+
/**
|
|
1381
|
+
*/
|
|
1382
|
+
predictionDistance: number;
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
*/
|
|
1386
|
+
export class RawIslandManager {
|
|
1387
|
+
free(): void;
|
|
1388
|
+
/**
|
|
1389
|
+
*/
|
|
1390
|
+
constructor();
|
|
1391
|
+
/**
|
|
1392
|
+
* Applies the given JavaScript function to the integer handle of each active rigid-body
|
|
1393
|
+
* managed by this island manager.
|
|
1394
|
+
*
|
|
1395
|
+
* After a short time of inactivity, a rigid-body is automatically deactivated ("asleep") by
|
|
1396
|
+
* the physics engine in order to save computational power. A sleeping rigid-body never moves
|
|
1397
|
+
* unless it is moved manually by the user.
|
|
1398
|
+
*
|
|
1399
|
+
* # Parameters
|
|
1400
|
+
* - `f(handle)`: the function to apply to the integer handle of each active rigid-body managed by this
|
|
1401
|
+
* set. Called as `f(collider)`.
|
|
1402
|
+
* @param {Function} f
|
|
1403
|
+
*/
|
|
1404
|
+
forEachActiveRigidBodyHandle(f: Function): void;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
*/
|
|
1408
|
+
export class RawKinematicCharacterController {
|
|
1409
|
+
free(): void;
|
|
1410
|
+
/**
|
|
1411
|
+
* @param {number} offset
|
|
1412
|
+
*/
|
|
1413
|
+
constructor(offset: number);
|
|
1414
|
+
/**
|
|
1415
|
+
* @returns {RawVector}
|
|
1416
|
+
*/
|
|
1417
|
+
up(): RawVector;
|
|
1418
|
+
/**
|
|
1419
|
+
* @param {RawVector} vector
|
|
1420
|
+
*/
|
|
1421
|
+
setUp(vector: RawVector): void;
|
|
1422
|
+
/**
|
|
1423
|
+
* @returns {number}
|
|
1424
|
+
*/
|
|
1425
|
+
offset(): number;
|
|
1426
|
+
/**
|
|
1427
|
+
* @param {number} value
|
|
1428
|
+
*/
|
|
1429
|
+
setOffset(value: number): void;
|
|
1430
|
+
/**
|
|
1431
|
+
* @returns {boolean}
|
|
1432
|
+
*/
|
|
1433
|
+
slideEnabled(): boolean;
|
|
1434
|
+
/**
|
|
1435
|
+
* @param {boolean} enabled
|
|
1436
|
+
*/
|
|
1437
|
+
setSlideEnabled(enabled: boolean): void;
|
|
1438
|
+
/**
|
|
1439
|
+
* @returns {number | undefined}
|
|
1440
|
+
*/
|
|
1441
|
+
autostepMaxHeight(): number | undefined;
|
|
1442
|
+
/**
|
|
1443
|
+
* @returns {number | undefined}
|
|
1444
|
+
*/
|
|
1445
|
+
autostepMinWidth(): number | undefined;
|
|
1446
|
+
/**
|
|
1447
|
+
* @returns {boolean | undefined}
|
|
1448
|
+
*/
|
|
1449
|
+
autostepIncludesDynamicBodies(): boolean | undefined;
|
|
1450
|
+
/**
|
|
1451
|
+
* @returns {boolean}
|
|
1452
|
+
*/
|
|
1453
|
+
autostepEnabled(): boolean;
|
|
1454
|
+
/**
|
|
1455
|
+
* @param {number} maxHeight
|
|
1456
|
+
* @param {number} minWidth
|
|
1457
|
+
* @param {boolean} includeDynamicBodies
|
|
1458
|
+
*/
|
|
1459
|
+
enableAutostep(maxHeight: number, minWidth: number, includeDynamicBodies: boolean): void;
|
|
1460
|
+
/**
|
|
1461
|
+
*/
|
|
1462
|
+
disableAutostep(): void;
|
|
1463
|
+
/**
|
|
1464
|
+
* @returns {number}
|
|
1465
|
+
*/
|
|
1466
|
+
maxSlopeClimbAngle(): number;
|
|
1467
|
+
/**
|
|
1468
|
+
* @param {number} angle
|
|
1469
|
+
*/
|
|
1470
|
+
setMaxSlopeClimbAngle(angle: number): void;
|
|
1471
|
+
/**
|
|
1472
|
+
* @returns {number}
|
|
1473
|
+
*/
|
|
1474
|
+
minSlopeSlideAngle(): number;
|
|
1475
|
+
/**
|
|
1476
|
+
* @param {number} angle
|
|
1477
|
+
*/
|
|
1478
|
+
setMinSlopeSlideAngle(angle: number): void;
|
|
1479
|
+
/**
|
|
1480
|
+
* @returns {number | undefined}
|
|
1481
|
+
*/
|
|
1482
|
+
snapToGroundDistance(): number | undefined;
|
|
1483
|
+
/**
|
|
1484
|
+
* @param {number} distance
|
|
1485
|
+
*/
|
|
1486
|
+
enableSnapToGround(distance: number): void;
|
|
1487
|
+
/**
|
|
1488
|
+
*/
|
|
1489
|
+
disableSnapToGround(): void;
|
|
1490
|
+
/**
|
|
1491
|
+
* @returns {boolean}
|
|
1492
|
+
*/
|
|
1493
|
+
snapToGroundEnabled(): boolean;
|
|
1494
|
+
/**
|
|
1495
|
+
* @param {number} dt
|
|
1496
|
+
* @param {RawRigidBodySet} bodies
|
|
1497
|
+
* @param {RawColliderSet} colliders
|
|
1498
|
+
* @param {RawQueryPipeline} queries
|
|
1499
|
+
* @param {number} collider_handle
|
|
1500
|
+
* @param {RawVector} desired_translation_delta
|
|
1501
|
+
* @param {boolean} apply_impulses_to_dynamic_bodies
|
|
1502
|
+
* @param {number | undefined} character_mass
|
|
1503
|
+
* @param {number} filter_flags
|
|
1504
|
+
* @param {number | undefined} filter_groups
|
|
1505
|
+
* @param {Function} filter_predicate
|
|
1506
|
+
*/
|
|
1507
|
+
computeColliderMovement(dt: number, bodies: RawRigidBodySet, colliders: RawColliderSet, queries: RawQueryPipeline, collider_handle: number, desired_translation_delta: RawVector, apply_impulses_to_dynamic_bodies: boolean, character_mass: number | undefined, filter_flags: number, filter_groups: number | undefined, filter_predicate: Function): void;
|
|
1508
|
+
/**
|
|
1509
|
+
* @returns {RawVector}
|
|
1510
|
+
*/
|
|
1511
|
+
computedMovement(): RawVector;
|
|
1512
|
+
/**
|
|
1513
|
+
* @returns {boolean}
|
|
1514
|
+
*/
|
|
1515
|
+
computedGrounded(): boolean;
|
|
1516
|
+
/**
|
|
1517
|
+
* @returns {number}
|
|
1518
|
+
*/
|
|
1519
|
+
numComputedCollisions(): number;
|
|
1520
|
+
/**
|
|
1521
|
+
* @param {number} i
|
|
1522
|
+
* @param {RawCharacterCollision} collision
|
|
1523
|
+
* @returns {boolean}
|
|
1524
|
+
*/
|
|
1525
|
+
computedCollision(i: number, collision: RawCharacterCollision): boolean;
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
*/
|
|
1529
|
+
export class RawMultibodyJointSet {
|
|
1530
|
+
free(): void;
|
|
1531
|
+
/**
|
|
1532
|
+
* The type of this joint.
|
|
1533
|
+
* @param {number} handle
|
|
1534
|
+
* @returns {number}
|
|
1535
|
+
*/
|
|
1536
|
+
jointType(handle: number): number;
|
|
1537
|
+
/**
|
|
1538
|
+
* The angular part of the joint’s local frame relative to the first rigid-body it is attached to.
|
|
1539
|
+
* @param {number} handle
|
|
1540
|
+
* @returns {RawRotation}
|
|
1541
|
+
*/
|
|
1542
|
+
jointFrameX1(handle: number): RawRotation;
|
|
1543
|
+
/**
|
|
1544
|
+
* The angular part of the joint’s local frame relative to the second rigid-body it is attached to.
|
|
1545
|
+
* @param {number} handle
|
|
1546
|
+
* @returns {RawRotation}
|
|
1547
|
+
*/
|
|
1548
|
+
jointFrameX2(handle: number): RawRotation;
|
|
1549
|
+
/**
|
|
1550
|
+
* The position of the first anchor of this joint.
|
|
1551
|
+
*
|
|
1552
|
+
* The first anchor gives the position of the points application point on the
|
|
1553
|
+
* local frame of the first rigid-body it is attached to.
|
|
1554
|
+
* @param {number} handle
|
|
1555
|
+
* @returns {RawVector}
|
|
1556
|
+
*/
|
|
1557
|
+
jointAnchor1(handle: number): RawVector;
|
|
1558
|
+
/**
|
|
1559
|
+
* The position of the second anchor of this joint.
|
|
1560
|
+
*
|
|
1561
|
+
* The second anchor gives the position of the points application point on the
|
|
1562
|
+
* local frame of the second rigid-body it is attached to.
|
|
1563
|
+
* @param {number} handle
|
|
1564
|
+
* @returns {RawVector}
|
|
1565
|
+
*/
|
|
1566
|
+
jointAnchor2(handle: number): RawVector;
|
|
1567
|
+
/**
|
|
1568
|
+
* Are contacts between the rigid-bodies attached by this joint enabled?
|
|
1569
|
+
* @param {number} handle
|
|
1570
|
+
* @returns {boolean}
|
|
1571
|
+
*/
|
|
1572
|
+
jointContactsEnabled(handle: number): boolean;
|
|
1573
|
+
/**
|
|
1574
|
+
* Sets whether contacts are enabled between the rigid-bodies attached by this joint.
|
|
1575
|
+
* @param {number} handle
|
|
1576
|
+
* @param {boolean} enabled
|
|
1577
|
+
*/
|
|
1578
|
+
jointSetContactsEnabled(handle: number, enabled: boolean): void;
|
|
1579
|
+
/**
|
|
1580
|
+
* Are the limits for this joint enabled?
|
|
1581
|
+
* @param {number} handle
|
|
1582
|
+
* @param {number} axis
|
|
1583
|
+
* @returns {boolean}
|
|
1584
|
+
*/
|
|
1585
|
+
jointLimitsEnabled(handle: number, axis: number): boolean;
|
|
1586
|
+
/**
|
|
1587
|
+
* Return the lower limit along the given joint axis.
|
|
1588
|
+
* @param {number} handle
|
|
1589
|
+
* @param {number} axis
|
|
1590
|
+
* @returns {number}
|
|
1591
|
+
*/
|
|
1592
|
+
jointLimitsMin(handle: number, axis: number): number;
|
|
1593
|
+
/**
|
|
1594
|
+
* If this is a prismatic joint, returns its upper limit.
|
|
1595
|
+
* @param {number} handle
|
|
1596
|
+
* @param {number} axis
|
|
1597
|
+
* @returns {number}
|
|
1598
|
+
*/
|
|
1599
|
+
jointLimitsMax(handle: number, axis: number): number;
|
|
1600
|
+
/**
|
|
1601
|
+
*/
|
|
1602
|
+
constructor();
|
|
1603
|
+
/**
|
|
1604
|
+
* @param {RawGenericJoint} params
|
|
1605
|
+
* @param {number} parent1
|
|
1606
|
+
* @param {number} parent2
|
|
1607
|
+
* @param {boolean} wakeUp
|
|
1608
|
+
* @returns {number}
|
|
1609
|
+
*/
|
|
1610
|
+
createJoint(params: RawGenericJoint, parent1: number, parent2: number, wakeUp: boolean): number;
|
|
1611
|
+
/**
|
|
1612
|
+
* @param {number} handle
|
|
1613
|
+
* @param {boolean} wakeUp
|
|
1614
|
+
*/
|
|
1615
|
+
remove(handle: number, wakeUp: boolean): void;
|
|
1616
|
+
/**
|
|
1617
|
+
* @param {number} handle
|
|
1618
|
+
* @returns {boolean}
|
|
1619
|
+
*/
|
|
1620
|
+
contains(handle: number): boolean;
|
|
1621
|
+
/**
|
|
1622
|
+
* Applies the given JavaScript function to the integer handle of each joint managed by this physics world.
|
|
1623
|
+
*
|
|
1624
|
+
* # Parameters
|
|
1625
|
+
* - `f(handle)`: the function to apply to the integer handle of each joint managed by this set. Called as `f(collider)`.
|
|
1626
|
+
* @param {Function} f
|
|
1627
|
+
*/
|
|
1628
|
+
forEachJointHandle(f: Function): void;
|
|
1629
|
+
/**
|
|
1630
|
+
* Applies the given JavaScript function to the integer handle of each joint attached to the given rigid-body.
|
|
1631
|
+
*
|
|
1632
|
+
* # Parameters
|
|
1633
|
+
* - `f(handle)`: the function to apply to the integer handle of each joint attached to the rigid-body. Called as `f(collider)`.
|
|
1634
|
+
* @param {number} body
|
|
1635
|
+
* @param {Function} f
|
|
1636
|
+
*/
|
|
1637
|
+
forEachJointAttachedToRigidBody(body: number, f: Function): void;
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
*/
|
|
1641
|
+
export class RawNarrowPhase {
|
|
1642
|
+
free(): void;
|
|
1643
|
+
/**
|
|
1644
|
+
*/
|
|
1645
|
+
constructor();
|
|
1646
|
+
/**
|
|
1647
|
+
* @param {number} handle1
|
|
1648
|
+
* @param {Function} f
|
|
1649
|
+
*/
|
|
1650
|
+
contacts_with(handle1: number, f: Function): void;
|
|
1651
|
+
/**
|
|
1652
|
+
* @param {number} handle1
|
|
1653
|
+
* @param {number} handle2
|
|
1654
|
+
* @returns {RawContactPair | undefined}
|
|
1655
|
+
*/
|
|
1656
|
+
contact_pair(handle1: number, handle2: number): RawContactPair | undefined;
|
|
1657
|
+
/**
|
|
1658
|
+
* @param {number} handle1
|
|
1659
|
+
* @param {Function} f
|
|
1660
|
+
*/
|
|
1661
|
+
intersections_with(handle1: number, f: Function): void;
|
|
1662
|
+
/**
|
|
1663
|
+
* @param {number} handle1
|
|
1664
|
+
* @param {number} handle2
|
|
1665
|
+
* @returns {boolean}
|
|
1666
|
+
*/
|
|
1667
|
+
intersection_pair(handle1: number, handle2: number): boolean;
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
*/
|
|
1671
|
+
export class RawPhysicsPipeline {
|
|
1672
|
+
free(): void;
|
|
1673
|
+
/**
|
|
1674
|
+
*/
|
|
1675
|
+
constructor();
|
|
1676
|
+
/**
|
|
1677
|
+
* @param {RawVector} gravity
|
|
1678
|
+
* @param {RawIntegrationParameters} integrationParameters
|
|
1679
|
+
* @param {RawIslandManager} islands
|
|
1680
|
+
* @param {RawBroadPhase} broadPhase
|
|
1681
|
+
* @param {RawNarrowPhase} narrowPhase
|
|
1682
|
+
* @param {RawRigidBodySet} bodies
|
|
1683
|
+
* @param {RawColliderSet} colliders
|
|
1684
|
+
* @param {RawImpulseJointSet} joints
|
|
1685
|
+
* @param {RawMultibodyJointSet} articulations
|
|
1686
|
+
* @param {RawCCDSolver} ccd_solver
|
|
1687
|
+
*/
|
|
1688
|
+
step(gravity: RawVector, integrationParameters: RawIntegrationParameters, islands: RawIslandManager, broadPhase: RawBroadPhase, narrowPhase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, joints: RawImpulseJointSet, articulations: RawMultibodyJointSet, ccd_solver: RawCCDSolver): void;
|
|
1689
|
+
/**
|
|
1690
|
+
* @param {RawVector} gravity
|
|
1691
|
+
* @param {RawIntegrationParameters} integrationParameters
|
|
1692
|
+
* @param {RawIslandManager} islands
|
|
1693
|
+
* @param {RawBroadPhase} broadPhase
|
|
1694
|
+
* @param {RawNarrowPhase} narrowPhase
|
|
1695
|
+
* @param {RawRigidBodySet} bodies
|
|
1696
|
+
* @param {RawColliderSet} colliders
|
|
1697
|
+
* @param {RawImpulseJointSet} joints
|
|
1698
|
+
* @param {RawMultibodyJointSet} articulations
|
|
1699
|
+
* @param {RawCCDSolver} ccd_solver
|
|
1700
|
+
* @param {RawEventQueue} eventQueue
|
|
1701
|
+
* @param {object} hookObject
|
|
1702
|
+
* @param {Function} hookFilterContactPair
|
|
1703
|
+
* @param {Function} hookFilterIntersectionPair
|
|
1704
|
+
*/
|
|
1705
|
+
stepWithEvents(gravity: RawVector, integrationParameters: RawIntegrationParameters, islands: RawIslandManager, broadPhase: RawBroadPhase, narrowPhase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, joints: RawImpulseJointSet, articulations: RawMultibodyJointSet, ccd_solver: RawCCDSolver, eventQueue: RawEventQueue, hookObject: object, hookFilterContactPair: Function, hookFilterIntersectionPair: Function): void;
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
*/
|
|
1709
|
+
export class RawPointColliderProjection {
|
|
1710
|
+
free(): void;
|
|
1711
|
+
/**
|
|
1712
|
+
* @returns {number}
|
|
1713
|
+
*/
|
|
1714
|
+
colliderHandle(): number;
|
|
1715
|
+
/**
|
|
1716
|
+
* @returns {RawVector}
|
|
1717
|
+
*/
|
|
1718
|
+
point(): RawVector;
|
|
1719
|
+
/**
|
|
1720
|
+
* @returns {boolean}
|
|
1721
|
+
*/
|
|
1722
|
+
isInside(): boolean;
|
|
1723
|
+
/**
|
|
1724
|
+
* @returns {number}
|
|
1725
|
+
*/
|
|
1726
|
+
featureType(): number;
|
|
1727
|
+
/**
|
|
1728
|
+
* @returns {number | undefined}
|
|
1729
|
+
*/
|
|
1730
|
+
featureId(): number | undefined;
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
*/
|
|
1734
|
+
export class RawPointProjection {
|
|
1735
|
+
free(): void;
|
|
1736
|
+
/**
|
|
1737
|
+
* @returns {RawVector}
|
|
1738
|
+
*/
|
|
1739
|
+
point(): RawVector;
|
|
1740
|
+
/**
|
|
1741
|
+
* @returns {boolean}
|
|
1742
|
+
*/
|
|
1743
|
+
isInside(): boolean;
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
*/
|
|
1747
|
+
export class RawQueryPipeline {
|
|
1748
|
+
free(): void;
|
|
1749
|
+
/**
|
|
1750
|
+
*/
|
|
1751
|
+
constructor();
|
|
1752
|
+
/**
|
|
1753
|
+
* @param {RawRigidBodySet} bodies
|
|
1754
|
+
* @param {RawColliderSet} colliders
|
|
1755
|
+
*/
|
|
1756
|
+
update(bodies: RawRigidBodySet, colliders: RawColliderSet): void;
|
|
1757
|
+
/**
|
|
1758
|
+
* @param {RawRigidBodySet} bodies
|
|
1759
|
+
* @param {RawColliderSet} colliders
|
|
1760
|
+
* @param {RawVector} rayOrig
|
|
1761
|
+
* @param {RawVector} rayDir
|
|
1762
|
+
* @param {number} maxToi
|
|
1763
|
+
* @param {boolean} solid
|
|
1764
|
+
* @param {number} filter_flags
|
|
1765
|
+
* @param {number | undefined} filter_groups
|
|
1766
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1767
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1768
|
+
* @param {Function} filter_predicate
|
|
1769
|
+
* @returns {RawRayColliderToi | undefined}
|
|
1770
|
+
*/
|
|
1771
|
+
castRay(bodies: RawRigidBodySet, colliders: RawColliderSet, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): RawRayColliderToi | undefined;
|
|
1772
|
+
/**
|
|
1773
|
+
* @param {RawRigidBodySet} bodies
|
|
1774
|
+
* @param {RawColliderSet} colliders
|
|
1775
|
+
* @param {RawVector} rayOrig
|
|
1776
|
+
* @param {RawVector} rayDir
|
|
1777
|
+
* @param {number} maxToi
|
|
1778
|
+
* @param {boolean} solid
|
|
1779
|
+
* @param {number} filter_flags
|
|
1780
|
+
* @param {number | undefined} filter_groups
|
|
1781
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1782
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1783
|
+
* @param {Function} filter_predicate
|
|
1784
|
+
* @returns {RawRayColliderIntersection | undefined}
|
|
1785
|
+
*/
|
|
1786
|
+
castRayAndGetNormal(bodies: RawRigidBodySet, colliders: RawColliderSet, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): RawRayColliderIntersection | undefined;
|
|
1787
|
+
/**
|
|
1788
|
+
* @param {RawRigidBodySet} bodies
|
|
1789
|
+
* @param {RawColliderSet} colliders
|
|
1790
|
+
* @param {RawVector} rayOrig
|
|
1791
|
+
* @param {RawVector} rayDir
|
|
1792
|
+
* @param {number} maxToi
|
|
1793
|
+
* @param {boolean} solid
|
|
1794
|
+
* @param {Function} callback
|
|
1795
|
+
* @param {number} filter_flags
|
|
1796
|
+
* @param {number | undefined} filter_groups
|
|
1797
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1798
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1799
|
+
* @param {Function} filter_predicate
|
|
1800
|
+
*/
|
|
1801
|
+
intersectionsWithRay(bodies: RawRigidBodySet, colliders: RawColliderSet, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean, callback: Function, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): void;
|
|
1802
|
+
/**
|
|
1803
|
+
* @param {RawRigidBodySet} bodies
|
|
1804
|
+
* @param {RawColliderSet} colliders
|
|
1805
|
+
* @param {RawVector} shapePos
|
|
1806
|
+
* @param {RawRotation} shapeRot
|
|
1807
|
+
* @param {RawShape} shape
|
|
1808
|
+
* @param {number} filter_flags
|
|
1809
|
+
* @param {number | undefined} filter_groups
|
|
1810
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1811
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1812
|
+
* @param {Function} filter_predicate
|
|
1813
|
+
* @returns {number | undefined}
|
|
1814
|
+
*/
|
|
1815
|
+
intersectionWithShape(bodies: RawRigidBodySet, colliders: RawColliderSet, shapePos: RawVector, shapeRot: RawRotation, shape: RawShape, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): number | undefined;
|
|
1816
|
+
/**
|
|
1817
|
+
* @param {RawRigidBodySet} bodies
|
|
1818
|
+
* @param {RawColliderSet} colliders
|
|
1819
|
+
* @param {RawVector} point
|
|
1820
|
+
* @param {boolean} solid
|
|
1821
|
+
* @param {number} filter_flags
|
|
1822
|
+
* @param {number | undefined} filter_groups
|
|
1823
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1824
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1825
|
+
* @param {Function} filter_predicate
|
|
1826
|
+
* @returns {RawPointColliderProjection | undefined}
|
|
1827
|
+
*/
|
|
1828
|
+
projectPoint(bodies: RawRigidBodySet, colliders: RawColliderSet, point: RawVector, solid: boolean, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): RawPointColliderProjection | undefined;
|
|
1829
|
+
/**
|
|
1830
|
+
* @param {RawRigidBodySet} bodies
|
|
1831
|
+
* @param {RawColliderSet} colliders
|
|
1832
|
+
* @param {RawVector} point
|
|
1833
|
+
* @param {number} filter_flags
|
|
1834
|
+
* @param {number | undefined} filter_groups
|
|
1835
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1836
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1837
|
+
* @param {Function} filter_predicate
|
|
1838
|
+
* @returns {RawPointColliderProjection | undefined}
|
|
1839
|
+
*/
|
|
1840
|
+
projectPointAndGetFeature(bodies: RawRigidBodySet, colliders: RawColliderSet, point: RawVector, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): RawPointColliderProjection | undefined;
|
|
1841
|
+
/**
|
|
1842
|
+
* @param {RawRigidBodySet} bodies
|
|
1843
|
+
* @param {RawColliderSet} colliders
|
|
1844
|
+
* @param {RawVector} point
|
|
1845
|
+
* @param {Function} callback
|
|
1846
|
+
* @param {number} filter_flags
|
|
1847
|
+
* @param {number | undefined} filter_groups
|
|
1848
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1849
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1850
|
+
* @param {Function} filter_predicate
|
|
1851
|
+
*/
|
|
1852
|
+
intersectionsWithPoint(bodies: RawRigidBodySet, colliders: RawColliderSet, point: RawVector, callback: Function, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): void;
|
|
1853
|
+
/**
|
|
1854
|
+
* @param {RawRigidBodySet} bodies
|
|
1855
|
+
* @param {RawColliderSet} colliders
|
|
1856
|
+
* @param {RawVector} shapePos
|
|
1857
|
+
* @param {RawRotation} shapeRot
|
|
1858
|
+
* @param {RawVector} shapeVel
|
|
1859
|
+
* @param {RawShape} shape
|
|
1860
|
+
* @param {number} maxToi
|
|
1861
|
+
* @param {boolean} stop_at_penetration
|
|
1862
|
+
* @param {number} filter_flags
|
|
1863
|
+
* @param {number | undefined} filter_groups
|
|
1864
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1865
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1866
|
+
* @param {Function} filter_predicate
|
|
1867
|
+
* @returns {RawShapeColliderTOI | undefined}
|
|
1868
|
+
*/
|
|
1869
|
+
castShape(bodies: RawRigidBodySet, colliders: RawColliderSet, shapePos: RawVector, shapeRot: RawRotation, shapeVel: RawVector, shape: RawShape, maxToi: number, stop_at_penetration: boolean, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): RawShapeColliderTOI | undefined;
|
|
1870
|
+
/**
|
|
1871
|
+
* @param {RawRigidBodySet} bodies
|
|
1872
|
+
* @param {RawColliderSet} colliders
|
|
1873
|
+
* @param {RawVector} shapePos
|
|
1874
|
+
* @param {RawRotation} shapeRot
|
|
1875
|
+
* @param {RawShape} shape
|
|
1876
|
+
* @param {Function} callback
|
|
1877
|
+
* @param {number} filter_flags
|
|
1878
|
+
* @param {number | undefined} filter_groups
|
|
1879
|
+
* @param {number | undefined} filter_exclude_collider
|
|
1880
|
+
* @param {number | undefined} filter_exclude_rigid_body
|
|
1881
|
+
* @param {Function} filter_predicate
|
|
1882
|
+
*/
|
|
1883
|
+
intersectionsWithShape(bodies: RawRigidBodySet, colliders: RawColliderSet, shapePos: RawVector, shapeRot: RawRotation, shape: RawShape, callback: Function, filter_flags: number, filter_groups: number | undefined, filter_exclude_collider: number | undefined, filter_exclude_rigid_body: number | undefined, filter_predicate: Function): void;
|
|
1884
|
+
/**
|
|
1885
|
+
* @param {RawVector} aabbCenter
|
|
1886
|
+
* @param {RawVector} aabbHalfExtents
|
|
1887
|
+
* @param {Function} callback
|
|
1888
|
+
*/
|
|
1889
|
+
collidersWithAabbIntersectingAabb(aabbCenter: RawVector, aabbHalfExtents: RawVector, callback: Function): void;
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
*/
|
|
1893
|
+
export class RawRayColliderIntersection {
|
|
1894
|
+
free(): void;
|
|
1895
|
+
/**
|
|
1896
|
+
* @returns {number}
|
|
1897
|
+
*/
|
|
1898
|
+
colliderHandle(): number;
|
|
1899
|
+
/**
|
|
1900
|
+
* @returns {RawVector}
|
|
1901
|
+
*/
|
|
1902
|
+
normal(): RawVector;
|
|
1903
|
+
/**
|
|
1904
|
+
* @returns {number}
|
|
1905
|
+
*/
|
|
1906
|
+
toi(): number;
|
|
1907
|
+
/**
|
|
1908
|
+
* @returns {number}
|
|
1909
|
+
*/
|
|
1910
|
+
featureType(): number;
|
|
1911
|
+
/**
|
|
1912
|
+
* @returns {number | undefined}
|
|
1913
|
+
*/
|
|
1914
|
+
featureId(): number | undefined;
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
*/
|
|
1918
|
+
export class RawRayColliderToi {
|
|
1919
|
+
free(): void;
|
|
1920
|
+
/**
|
|
1921
|
+
* @returns {number}
|
|
1922
|
+
*/
|
|
1923
|
+
colliderHandle(): number;
|
|
1924
|
+
/**
|
|
1925
|
+
* @returns {number}
|
|
1926
|
+
*/
|
|
1927
|
+
toi(): number;
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
*/
|
|
1931
|
+
export class RawRayIntersection {
|
|
1932
|
+
free(): void;
|
|
1933
|
+
/**
|
|
1934
|
+
* @returns {RawVector}
|
|
1935
|
+
*/
|
|
1936
|
+
normal(): RawVector;
|
|
1937
|
+
/**
|
|
1938
|
+
* @returns {number}
|
|
1939
|
+
*/
|
|
1940
|
+
toi(): number;
|
|
1941
|
+
/**
|
|
1942
|
+
* @returns {number}
|
|
1943
|
+
*/
|
|
1944
|
+
featureType(): number;
|
|
1945
|
+
/**
|
|
1946
|
+
* @returns {number | undefined}
|
|
1947
|
+
*/
|
|
1948
|
+
featureId(): number | undefined;
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
*/
|
|
1952
|
+
export class RawRigidBodySet {
|
|
1953
|
+
free(): void;
|
|
1954
|
+
/**
|
|
1955
|
+
* The world-space translation of this rigid-body.
|
|
1956
|
+
* @param {number} handle
|
|
1957
|
+
* @returns {RawVector}
|
|
1958
|
+
*/
|
|
1959
|
+
rbTranslation(handle: number): RawVector;
|
|
1960
|
+
/**
|
|
1961
|
+
* The world-space orientation of this rigid-body.
|
|
1962
|
+
* @param {number} handle
|
|
1963
|
+
* @returns {RawRotation}
|
|
1964
|
+
*/
|
|
1965
|
+
rbRotation(handle: number): RawRotation;
|
|
1966
|
+
/**
|
|
1967
|
+
* Put the given rigid-body to sleep.
|
|
1968
|
+
* @param {number} handle
|
|
1969
|
+
*/
|
|
1970
|
+
rbSleep(handle: number): void;
|
|
1971
|
+
/**
|
|
1972
|
+
* Is this rigid-body sleeping?
|
|
1973
|
+
* @param {number} handle
|
|
1974
|
+
* @returns {boolean}
|
|
1975
|
+
*/
|
|
1976
|
+
rbIsSleeping(handle: number): boolean;
|
|
1977
|
+
/**
|
|
1978
|
+
* Is the velocity of this rigid-body not zero?
|
|
1979
|
+
* @param {number} handle
|
|
1980
|
+
* @returns {boolean}
|
|
1981
|
+
*/
|
|
1982
|
+
rbIsMoving(handle: number): boolean;
|
|
1983
|
+
/**
|
|
1984
|
+
* The world-space predicted translation of this rigid-body.
|
|
1985
|
+
*
|
|
1986
|
+
* If this rigid-body is kinematic this value is set by the `setNextKinematicTranslation`
|
|
1987
|
+
* method and is used for estimating the kinematic body velocity at the next timestep.
|
|
1988
|
+
* For non-kinematic bodies, this value is currently unspecified.
|
|
1989
|
+
* @param {number} handle
|
|
1990
|
+
* @returns {RawVector}
|
|
1991
|
+
*/
|
|
1992
|
+
rbNextTranslation(handle: number): RawVector;
|
|
1993
|
+
/**
|
|
1994
|
+
* The world-space predicted orientation of this rigid-body.
|
|
1995
|
+
*
|
|
1996
|
+
* If this rigid-body is kinematic this value is set by the `setNextKinematicRotation`
|
|
1997
|
+
* method and is used for estimating the kinematic body velocity at the next timestep.
|
|
1998
|
+
* For non-kinematic bodies, this value is currently unspecified.
|
|
1999
|
+
* @param {number} handle
|
|
2000
|
+
* @returns {RawRotation}
|
|
2001
|
+
*/
|
|
2002
|
+
rbNextRotation(handle: number): RawRotation;
|
|
2003
|
+
/**
|
|
2004
|
+
* Sets the translation of this rigid-body.
|
|
2005
|
+
*
|
|
2006
|
+
* # Parameters
|
|
2007
|
+
* - `x`: the world-space position of the rigid-body along the `x` axis.
|
|
2008
|
+
* - `y`: the world-space position of the rigid-body along the `y` axis.
|
|
2009
|
+
* - `z`: the world-space position of the rigid-body along the `z` axis.
|
|
2010
|
+
* - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it
|
|
2011
|
+
* wasn't moving before modifying its position.
|
|
2012
|
+
* @param {number} handle
|
|
2013
|
+
* @param {number} x
|
|
2014
|
+
* @param {number} y
|
|
2015
|
+
* @param {number} z
|
|
2016
|
+
* @param {boolean} wakeUp
|
|
2017
|
+
*/
|
|
2018
|
+
rbSetTranslation(handle: number, x: number, y: number, z: number, wakeUp: boolean): void;
|
|
2019
|
+
/**
|
|
2020
|
+
* Sets the rotation quaternion of this rigid-body.
|
|
2021
|
+
*
|
|
2022
|
+
* This does nothing if a zero quaternion is provided.
|
|
2023
|
+
*
|
|
2024
|
+
* # Parameters
|
|
2025
|
+
* - `x`: the first vector component of the quaternion.
|
|
2026
|
+
* - `y`: the second vector component of the quaternion.
|
|
2027
|
+
* - `z`: the third vector component of the quaternion.
|
|
2028
|
+
* - `w`: the scalar component of the quaternion.
|
|
2029
|
+
* - `wakeUp`: forces the rigid-body to wake-up so it is properly affected by forces if it
|
|
2030
|
+
* wasn't moving before modifying its position.
|
|
2031
|
+
* @param {number} handle
|
|
2032
|
+
* @param {number} x
|
|
2033
|
+
* @param {number} y
|
|
2034
|
+
* @param {number} z
|
|
2035
|
+
* @param {number} w
|
|
2036
|
+
* @param {boolean} wakeUp
|
|
2037
|
+
*/
|
|
2038
|
+
rbSetRotation(handle: number, x: number, y: number, z: number, w: number, wakeUp: boolean): void;
|
|
2039
|
+
/**
|
|
2040
|
+
* Sets the linear velocity of this rigid-body.
|
|
2041
|
+
* @param {number} handle
|
|
2042
|
+
* @param {RawVector} linvel
|
|
2043
|
+
* @param {boolean} wakeUp
|
|
2044
|
+
*/
|
|
2045
|
+
rbSetLinvel(handle: number, linvel: RawVector, wakeUp: boolean): void;
|
|
2046
|
+
/**
|
|
2047
|
+
* Sets the angular velocity of this rigid-body.
|
|
2048
|
+
* @param {number} handle
|
|
2049
|
+
* @param {RawVector} angvel
|
|
2050
|
+
* @param {boolean} wakeUp
|
|
2051
|
+
*/
|
|
2052
|
+
rbSetAngvel(handle: number, angvel: RawVector, wakeUp: boolean): void;
|
|
2053
|
+
/**
|
|
2054
|
+
* If this rigid body is kinematic, sets its future translation after the next timestep integration.
|
|
2055
|
+
*
|
|
2056
|
+
* This should be used instead of `rigidBody.setTranslation` to make the dynamic object
|
|
2057
|
+
* interacting with this kinematic body behave as expected. Internally, Rapier will compute
|
|
2058
|
+
* an artificial velocity for this rigid-body from its current position and its next kinematic
|
|
2059
|
+
* position. This velocity will be used to compute forces on dynamic bodies interacting with
|
|
2060
|
+
* this body.
|
|
2061
|
+
*
|
|
2062
|
+
* # Parameters
|
|
2063
|
+
* - `x`: the world-space position of the rigid-body along the `x` axis.
|
|
2064
|
+
* - `y`: the world-space position of the rigid-body along the `y` axis.
|
|
2065
|
+
* - `z`: the world-space position of the rigid-body along the `z` axis.
|
|
2066
|
+
* @param {number} handle
|
|
2067
|
+
* @param {number} x
|
|
2068
|
+
* @param {number} y
|
|
2069
|
+
* @param {number} z
|
|
2070
|
+
*/
|
|
2071
|
+
rbSetNextKinematicTranslation(handle: number, x: number, y: number, z: number): void;
|
|
2072
|
+
/**
|
|
2073
|
+
* If this rigid body is kinematic, sets its future rotation after the next timestep integration.
|
|
2074
|
+
*
|
|
2075
|
+
* This should be used instead of `rigidBody.setRotation` to make the dynamic object
|
|
2076
|
+
* interacting with this kinematic body behave as expected. Internally, Rapier will compute
|
|
2077
|
+
* an artificial velocity for this rigid-body from its current position and its next kinematic
|
|
2078
|
+
* position. This velocity will be used to compute forces on dynamic bodies interacting with
|
|
2079
|
+
* this body.
|
|
2080
|
+
*
|
|
2081
|
+
* # Parameters
|
|
2082
|
+
* - `x`: the first vector component of the quaternion.
|
|
2083
|
+
* - `y`: the second vector component of the quaternion.
|
|
2084
|
+
* - `z`: the third vector component of the quaternion.
|
|
2085
|
+
* - `w`: the scalar component of the quaternion.
|
|
2086
|
+
* @param {number} handle
|
|
2087
|
+
* @param {number} x
|
|
2088
|
+
* @param {number} y
|
|
2089
|
+
* @param {number} z
|
|
2090
|
+
* @param {number} w
|
|
2091
|
+
*/
|
|
2092
|
+
rbSetNextKinematicRotation(handle: number, x: number, y: number, z: number, w: number): void;
|
|
2093
|
+
/**
|
|
2094
|
+
* @param {number} handle
|
|
2095
|
+
* @param {RawColliderSet} colliders
|
|
2096
|
+
*/
|
|
2097
|
+
rbRecomputeMassPropertiesFromColliders(handle: number, colliders: RawColliderSet): void;
|
|
2098
|
+
/**
|
|
2099
|
+
* @param {number} handle
|
|
2100
|
+
* @param {number} mass
|
|
2101
|
+
* @param {boolean} wake_up
|
|
2102
|
+
*/
|
|
2103
|
+
rbSetAdditionalMass(handle: number, mass: number, wake_up: boolean): void;
|
|
2104
|
+
/**
|
|
2105
|
+
* @param {number} handle
|
|
2106
|
+
* @param {number} mass
|
|
2107
|
+
* @param {RawVector} centerOfMass
|
|
2108
|
+
* @param {RawVector} principalAngularInertia
|
|
2109
|
+
* @param {RawRotation} angularInertiaFrame
|
|
2110
|
+
* @param {boolean} wake_up
|
|
2111
|
+
*/
|
|
2112
|
+
rbSetAdditionalMassProperties(handle: number, mass: number, centerOfMass: RawVector, principalAngularInertia: RawVector, angularInertiaFrame: RawRotation, wake_up: boolean): void;
|
|
2113
|
+
/**
|
|
2114
|
+
* The linear velocity of this rigid-body.
|
|
2115
|
+
* @param {number} handle
|
|
2116
|
+
* @returns {RawVector}
|
|
2117
|
+
*/
|
|
2118
|
+
rbLinvel(handle: number): RawVector;
|
|
2119
|
+
/**
|
|
2120
|
+
* The angular velocity of this rigid-body.
|
|
2121
|
+
* @param {number} handle
|
|
2122
|
+
* @returns {RawVector}
|
|
2123
|
+
*/
|
|
2124
|
+
rbAngvel(handle: number): RawVector;
|
|
2125
|
+
/**
|
|
2126
|
+
* @param {number} handle
|
|
2127
|
+
* @param {boolean} locked
|
|
2128
|
+
* @param {boolean} wake_up
|
|
2129
|
+
*/
|
|
2130
|
+
rbLockTranslations(handle: number, locked: boolean, wake_up: boolean): void;
|
|
2131
|
+
/**
|
|
2132
|
+
* @param {number} handle
|
|
2133
|
+
* @param {boolean} allow_x
|
|
2134
|
+
* @param {boolean} allow_y
|
|
2135
|
+
* @param {boolean} allow_z
|
|
2136
|
+
* @param {boolean} wake_up
|
|
2137
|
+
*/
|
|
2138
|
+
rbSetEnabledTranslations(handle: number, allow_x: boolean, allow_y: boolean, allow_z: boolean, wake_up: boolean): void;
|
|
2139
|
+
/**
|
|
2140
|
+
* @param {number} handle
|
|
2141
|
+
* @param {boolean} locked
|
|
2142
|
+
* @param {boolean} wake_up
|
|
2143
|
+
*/
|
|
2144
|
+
rbLockRotations(handle: number, locked: boolean, wake_up: boolean): void;
|
|
2145
|
+
/**
|
|
2146
|
+
* @param {number} handle
|
|
2147
|
+
* @param {boolean} allow_x
|
|
2148
|
+
* @param {boolean} allow_y
|
|
2149
|
+
* @param {boolean} allow_z
|
|
2150
|
+
* @param {boolean} wake_up
|
|
2151
|
+
*/
|
|
2152
|
+
rbSetEnabledRotations(handle: number, allow_x: boolean, allow_y: boolean, allow_z: boolean, wake_up: boolean): void;
|
|
2153
|
+
/**
|
|
2154
|
+
* @param {number} handle
|
|
2155
|
+
* @returns {number}
|
|
2156
|
+
*/
|
|
2157
|
+
rbDominanceGroup(handle: number): number;
|
|
2158
|
+
/**
|
|
2159
|
+
* @param {number} handle
|
|
2160
|
+
* @param {number} group
|
|
2161
|
+
*/
|
|
2162
|
+
rbSetDominanceGroup(handle: number, group: number): void;
|
|
2163
|
+
/**
|
|
2164
|
+
* @param {number} handle
|
|
2165
|
+
* @param {boolean} enabled
|
|
2166
|
+
*/
|
|
2167
|
+
rbEnableCcd(handle: number, enabled: boolean): void;
|
|
2168
|
+
/**
|
|
2169
|
+
* The mass of this rigid-body.
|
|
2170
|
+
* @param {number} handle
|
|
2171
|
+
* @returns {number}
|
|
2172
|
+
*/
|
|
2173
|
+
rbMass(handle: number): number;
|
|
2174
|
+
/**
|
|
2175
|
+
* The inverse of the mass of a rigid-body.
|
|
2176
|
+
*
|
|
2177
|
+
* If this is zero, the rigid-body is assumed to have infinite mass.
|
|
2178
|
+
* @param {number} handle
|
|
2179
|
+
* @returns {number}
|
|
2180
|
+
*/
|
|
2181
|
+
rbInvMass(handle: number): number;
|
|
2182
|
+
/**
|
|
2183
|
+
* The inverse mass taking into account translation locking.
|
|
2184
|
+
* @param {number} handle
|
|
2185
|
+
* @returns {RawVector}
|
|
2186
|
+
*/
|
|
2187
|
+
rbEffectiveInvMass(handle: number): RawVector;
|
|
2188
|
+
/**
|
|
2189
|
+
* The center of mass of a rigid-body expressed in its local-space.
|
|
2190
|
+
* @param {number} handle
|
|
2191
|
+
* @returns {RawVector}
|
|
2192
|
+
*/
|
|
2193
|
+
rbLocalCom(handle: number): RawVector;
|
|
2194
|
+
/**
|
|
2195
|
+
* The world-space center of mass of the rigid-body.
|
|
2196
|
+
* @param {number} handle
|
|
2197
|
+
* @returns {RawVector}
|
|
2198
|
+
*/
|
|
2199
|
+
rbWorldCom(handle: number): RawVector;
|
|
2200
|
+
/**
|
|
2201
|
+
* The inverse of the principal angular inertia of the rigid-body.
|
|
2202
|
+
*
|
|
2203
|
+
* Components set to zero are assumed to be infinite along the corresponding principal axis.
|
|
2204
|
+
* @param {number} handle
|
|
2205
|
+
* @returns {RawVector}
|
|
2206
|
+
*/
|
|
2207
|
+
rbInvPrincipalInertiaSqrt(handle: number): RawVector;
|
|
2208
|
+
/**
|
|
2209
|
+
* The principal vectors of the local angular inertia tensor of the rigid-body.
|
|
2210
|
+
* @param {number} handle
|
|
2211
|
+
* @returns {RawRotation}
|
|
2212
|
+
*/
|
|
2213
|
+
rbPrincipalInertiaLocalFrame(handle: number): RawRotation;
|
|
2214
|
+
/**
|
|
2215
|
+
* The angular inertia along the principal inertia axes of the rigid-body.
|
|
2216
|
+
* @param {number} handle
|
|
2217
|
+
* @returns {RawVector}
|
|
2218
|
+
*/
|
|
2219
|
+
rbPrincipalInertia(handle: number): RawVector;
|
|
2220
|
+
/**
|
|
2221
|
+
* The square-root of the world-space inverse angular inertia tensor of the rigid-body,
|
|
2222
|
+
* taking into account rotation locking.
|
|
2223
|
+
* @param {number} handle
|
|
2224
|
+
* @returns {RawSdpMatrix3}
|
|
2225
|
+
*/
|
|
2226
|
+
rbEffectiveWorldInvInertiaSqrt(handle: number): RawSdpMatrix3;
|
|
2227
|
+
/**
|
|
2228
|
+
* The effective world-space angular inertia (that takes the potential rotation locking into account) of
|
|
2229
|
+
* this rigid-body.
|
|
2230
|
+
* @param {number} handle
|
|
2231
|
+
* @returns {RawSdpMatrix3}
|
|
2232
|
+
*/
|
|
2233
|
+
rbEffectiveAngularInertia(handle: number): RawSdpMatrix3;
|
|
2234
|
+
/**
|
|
2235
|
+
* Wakes this rigid-body up.
|
|
2236
|
+
*
|
|
2237
|
+
* A dynamic rigid-body that does not move during several consecutive frames will
|
|
2238
|
+
* be put to sleep by the physics engine, i.e., it will stop being simulated in order
|
|
2239
|
+
* to avoid useless computations.
|
|
2240
|
+
* This methods forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying
|
|
2241
|
+
* the position of a dynamic body so that it is properly simulated afterwards.
|
|
2242
|
+
* @param {number} handle
|
|
2243
|
+
*/
|
|
2244
|
+
rbWakeUp(handle: number): void;
|
|
2245
|
+
/**
|
|
2246
|
+
* Is Continuous Collision Detection enabled for this rigid-body?
|
|
2247
|
+
* @param {number} handle
|
|
2248
|
+
* @returns {boolean}
|
|
2249
|
+
*/
|
|
2250
|
+
rbIsCcdEnabled(handle: number): boolean;
|
|
2251
|
+
/**
|
|
2252
|
+
* The number of colliders attached to this rigid-body.
|
|
2253
|
+
* @param {number} handle
|
|
2254
|
+
* @returns {number}
|
|
2255
|
+
*/
|
|
2256
|
+
rbNumColliders(handle: number): number;
|
|
2257
|
+
/**
|
|
2258
|
+
* Retrieves the `i-th` collider attached to this rigid-body.
|
|
2259
|
+
*
|
|
2260
|
+
* # Parameters
|
|
2261
|
+
* - `at`: The index of the collider to retrieve. Must be a number in `[0, this.numColliders()[`.
|
|
2262
|
+
* This index is **not** the same as the unique identifier of the collider.
|
|
2263
|
+
* @param {number} handle
|
|
2264
|
+
* @param {number} at
|
|
2265
|
+
* @returns {number}
|
|
2266
|
+
*/
|
|
2267
|
+
rbCollider(handle: number, at: number): number;
|
|
2268
|
+
/**
|
|
2269
|
+
* The status of this rigid-body: fixed, dynamic, or kinematic.
|
|
2270
|
+
* @param {number} handle
|
|
2271
|
+
* @returns {number}
|
|
2272
|
+
*/
|
|
2273
|
+
rbBodyType(handle: number): number;
|
|
2274
|
+
/**
|
|
2275
|
+
* Set a new status for this rigid-body: fixed, dynamic, or kinematic.
|
|
2276
|
+
* @param {number} handle
|
|
2277
|
+
* @param {number} status
|
|
2278
|
+
* @param {boolean} wake_up
|
|
2279
|
+
*/
|
|
2280
|
+
rbSetBodyType(handle: number, status: number, wake_up: boolean): void;
|
|
2281
|
+
/**
|
|
2282
|
+
* Is this rigid-body fixed?
|
|
2283
|
+
* @param {number} handle
|
|
2284
|
+
* @returns {boolean}
|
|
2285
|
+
*/
|
|
2286
|
+
rbIsFixed(handle: number): boolean;
|
|
2287
|
+
/**
|
|
2288
|
+
* Is this rigid-body kinematic?
|
|
2289
|
+
* @param {number} handle
|
|
2290
|
+
* @returns {boolean}
|
|
2291
|
+
*/
|
|
2292
|
+
rbIsKinematic(handle: number): boolean;
|
|
2293
|
+
/**
|
|
2294
|
+
* Is this rigid-body dynamic?
|
|
2295
|
+
* @param {number} handle
|
|
2296
|
+
* @returns {boolean}
|
|
2297
|
+
*/
|
|
2298
|
+
rbIsDynamic(handle: number): boolean;
|
|
2299
|
+
/**
|
|
2300
|
+
* The linear damping coefficient of this rigid-body.
|
|
2301
|
+
* @param {number} handle
|
|
2302
|
+
* @returns {number}
|
|
2303
|
+
*/
|
|
2304
|
+
rbLinearDamping(handle: number): number;
|
|
2305
|
+
/**
|
|
2306
|
+
* The angular damping coefficient of this rigid-body.
|
|
2307
|
+
* @param {number} handle
|
|
2308
|
+
* @returns {number}
|
|
2309
|
+
*/
|
|
2310
|
+
rbAngularDamping(handle: number): number;
|
|
2311
|
+
/**
|
|
2312
|
+
* @param {number} handle
|
|
2313
|
+
* @param {number} factor
|
|
2314
|
+
*/
|
|
2315
|
+
rbSetLinearDamping(handle: number, factor: number): void;
|
|
2316
|
+
/**
|
|
2317
|
+
* @param {number} handle
|
|
2318
|
+
* @param {number} factor
|
|
2319
|
+
*/
|
|
2320
|
+
rbSetAngularDamping(handle: number, factor: number): void;
|
|
2321
|
+
/**
|
|
2322
|
+
* @param {number} handle
|
|
2323
|
+
* @param {boolean} enabled
|
|
2324
|
+
*/
|
|
2325
|
+
rbSetEnabled(handle: number, enabled: boolean): void;
|
|
2326
|
+
/**
|
|
2327
|
+
* @param {number} handle
|
|
2328
|
+
* @returns {boolean}
|
|
2329
|
+
*/
|
|
2330
|
+
rbIsEnabled(handle: number): boolean;
|
|
2331
|
+
/**
|
|
2332
|
+
* @param {number} handle
|
|
2333
|
+
* @returns {number}
|
|
2334
|
+
*/
|
|
2335
|
+
rbGravityScale(handle: number): number;
|
|
2336
|
+
/**
|
|
2337
|
+
* @param {number} handle
|
|
2338
|
+
* @param {number} factor
|
|
2339
|
+
* @param {boolean} wakeUp
|
|
2340
|
+
*/
|
|
2341
|
+
rbSetGravityScale(handle: number, factor: number, wakeUp: boolean): void;
|
|
2342
|
+
/**
|
|
2343
|
+
* Resets to zero all user-added forces added to this rigid-body.
|
|
2344
|
+
* @param {number} handle
|
|
2345
|
+
* @param {boolean} wakeUp
|
|
2346
|
+
*/
|
|
2347
|
+
rbResetForces(handle: number, wakeUp: boolean): void;
|
|
2348
|
+
/**
|
|
2349
|
+
* Resets to zero all user-added torques added to this rigid-body.
|
|
2350
|
+
* @param {number} handle
|
|
2351
|
+
* @param {boolean} wakeUp
|
|
2352
|
+
*/
|
|
2353
|
+
rbResetTorques(handle: number, wakeUp: boolean): void;
|
|
2354
|
+
/**
|
|
2355
|
+
* Adds a force at the center-of-mass of this rigid-body.
|
|
2356
|
+
*
|
|
2357
|
+
* # Parameters
|
|
2358
|
+
* - `force`: the world-space force to apply on the rigid-body.
|
|
2359
|
+
* - `wakeUp`: should the rigid-body be automatically woken-up?
|
|
2360
|
+
* @param {number} handle
|
|
2361
|
+
* @param {RawVector} force
|
|
2362
|
+
* @param {boolean} wakeUp
|
|
2363
|
+
*/
|
|
2364
|
+
rbAddForce(handle: number, force: RawVector, wakeUp: boolean): void;
|
|
2365
|
+
/**
|
|
2366
|
+
* Applies an impulse at the center-of-mass of this rigid-body.
|
|
2367
|
+
*
|
|
2368
|
+
* # Parameters
|
|
2369
|
+
* - `impulse`: the world-space impulse to apply on the rigid-body.
|
|
2370
|
+
* - `wakeUp`: should the rigid-body be automatically woken-up?
|
|
2371
|
+
* @param {number} handle
|
|
2372
|
+
* @param {RawVector} impulse
|
|
2373
|
+
* @param {boolean} wakeUp
|
|
2374
|
+
*/
|
|
2375
|
+
rbApplyImpulse(handle: number, impulse: RawVector, wakeUp: boolean): void;
|
|
2376
|
+
/**
|
|
2377
|
+
* Adds a torque at the center-of-mass of this rigid-body.
|
|
2378
|
+
*
|
|
2379
|
+
* # Parameters
|
|
2380
|
+
* - `torque`: the world-space torque to apply on the rigid-body.
|
|
2381
|
+
* - `wakeUp`: should the rigid-body be automatically woken-up?
|
|
2382
|
+
* @param {number} handle
|
|
2383
|
+
* @param {RawVector} torque
|
|
2384
|
+
* @param {boolean} wakeUp
|
|
2385
|
+
*/
|
|
2386
|
+
rbAddTorque(handle: number, torque: RawVector, wakeUp: boolean): void;
|
|
2387
|
+
/**
|
|
2388
|
+
* Applies an impulsive torque at the center-of-mass of this rigid-body.
|
|
2389
|
+
*
|
|
2390
|
+
* # Parameters
|
|
2391
|
+
* - `torque impulse`: the world-space torque impulse to apply on the rigid-body.
|
|
2392
|
+
* - `wakeUp`: should the rigid-body be automatically woken-up?
|
|
2393
|
+
* @param {number} handle
|
|
2394
|
+
* @param {RawVector} torque_impulse
|
|
2395
|
+
* @param {boolean} wakeUp
|
|
2396
|
+
*/
|
|
2397
|
+
rbApplyTorqueImpulse(handle: number, torque_impulse: RawVector, wakeUp: boolean): void;
|
|
2398
|
+
/**
|
|
2399
|
+
* Adds a force at the given world-space point of this rigid-body.
|
|
2400
|
+
*
|
|
2401
|
+
* # Parameters
|
|
2402
|
+
* - `force`: the world-space force to apply on the rigid-body.
|
|
2403
|
+
* - `point`: the world-space point where the impulse is to be applied on the rigid-body.
|
|
2404
|
+
* - `wakeUp`: should the rigid-body be automatically woken-up?
|
|
2405
|
+
* @param {number} handle
|
|
2406
|
+
* @param {RawVector} force
|
|
2407
|
+
* @param {RawVector} point
|
|
2408
|
+
* @param {boolean} wakeUp
|
|
2409
|
+
*/
|
|
2410
|
+
rbAddForceAtPoint(handle: number, force: RawVector, point: RawVector, wakeUp: boolean): void;
|
|
2411
|
+
/**
|
|
2412
|
+
* Applies an impulse at the given world-space point of this rigid-body.
|
|
2413
|
+
*
|
|
2414
|
+
* # Parameters
|
|
2415
|
+
* - `impulse`: the world-space impulse to apply on the rigid-body.
|
|
2416
|
+
* - `point`: the world-space point where the impulse is to be applied on the rigid-body.
|
|
2417
|
+
* - `wakeUp`: should the rigid-body be automatically woken-up?
|
|
2418
|
+
* @param {number} handle
|
|
2419
|
+
* @param {RawVector} impulse
|
|
2420
|
+
* @param {RawVector} point
|
|
2421
|
+
* @param {boolean} wakeUp
|
|
2422
|
+
*/
|
|
2423
|
+
rbApplyImpulseAtPoint(handle: number, impulse: RawVector, point: RawVector, wakeUp: boolean): void;
|
|
2424
|
+
/**
|
|
2425
|
+
* An arbitrary user-defined 32-bit integer
|
|
2426
|
+
* @param {number} handle
|
|
2427
|
+
* @returns {number}
|
|
2428
|
+
*/
|
|
2429
|
+
rbUserData(handle: number): number;
|
|
2430
|
+
/**
|
|
2431
|
+
* Sets the user-defined 32-bit integer of this rigid-body.
|
|
2432
|
+
*
|
|
2433
|
+
* # Parameters
|
|
2434
|
+
* - `data`: an arbitrary user-defined 32-bit integer.
|
|
2435
|
+
* @param {number} handle
|
|
2436
|
+
* @param {number} data
|
|
2437
|
+
*/
|
|
2438
|
+
rbSetUserData(handle: number, data: number): void;
|
|
2439
|
+
/**
|
|
2440
|
+
*/
|
|
2441
|
+
constructor();
|
|
2442
|
+
/**
|
|
2443
|
+
* @param {boolean} enabled
|
|
2444
|
+
* @param {RawVector} translation
|
|
2445
|
+
* @param {RawRotation} rotation
|
|
2446
|
+
* @param {number} gravityScale
|
|
2447
|
+
* @param {number} mass
|
|
2448
|
+
* @param {boolean} massOnly
|
|
2449
|
+
* @param {RawVector} centerOfMass
|
|
2450
|
+
* @param {RawVector} linvel
|
|
2451
|
+
* @param {RawVector} angvel
|
|
2452
|
+
* @param {RawVector} principalAngularInertia
|
|
2453
|
+
* @param {RawRotation} angularInertiaFrame
|
|
2454
|
+
* @param {boolean} translationEnabledX
|
|
2455
|
+
* @param {boolean} translationEnabledY
|
|
2456
|
+
* @param {boolean} translationEnabledZ
|
|
2457
|
+
* @param {boolean} rotationEnabledX
|
|
2458
|
+
* @param {boolean} rotationEnabledY
|
|
2459
|
+
* @param {boolean} rotationEnabledZ
|
|
2460
|
+
* @param {number} linearDamping
|
|
2461
|
+
* @param {number} angularDamping
|
|
2462
|
+
* @param {number} rb_type
|
|
2463
|
+
* @param {boolean} canSleep
|
|
2464
|
+
* @param {boolean} sleeping
|
|
2465
|
+
* @param {boolean} ccdEnabled
|
|
2466
|
+
* @param {number} dominanceGroup
|
|
2467
|
+
* @returns {number}
|
|
2468
|
+
*/
|
|
2469
|
+
createRigidBody(enabled: boolean, translation: RawVector, rotation: RawRotation, gravityScale: number, mass: number, massOnly: boolean, centerOfMass: RawVector, linvel: RawVector, angvel: RawVector, principalAngularInertia: RawVector, angularInertiaFrame: RawRotation, translationEnabledX: boolean, translationEnabledY: boolean, translationEnabledZ: boolean, rotationEnabledX: boolean, rotationEnabledY: boolean, rotationEnabledZ: boolean, linearDamping: number, angularDamping: number, rb_type: number, canSleep: boolean, sleeping: boolean, ccdEnabled: boolean, dominanceGroup: number): number;
|
|
2470
|
+
/**
|
|
2471
|
+
* @param {number} handle
|
|
2472
|
+
* @param {RawIslandManager} islands
|
|
2473
|
+
* @param {RawColliderSet} colliders
|
|
2474
|
+
* @param {RawImpulseJointSet} joints
|
|
2475
|
+
* @param {RawMultibodyJointSet} articulations
|
|
2476
|
+
*/
|
|
2477
|
+
remove(handle: number, islands: RawIslandManager, colliders: RawColliderSet, joints: RawImpulseJointSet, articulations: RawMultibodyJointSet): void;
|
|
2478
|
+
/**
|
|
2479
|
+
* The number of rigid-bodies on this set.
|
|
2480
|
+
* @returns {number}
|
|
2481
|
+
*/
|
|
2482
|
+
len(): number;
|
|
2483
|
+
/**
|
|
2484
|
+
* Checks if a rigid-body with the given integer handle exists.
|
|
2485
|
+
* @param {number} handle
|
|
2486
|
+
* @returns {boolean}
|
|
2487
|
+
*/
|
|
2488
|
+
contains(handle: number): boolean;
|
|
2489
|
+
/**
|
|
2490
|
+
* Applies the given JavaScript function to the integer handle of each rigid-body managed by this set.
|
|
2491
|
+
*
|
|
2492
|
+
* # Parameters
|
|
2493
|
+
* - `f(handle)`: the function to apply to the integer handle of each rigid-body managed by this set. Called as `f(collider)`.
|
|
2494
|
+
* @param {Function} f
|
|
2495
|
+
*/
|
|
2496
|
+
forEachRigidBodyHandle(f: Function): void;
|
|
2497
|
+
/**
|
|
2498
|
+
* @param {RawColliderSet} colliders
|
|
2499
|
+
*/
|
|
2500
|
+
propagateModifiedBodyPositionsToColliders(colliders: RawColliderSet): void;
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* A rotation quaternion.
|
|
2504
|
+
*/
|
|
2505
|
+
export class RawRotation {
|
|
2506
|
+
free(): void;
|
|
2507
|
+
/**
|
|
2508
|
+
* @param {number} x
|
|
2509
|
+
* @param {number} y
|
|
2510
|
+
* @param {number} z
|
|
2511
|
+
* @param {number} w
|
|
2512
|
+
*/
|
|
2513
|
+
constructor(x: number, y: number, z: number, w: number);
|
|
2514
|
+
/**
|
|
2515
|
+
* The identity quaternion.
|
|
2516
|
+
* @returns {RawRotation}
|
|
2517
|
+
*/
|
|
2518
|
+
static identity(): RawRotation;
|
|
2519
|
+
/**
|
|
2520
|
+
* The `w` component of this quaternion.
|
|
2521
|
+
*/
|
|
2522
|
+
readonly w: number;
|
|
2523
|
+
/**
|
|
2524
|
+
* The `x` component of this quaternion.
|
|
2525
|
+
*/
|
|
2526
|
+
readonly x: number;
|
|
2527
|
+
/**
|
|
2528
|
+
* The `y` component of this quaternion.
|
|
2529
|
+
*/
|
|
2530
|
+
readonly y: number;
|
|
2531
|
+
/**
|
|
2532
|
+
* The `z` component of this quaternion.
|
|
2533
|
+
*/
|
|
2534
|
+
readonly z: number;
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
*/
|
|
2538
|
+
export class RawSdpMatrix3 {
|
|
2539
|
+
free(): void;
|
|
2540
|
+
/**
|
|
2541
|
+
* Row major list of the upper-triangular part of the symmetric matrix.
|
|
2542
|
+
* @returns {Float32Array}
|
|
2543
|
+
*/
|
|
2544
|
+
elements(): Float32Array;
|
|
2545
|
+
}
|
|
2546
|
+
/**
|
|
2547
|
+
*/
|
|
2548
|
+
export class RawSerializationPipeline {
|
|
2549
|
+
free(): void;
|
|
2550
|
+
/**
|
|
2551
|
+
*/
|
|
2552
|
+
constructor();
|
|
2553
|
+
/**
|
|
2554
|
+
* @param {RawVector} gravity
|
|
2555
|
+
* @param {RawIntegrationParameters} integrationParameters
|
|
2556
|
+
* @param {RawIslandManager} islands
|
|
2557
|
+
* @param {RawBroadPhase} broadPhase
|
|
2558
|
+
* @param {RawNarrowPhase} narrowPhase
|
|
2559
|
+
* @param {RawRigidBodySet} bodies
|
|
2560
|
+
* @param {RawColliderSet} colliders
|
|
2561
|
+
* @param {RawImpulseJointSet} impulse_joints
|
|
2562
|
+
* @param {RawMultibodyJointSet} multibody_joints
|
|
2563
|
+
* @returns {Uint8Array | undefined}
|
|
2564
|
+
*/
|
|
2565
|
+
serializeAll(gravity: RawVector, integrationParameters: RawIntegrationParameters, islands: RawIslandManager, broadPhase: RawBroadPhase, narrowPhase: RawNarrowPhase, bodies: RawRigidBodySet, colliders: RawColliderSet, impulse_joints: RawImpulseJointSet, multibody_joints: RawMultibodyJointSet): Uint8Array | undefined;
|
|
2566
|
+
/**
|
|
2567
|
+
* @param {Uint8Array} data
|
|
2568
|
+
* @returns {RawDeserializedWorld | undefined}
|
|
2569
|
+
*/
|
|
2570
|
+
deserializeAll(data: Uint8Array): RawDeserializedWorld | undefined;
|
|
2571
|
+
}
|
|
2572
|
+
/**
|
|
2573
|
+
*/
|
|
2574
|
+
export class RawShape {
|
|
2575
|
+
free(): void;
|
|
2576
|
+
/**
|
|
2577
|
+
* @param {number} hx
|
|
2578
|
+
* @param {number} hy
|
|
2579
|
+
* @param {number} hz
|
|
2580
|
+
* @returns {RawShape}
|
|
2581
|
+
*/
|
|
2582
|
+
static cuboid(hx: number, hy: number, hz: number): RawShape;
|
|
2583
|
+
/**
|
|
2584
|
+
* @param {number} hx
|
|
2585
|
+
* @param {number} hy
|
|
2586
|
+
* @param {number} hz
|
|
2587
|
+
* @param {number} borderRadius
|
|
2588
|
+
* @returns {RawShape}
|
|
2589
|
+
*/
|
|
2590
|
+
static roundCuboid(hx: number, hy: number, hz: number, borderRadius: number): RawShape;
|
|
2591
|
+
/**
|
|
2592
|
+
* @param {number} radius
|
|
2593
|
+
* @returns {RawShape}
|
|
2594
|
+
*/
|
|
2595
|
+
static ball(radius: number): RawShape;
|
|
2596
|
+
/**
|
|
2597
|
+
* @param {RawVector} normal
|
|
2598
|
+
* @returns {RawShape}
|
|
2599
|
+
*/
|
|
2600
|
+
static halfspace(normal: RawVector): RawShape;
|
|
2601
|
+
/**
|
|
2602
|
+
* @param {number} halfHeight
|
|
2603
|
+
* @param {number} radius
|
|
2604
|
+
* @returns {RawShape}
|
|
2605
|
+
*/
|
|
2606
|
+
static capsule(halfHeight: number, radius: number): RawShape;
|
|
2607
|
+
/**
|
|
2608
|
+
* @param {number} halfHeight
|
|
2609
|
+
* @param {number} radius
|
|
2610
|
+
* @returns {RawShape}
|
|
2611
|
+
*/
|
|
2612
|
+
static cylinder(halfHeight: number, radius: number): RawShape;
|
|
2613
|
+
/**
|
|
2614
|
+
* @param {number} halfHeight
|
|
2615
|
+
* @param {number} radius
|
|
2616
|
+
* @param {number} borderRadius
|
|
2617
|
+
* @returns {RawShape}
|
|
2618
|
+
*/
|
|
2619
|
+
static roundCylinder(halfHeight: number, radius: number, borderRadius: number): RawShape;
|
|
2620
|
+
/**
|
|
2621
|
+
* @param {number} halfHeight
|
|
2622
|
+
* @param {number} radius
|
|
2623
|
+
* @returns {RawShape}
|
|
2624
|
+
*/
|
|
2625
|
+
static cone(halfHeight: number, radius: number): RawShape;
|
|
2626
|
+
/**
|
|
2627
|
+
* @param {number} halfHeight
|
|
2628
|
+
* @param {number} radius
|
|
2629
|
+
* @param {number} borderRadius
|
|
2630
|
+
* @returns {RawShape}
|
|
2631
|
+
*/
|
|
2632
|
+
static roundCone(halfHeight: number, radius: number, borderRadius: number): RawShape;
|
|
2633
|
+
/**
|
|
2634
|
+
* @param {Float32Array} vertices
|
|
2635
|
+
* @param {Uint32Array} indices
|
|
2636
|
+
* @returns {RawShape}
|
|
2637
|
+
*/
|
|
2638
|
+
static polyline(vertices: Float32Array, indices: Uint32Array): RawShape;
|
|
2639
|
+
/**
|
|
2640
|
+
* @param {Float32Array} vertices
|
|
2641
|
+
* @param {Uint32Array} indices
|
|
2642
|
+
* @returns {RawShape}
|
|
2643
|
+
*/
|
|
2644
|
+
static trimesh(vertices: Float32Array, indices: Uint32Array): RawShape;
|
|
2645
|
+
/**
|
|
2646
|
+
* @param {number} nrows
|
|
2647
|
+
* @param {number} ncols
|
|
2648
|
+
* @param {Float32Array} heights
|
|
2649
|
+
* @param {RawVector} scale
|
|
2650
|
+
* @returns {RawShape}
|
|
2651
|
+
*/
|
|
2652
|
+
static heightfield(nrows: number, ncols: number, heights: Float32Array, scale: RawVector): RawShape;
|
|
2653
|
+
/**
|
|
2654
|
+
* @param {RawVector} p1
|
|
2655
|
+
* @param {RawVector} p2
|
|
2656
|
+
* @returns {RawShape}
|
|
2657
|
+
*/
|
|
2658
|
+
static segment(p1: RawVector, p2: RawVector): RawShape;
|
|
2659
|
+
/**
|
|
2660
|
+
* @param {RawVector} p1
|
|
2661
|
+
* @param {RawVector} p2
|
|
2662
|
+
* @param {RawVector} p3
|
|
2663
|
+
* @returns {RawShape}
|
|
2664
|
+
*/
|
|
2665
|
+
static triangle(p1: RawVector, p2: RawVector, p3: RawVector): RawShape;
|
|
2666
|
+
/**
|
|
2667
|
+
* @param {RawVector} p1
|
|
2668
|
+
* @param {RawVector} p2
|
|
2669
|
+
* @param {RawVector} p3
|
|
2670
|
+
* @param {number} borderRadius
|
|
2671
|
+
* @returns {RawShape}
|
|
2672
|
+
*/
|
|
2673
|
+
static roundTriangle(p1: RawVector, p2: RawVector, p3: RawVector, borderRadius: number): RawShape;
|
|
2674
|
+
/**
|
|
2675
|
+
* @param {Float32Array} points
|
|
2676
|
+
* @returns {RawShape | undefined}
|
|
2677
|
+
*/
|
|
2678
|
+
static convexHull(points: Float32Array): RawShape | undefined;
|
|
2679
|
+
/**
|
|
2680
|
+
* @param {Float32Array} points
|
|
2681
|
+
* @param {number} borderRadius
|
|
2682
|
+
* @returns {RawShape | undefined}
|
|
2683
|
+
*/
|
|
2684
|
+
static roundConvexHull(points: Float32Array, borderRadius: number): RawShape | undefined;
|
|
2685
|
+
/**
|
|
2686
|
+
* @param {Float32Array} vertices
|
|
2687
|
+
* @param {Uint32Array} indices
|
|
2688
|
+
* @returns {RawShape | undefined}
|
|
2689
|
+
*/
|
|
2690
|
+
static convexMesh(vertices: Float32Array, indices: Uint32Array): RawShape | undefined;
|
|
2691
|
+
/**
|
|
2692
|
+
* @param {Float32Array} vertices
|
|
2693
|
+
* @param {Uint32Array} indices
|
|
2694
|
+
* @param {number} borderRadius
|
|
2695
|
+
* @returns {RawShape | undefined}
|
|
2696
|
+
*/
|
|
2697
|
+
static roundConvexMesh(vertices: Float32Array, indices: Uint32Array, borderRadius: number): RawShape | undefined;
|
|
2698
|
+
/**
|
|
2699
|
+
* @param {RawVector} shapePos1
|
|
2700
|
+
* @param {RawRotation} shapeRot1
|
|
2701
|
+
* @param {RawVector} shapeVel1
|
|
2702
|
+
* @param {RawShape} shape2
|
|
2703
|
+
* @param {RawVector} shapePos2
|
|
2704
|
+
* @param {RawRotation} shapeRot2
|
|
2705
|
+
* @param {RawVector} shapeVel2
|
|
2706
|
+
* @param {number} maxToi
|
|
2707
|
+
* @param {boolean} stop_at_penetration
|
|
2708
|
+
* @returns {RawShapeTOI | undefined}
|
|
2709
|
+
*/
|
|
2710
|
+
castShape(shapePos1: RawVector, shapeRot1: RawRotation, shapeVel1: RawVector, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation, shapeVel2: RawVector, maxToi: number, stop_at_penetration: boolean): RawShapeTOI | undefined;
|
|
2711
|
+
/**
|
|
2712
|
+
* @param {RawVector} shapePos1
|
|
2713
|
+
* @param {RawRotation} shapeRot1
|
|
2714
|
+
* @param {RawShape} shape2
|
|
2715
|
+
* @param {RawVector} shapePos2
|
|
2716
|
+
* @param {RawRotation} shapeRot2
|
|
2717
|
+
* @returns {boolean}
|
|
2718
|
+
*/
|
|
2719
|
+
intersectsShape(shapePos1: RawVector, shapeRot1: RawRotation, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation): boolean;
|
|
2720
|
+
/**
|
|
2721
|
+
* @param {RawVector} shapePos1
|
|
2722
|
+
* @param {RawRotation} shapeRot1
|
|
2723
|
+
* @param {RawShape} shape2
|
|
2724
|
+
* @param {RawVector} shapePos2
|
|
2725
|
+
* @param {RawRotation} shapeRot2
|
|
2726
|
+
* @param {number} prediction
|
|
2727
|
+
* @returns {RawShapeContact | undefined}
|
|
2728
|
+
*/
|
|
2729
|
+
contactShape(shapePos1: RawVector, shapeRot1: RawRotation, shape2: RawShape, shapePos2: RawVector, shapeRot2: RawRotation, prediction: number): RawShapeContact | undefined;
|
|
2730
|
+
/**
|
|
2731
|
+
* @param {RawVector} shapePos
|
|
2732
|
+
* @param {RawRotation} shapeRot
|
|
2733
|
+
* @param {RawVector} point
|
|
2734
|
+
* @returns {boolean}
|
|
2735
|
+
*/
|
|
2736
|
+
containsPoint(shapePos: RawVector, shapeRot: RawRotation, point: RawVector): boolean;
|
|
2737
|
+
/**
|
|
2738
|
+
* @param {RawVector} shapePos
|
|
2739
|
+
* @param {RawRotation} shapeRot
|
|
2740
|
+
* @param {RawVector} point
|
|
2741
|
+
* @param {boolean} solid
|
|
2742
|
+
* @returns {RawPointProjection}
|
|
2743
|
+
*/
|
|
2744
|
+
projectPoint(shapePos: RawVector, shapeRot: RawRotation, point: RawVector, solid: boolean): RawPointProjection;
|
|
2745
|
+
/**
|
|
2746
|
+
* @param {RawVector} shapePos
|
|
2747
|
+
* @param {RawRotation} shapeRot
|
|
2748
|
+
* @param {RawVector} rayOrig
|
|
2749
|
+
* @param {RawVector} rayDir
|
|
2750
|
+
* @param {number} maxToi
|
|
2751
|
+
* @returns {boolean}
|
|
2752
|
+
*/
|
|
2753
|
+
intersectsRay(shapePos: RawVector, shapeRot: RawRotation, rayOrig: RawVector, rayDir: RawVector, maxToi: number): boolean;
|
|
2754
|
+
/**
|
|
2755
|
+
* @param {RawVector} shapePos
|
|
2756
|
+
* @param {RawRotation} shapeRot
|
|
2757
|
+
* @param {RawVector} rayOrig
|
|
2758
|
+
* @param {RawVector} rayDir
|
|
2759
|
+
* @param {number} maxToi
|
|
2760
|
+
* @param {boolean} solid
|
|
2761
|
+
* @returns {number}
|
|
2762
|
+
*/
|
|
2763
|
+
castRay(shapePos: RawVector, shapeRot: RawRotation, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): number;
|
|
2764
|
+
/**
|
|
2765
|
+
* @param {RawVector} shapePos
|
|
2766
|
+
* @param {RawRotation} shapeRot
|
|
2767
|
+
* @param {RawVector} rayOrig
|
|
2768
|
+
* @param {RawVector} rayDir
|
|
2769
|
+
* @param {number} maxToi
|
|
2770
|
+
* @param {boolean} solid
|
|
2771
|
+
* @returns {RawRayIntersection | undefined}
|
|
2772
|
+
*/
|
|
2773
|
+
castRayAndGetNormal(shapePos: RawVector, shapeRot: RawRotation, rayOrig: RawVector, rayDir: RawVector, maxToi: number, solid: boolean): RawRayIntersection | undefined;
|
|
2774
|
+
}
|
|
2775
|
+
/**
|
|
2776
|
+
*/
|
|
2777
|
+
export class RawShapeColliderTOI {
|
|
2778
|
+
free(): void;
|
|
2779
|
+
/**
|
|
2780
|
+
* @returns {number}
|
|
2781
|
+
*/
|
|
2782
|
+
colliderHandle(): number;
|
|
2783
|
+
/**
|
|
2784
|
+
* @returns {number}
|
|
2785
|
+
*/
|
|
2786
|
+
toi(): number;
|
|
2787
|
+
/**
|
|
2788
|
+
* @returns {RawVector}
|
|
2789
|
+
*/
|
|
2790
|
+
witness1(): RawVector;
|
|
2791
|
+
/**
|
|
2792
|
+
* @returns {RawVector}
|
|
2793
|
+
*/
|
|
2794
|
+
witness2(): RawVector;
|
|
2795
|
+
/**
|
|
2796
|
+
* @returns {RawVector}
|
|
2797
|
+
*/
|
|
2798
|
+
normal1(): RawVector;
|
|
2799
|
+
/**
|
|
2800
|
+
* @returns {RawVector}
|
|
2801
|
+
*/
|
|
2802
|
+
normal2(): RawVector;
|
|
2803
|
+
}
|
|
2804
|
+
/**
|
|
2805
|
+
*/
|
|
2806
|
+
export class RawShapeContact {
|
|
2807
|
+
free(): void;
|
|
2808
|
+
/**
|
|
2809
|
+
* @returns {number}
|
|
2810
|
+
*/
|
|
2811
|
+
distance(): number;
|
|
2812
|
+
/**
|
|
2813
|
+
* @returns {RawVector}
|
|
2814
|
+
*/
|
|
2815
|
+
point1(): RawVector;
|
|
2816
|
+
/**
|
|
2817
|
+
* @returns {RawVector}
|
|
2818
|
+
*/
|
|
2819
|
+
point2(): RawVector;
|
|
2820
|
+
/**
|
|
2821
|
+
* @returns {RawVector}
|
|
2822
|
+
*/
|
|
2823
|
+
normal1(): RawVector;
|
|
2824
|
+
/**
|
|
2825
|
+
* @returns {RawVector}
|
|
2826
|
+
*/
|
|
2827
|
+
normal2(): RawVector;
|
|
2828
|
+
}
|
|
2829
|
+
/**
|
|
2830
|
+
*/
|
|
2831
|
+
export class RawShapeTOI {
|
|
2832
|
+
free(): void;
|
|
2833
|
+
/**
|
|
2834
|
+
* @returns {number}
|
|
2835
|
+
*/
|
|
2836
|
+
toi(): number;
|
|
2837
|
+
/**
|
|
2838
|
+
* @returns {RawVector}
|
|
2839
|
+
*/
|
|
2840
|
+
witness1(): RawVector;
|
|
2841
|
+
/**
|
|
2842
|
+
* @returns {RawVector}
|
|
2843
|
+
*/
|
|
2844
|
+
witness2(): RawVector;
|
|
2845
|
+
/**
|
|
2846
|
+
* @returns {RawVector}
|
|
2847
|
+
*/
|
|
2848
|
+
normal1(): RawVector;
|
|
2849
|
+
/**
|
|
2850
|
+
* @returns {RawVector}
|
|
2851
|
+
*/
|
|
2852
|
+
normal2(): RawVector;
|
|
2853
|
+
}
|
|
2854
|
+
/**
|
|
2855
|
+
* A vector.
|
|
2856
|
+
*/
|
|
2857
|
+
export class RawVector {
|
|
2858
|
+
free(): void;
|
|
2859
|
+
/**
|
|
2860
|
+
* Creates a new vector filled with zeros.
|
|
2861
|
+
* @returns {RawVector}
|
|
2862
|
+
*/
|
|
2863
|
+
static zero(): RawVector;
|
|
2864
|
+
/**
|
|
2865
|
+
* Creates a new 3D vector from its two components.
|
|
2866
|
+
*
|
|
2867
|
+
* # Parameters
|
|
2868
|
+
* - `x`: the `x` component of this 3D vector.
|
|
2869
|
+
* - `y`: the `y` component of this 3D vector.
|
|
2870
|
+
* - `z`: the `z` component of this 3D vector.
|
|
2871
|
+
* @param {number} x
|
|
2872
|
+
* @param {number} y
|
|
2873
|
+
* @param {number} z
|
|
2874
|
+
*/
|
|
2875
|
+
constructor(x: number, y: number, z: number);
|
|
2876
|
+
/**
|
|
2877
|
+
* Create a new 3D vector from this vector with its components rearranged as `{x, y, z}`.
|
|
2878
|
+
*
|
|
2879
|
+
* This will effectively return a copy of `this`. This method exist for completeness with the
|
|
2880
|
+
* other swizzling functions.
|
|
2881
|
+
* @returns {RawVector}
|
|
2882
|
+
*/
|
|
2883
|
+
xyz(): RawVector;
|
|
2884
|
+
/**
|
|
2885
|
+
* Create a new 3D vector from this vector with its components rearranged as `{y, x, z}`.
|
|
2886
|
+
* @returns {RawVector}
|
|
2887
|
+
*/
|
|
2888
|
+
yxz(): RawVector;
|
|
2889
|
+
/**
|
|
2890
|
+
* Create a new 3D vector from this vector with its components rearranged as `{z, x, y}`.
|
|
2891
|
+
* @returns {RawVector}
|
|
2892
|
+
*/
|
|
2893
|
+
zxy(): RawVector;
|
|
2894
|
+
/**
|
|
2895
|
+
* Create a new 3D vector from this vector with its components rearranged as `{x, z, y}`.
|
|
2896
|
+
* @returns {RawVector}
|
|
2897
|
+
*/
|
|
2898
|
+
xzy(): RawVector;
|
|
2899
|
+
/**
|
|
2900
|
+
* Create a new 3D vector from this vector with its components rearranged as `{y, z, x}`.
|
|
2901
|
+
* @returns {RawVector}
|
|
2902
|
+
*/
|
|
2903
|
+
yzx(): RawVector;
|
|
2904
|
+
/**
|
|
2905
|
+
* Create a new 3D vector from this vector with its components rearranged as `{z, y, x}`.
|
|
2906
|
+
* @returns {RawVector}
|
|
2907
|
+
*/
|
|
2908
|
+
zyx(): RawVector;
|
|
2909
|
+
/**
|
|
2910
|
+
* The `x` component of this vector.
|
|
2911
|
+
*/
|
|
2912
|
+
x: number;
|
|
2913
|
+
/**
|
|
2914
|
+
* The `y` component of this vector.
|
|
2915
|
+
*/
|
|
2916
|
+
y: number;
|
|
2917
|
+
/**
|
|
2918
|
+
* The `z` component of this vector.
|
|
2919
|
+
*/
|
|
2920
|
+
z: number;
|
|
2921
|
+
}
|