@threenative/physics 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Area3D-CvwDbfU6.d.ts +577 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +614 -72
- package/dist/native/index.d.ts +1 -1
- package/dist/native/index.js +533 -49
- package/dist/navigation/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/Area3D-B8LJ2C4S.d.ts +0 -403
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@threenative/core';
|
|
2
2
|
import 'recast-navigation';
|
|
3
|
-
export {
|
|
3
|
+
export { V as INavigationAgent3DOptions, W as INavigationContext, X as INavigationObstacle3DOptions, Y as INavigationRegion3DOptions, Z as NavigationAgent3D, _ as NavigationAgentEvent, $ as NavigationAgentHandler, a0 as NavigationObstacle3D, a1 as NavigationPlugin, a2 as NavigationRegion3D, a3 as recast } from '../Area3D-CvwDbfU6.js';
|
|
4
4
|
import 'three';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/physics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Thin Rapier physics bindings for ThreeNative games.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"three": "0.185.1",
|
|
44
44
|
"tsup": "8.5.1",
|
|
45
45
|
"typescript": "5.9.3",
|
|
46
|
-
"@threenative/core": "0.
|
|
46
|
+
"@threenative/core": "0.2.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup --config tsup.config.ts && publint",
|
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
import { Mesh, Object3D, Vector3 } from 'three';
|
|
2
|
-
import { GamePluginHooks } from '@threenative/core';
|
|
3
|
-
import { CrowdAgent, NavMesh, NavMeshQuery, Crowd } from 'recast-navigation';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Portable handle for a backend-owned physics object.
|
|
7
|
-
*
|
|
8
|
-
* `raw` is deliberately backend-specific: it is a Rapier object on web and an opaque
|
|
9
|
-
* native handle on device. Code that reads it is not portable across build targets.
|
|
10
|
-
*/
|
|
11
|
-
interface PhysicsHandle {
|
|
12
|
-
readonly raw: unknown;
|
|
13
|
-
}
|
|
14
|
-
interface PhysicsBodyHandle extends PhysicsHandle {
|
|
15
|
-
readonly id: number;
|
|
16
|
-
}
|
|
17
|
-
interface PhysicsColliderHandle extends PhysicsHandle {
|
|
18
|
-
readonly id: number;
|
|
19
|
-
}
|
|
20
|
-
interface PhysicsWorldHandle extends PhysicsHandle {
|
|
21
|
-
/** The selected backend, kept beside `raw` so shared nodes do not inspect it. */
|
|
22
|
-
readonly simulation?: unknown;
|
|
23
|
-
}
|
|
24
|
-
declare function physicsHandle(raw: unknown): PhysicsHandle;
|
|
25
|
-
declare function physicsWorldHandle(raw: unknown, simulation: unknown): PhysicsWorldHandle;
|
|
26
|
-
|
|
27
|
-
/** One record is logical body id, xyz position, and xyzw rotation. */
|
|
28
|
-
declare const PHYSICS_TRANSFORM_STRIDE = 8;
|
|
29
|
-
declare const PHYSICS_COLLISION_EVENT_STRIDE = 4;
|
|
30
|
-
type PhysicsShapeKind = "box" | "sphere" | "capsule" | "trimesh" | "convexHull" | "heightfield";
|
|
31
|
-
/** Portable shape data. Backend-specific objects are created only by a simulation adapter. */
|
|
32
|
-
interface PhysicsShapeDescriptor {
|
|
33
|
-
readonly kind: PhysicsShapeKind;
|
|
34
|
-
readonly x: number;
|
|
35
|
-
readonly y: number;
|
|
36
|
-
readonly z: number;
|
|
37
|
-
readonly vertices?: Float32Array;
|
|
38
|
-
readonly indices?: Uint32Array;
|
|
39
|
-
readonly rows?: number;
|
|
40
|
-
readonly columns?: number;
|
|
41
|
-
readonly heights?: Float32Array;
|
|
42
|
-
readonly scale?: {
|
|
43
|
-
readonly x: number;
|
|
44
|
-
readonly y: number;
|
|
45
|
-
readonly z: number;
|
|
46
|
-
};
|
|
47
|
-
readonly shape?: unknown;
|
|
48
|
-
collisionLayer: number;
|
|
49
|
-
collisionMask: number;
|
|
50
|
-
sensor: boolean;
|
|
51
|
-
}
|
|
52
|
-
type PhysicsBodyType = "character" | "dynamic" | "fixed" | "kinematic";
|
|
53
|
-
interface PhysicsBodyCreateOptions {
|
|
54
|
-
readonly type: PhysicsBodyType;
|
|
55
|
-
readonly shape: PhysicsShapeDescriptor;
|
|
56
|
-
readonly position: {
|
|
57
|
-
readonly x: number;
|
|
58
|
-
readonly y: number;
|
|
59
|
-
readonly z: number;
|
|
60
|
-
};
|
|
61
|
-
readonly rotation: {
|
|
62
|
-
readonly x: number;
|
|
63
|
-
readonly y: number;
|
|
64
|
-
readonly z: number;
|
|
65
|
-
readonly w: number;
|
|
66
|
-
};
|
|
67
|
-
readonly mass: number;
|
|
68
|
-
readonly sensor: boolean;
|
|
69
|
-
}
|
|
70
|
-
interface PhysicsBodyRegistration {
|
|
71
|
-
readonly body: PhysicsBodyHandle;
|
|
72
|
-
readonly collider: PhysicsColliderHandle;
|
|
73
|
-
readonly controller?: PhysicsHandle;
|
|
74
|
-
/** The backend shape object to expose through `CollisionShape3D.raw`. */
|
|
75
|
-
readonly rawShape: unknown;
|
|
76
|
-
}
|
|
77
|
-
interface PhysicsCharacterOptions {
|
|
78
|
-
readonly offset: number;
|
|
79
|
-
readonly maxSlopeClimbAngle: number;
|
|
80
|
-
readonly autostep?: {
|
|
81
|
-
readonly maxHeight: number;
|
|
82
|
-
readonly minWidth: number;
|
|
83
|
-
readonly includeDynamicBodies: boolean;
|
|
84
|
-
};
|
|
85
|
-
readonly snapToGround?: number;
|
|
86
|
-
readonly oneWayLayers: number;
|
|
87
|
-
}
|
|
88
|
-
interface PhysicsCharacterState {
|
|
89
|
-
readonly grounded: boolean;
|
|
90
|
-
readonly groundCollider?: number;
|
|
91
|
-
}
|
|
92
|
-
interface PhysicsInputSnapshot {
|
|
93
|
-
/** One eight-float record per kinematic body. The buffer is caller-owned and reusable. */
|
|
94
|
-
readonly kinematicTransforms: Readonly<Float32Array>;
|
|
95
|
-
readonly kinematicCount: number;
|
|
96
|
-
}
|
|
97
|
-
/** The backend seam used by all shared physics nodes. */
|
|
98
|
-
interface PhysicsSimulation {
|
|
99
|
-
createBody(options: PhysicsBodyCreateOptions): PhysicsBodyRegistration;
|
|
100
|
-
configureCharacter(id: number, options: PhysicsCharacterOptions): void;
|
|
101
|
-
removeBody(id: number): void;
|
|
102
|
-
/** Cold-path repositioning for teleport/setup. Per-frame kinematics use `step()` input. */
|
|
103
|
-
setBodyTransform(id: number, position: {
|
|
104
|
-
readonly x: number;
|
|
105
|
-
readonly y: number;
|
|
106
|
-
readonly z: number;
|
|
107
|
-
}): void;
|
|
108
|
-
step(deltaTime: number, inputSnapshot?: PhysicsInputSnapshot): void;
|
|
109
|
-
readVisibleTransforms(renderBuffer: Float32Array): number;
|
|
110
|
-
readBodyTransform?(id: number): {
|
|
111
|
-
readonly position: {
|
|
112
|
-
readonly x: number;
|
|
113
|
-
readonly y: number;
|
|
114
|
-
readonly z: number;
|
|
115
|
-
};
|
|
116
|
-
readonly rotation: {
|
|
117
|
-
readonly x: number;
|
|
118
|
-
readonly y: number;
|
|
119
|
-
readonly z: number;
|
|
120
|
-
readonly w: number;
|
|
121
|
-
};
|
|
122
|
-
} | undefined;
|
|
123
|
-
/** Reflects the most recently completed step, independent of visible-transform reads. */
|
|
124
|
-
readCharacterState?(id: number): PhysicsCharacterState | undefined;
|
|
125
|
-
/** Reflects the most recently completed step, independent of visible-transform reads. */
|
|
126
|
-
areaIntersections?(id: number): ReadonlySet<number>;
|
|
127
|
-
drainCollisionEvents(buffer: Uint32Array): number;
|
|
128
|
-
dispose(): void;
|
|
129
|
-
}
|
|
130
|
-
/** Runtime metadata needed to expose backend-specific escape hatches without leaking them. */
|
|
131
|
-
interface PhysicsRuntimeSimulation extends PhysicsSimulation {
|
|
132
|
-
readonly version: string;
|
|
133
|
-
readonly rawWorld: unknown;
|
|
134
|
-
readonly rawEventQueue: unknown;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
type CollisionShapeKind = PhysicsShapeKind;
|
|
138
|
-
interface CollisionShapeHandle {
|
|
139
|
-
readonly raw: unknown;
|
|
140
|
-
}
|
|
141
|
-
declare class CollisionShape3D {
|
|
142
|
-
#private;
|
|
143
|
-
private constructor();
|
|
144
|
-
/** Backend-neutral data consumed by the selected PhysicsSimulation adapter. */
|
|
145
|
-
get descriptor(): PhysicsShapeDescriptor;
|
|
146
|
-
/** Rapier's descriptor on web, or an opaque native descriptor after registration. */
|
|
147
|
-
get raw(): unknown;
|
|
148
|
-
/** Internal seam: the backend binds its own descriptor when the body is created. */
|
|
149
|
-
bindRaw(raw: unknown): void;
|
|
150
|
-
static box(width: number, height: number, depth: number): CollisionShape3D;
|
|
151
|
-
static sphere(radius: number): CollisionShape3D;
|
|
152
|
-
static capsule(halfHeight: number, radius: number): CollisionShape3D;
|
|
153
|
-
static heightfield(rows: number, columns: number, heights: Float32Array, scale: {
|
|
154
|
-
x: number;
|
|
155
|
-
y: number;
|
|
156
|
-
z: number;
|
|
157
|
-
}): CollisionShape3D;
|
|
158
|
-
static fromMesh(mesh: Mesh, kind?: CollisionShapeKind): CollisionShape3D;
|
|
159
|
-
setCollisionGroups(groups: number): this;
|
|
160
|
-
setSensor(sensor: boolean): this;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
interface CharacterBody3DOptions {
|
|
164
|
-
readonly object: Object3D;
|
|
165
|
-
readonly physics?: PhysicsContext;
|
|
166
|
-
/** @deprecated Prefer `physics`; a raw web world is backend-specific. */
|
|
167
|
-
readonly world?: PhysicsWorldHandle | unknown;
|
|
168
|
-
readonly shape: CollisionShape3D;
|
|
169
|
-
readonly offset?: number;
|
|
170
|
-
readonly maxSlopeClimbAngle?: number;
|
|
171
|
-
readonly autostep?: {
|
|
172
|
-
readonly maxHeight: number;
|
|
173
|
-
readonly minWidth: number;
|
|
174
|
-
readonly includeDynamicBodies?: boolean;
|
|
175
|
-
};
|
|
176
|
-
readonly snapToGround?: number;
|
|
177
|
-
readonly gravity?: number;
|
|
178
|
-
readonly maxFallSpeed?: number;
|
|
179
|
-
/** Godot's collision_layer — which layers this body occupies. Default 1. */
|
|
180
|
-
readonly collisionLayer?: number;
|
|
181
|
-
/** Godot's collision_mask — which layers this body scans. Default 0xffff. */
|
|
182
|
-
readonly collisionMask?: number;
|
|
183
|
-
/** Collider layer bits to ignore while moving upward. */
|
|
184
|
-
readonly oneWayLayers?: number;
|
|
185
|
-
}
|
|
186
|
-
declare class CharacterBody3D {
|
|
187
|
-
#private;
|
|
188
|
-
readonly body: PhysicsBodyHandle;
|
|
189
|
-
readonly collider: PhysicsColliderHandle;
|
|
190
|
-
readonly controller: PhysicsHandle;
|
|
191
|
-
readonly object: Object3D;
|
|
192
|
-
readonly velocity: Vector3;
|
|
193
|
-
gravity: number;
|
|
194
|
-
maxFallSpeed: number;
|
|
195
|
-
readonly oneWayLayers: number;
|
|
196
|
-
grounded: boolean;
|
|
197
|
-
constructor(options: CharacterBody3DOptions);
|
|
198
|
-
move(desiredTranslation: Pick<Vector3, "x" | "y" | "z">): void;
|
|
199
|
-
moveAndSlide(dt: number): void;
|
|
200
|
-
/** Called by the shared plugin before a bulk step. */
|
|
201
|
-
writeKinematic(buffer: Float32Array, offset: number): void;
|
|
202
|
-
syncToPhysics(): void;
|
|
203
|
-
step(): void;
|
|
204
|
-
teleport(position: Pick<Vector3, "x" | "y" | "z">): void;
|
|
205
|
-
applyTransform(values: Readonly<Float32Array>, offset: number): void;
|
|
206
|
-
syncFromPhysics(): void;
|
|
207
|
-
dispose(): void;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
type RigidBodyType = "dynamic" | "fixed" | "kinematic";
|
|
211
|
-
interface RigidBody3DOptions {
|
|
212
|
-
readonly object: Object3D;
|
|
213
|
-
readonly physics?: PhysicsContext;
|
|
214
|
-
/** @deprecated Prefer `physics`; a raw web world is backend-specific. */
|
|
215
|
-
readonly world?: PhysicsWorldHandle | unknown;
|
|
216
|
-
readonly shape: CollisionShape3D;
|
|
217
|
-
readonly mass?: number;
|
|
218
|
-
readonly type?: RigidBodyType;
|
|
219
|
-
/** Godot's collision_layer — which layers this body occupies. Default 1. */
|
|
220
|
-
readonly collisionLayer?: number;
|
|
221
|
-
/** Godot's collision_mask — which layers this body scans. Default 0xffff. */
|
|
222
|
-
readonly collisionMask?: number;
|
|
223
|
-
}
|
|
224
|
-
declare class RigidBody3D {
|
|
225
|
-
#private;
|
|
226
|
-
readonly body: PhysicsBodyHandle;
|
|
227
|
-
readonly collider: PhysicsColliderHandle;
|
|
228
|
-
readonly object: Object3D;
|
|
229
|
-
readonly type: RigidBodyType;
|
|
230
|
-
constructor(options: RigidBody3DOptions);
|
|
231
|
-
/** Called by the shared plugin before a bulk step. */
|
|
232
|
-
writeKinematic(buffer: Float32Array, offset: number): void;
|
|
233
|
-
/** Displacement since the last backend transform, used for moving-platform carry. */
|
|
234
|
-
kinematicMotion(): {
|
|
235
|
-
readonly x: number;
|
|
236
|
-
readonly y: number;
|
|
237
|
-
readonly z: number;
|
|
238
|
-
};
|
|
239
|
-
syncToPhysics(): void;
|
|
240
|
-
syncFromPhysics(): void;
|
|
241
|
-
applyTransform(values: Readonly<Float32Array>, offset: number): void;
|
|
242
|
-
dispose(): void;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
type NavigationAgentEvent = "targetReached" | "navigationFinished" | "pathChanged";
|
|
246
|
-
type NavigationAgentHandler = () => void;
|
|
247
|
-
interface NavigationAgent3DOptions {
|
|
248
|
-
readonly navigation: NavigationContext;
|
|
249
|
-
readonly object: Object3D;
|
|
250
|
-
readonly radius?: number;
|
|
251
|
-
readonly height?: number;
|
|
252
|
-
readonly maxSpeed?: number;
|
|
253
|
-
readonly pathDesiredDistance?: number;
|
|
254
|
-
readonly targetDesiredDistance?: number;
|
|
255
|
-
readonly avoidanceEnabled?: boolean;
|
|
256
|
-
}
|
|
257
|
-
declare class NavigationAgent3D {
|
|
258
|
-
#private;
|
|
259
|
-
readonly navigation: NavigationContext;
|
|
260
|
-
readonly object: Object3D;
|
|
261
|
-
readonly radius: number;
|
|
262
|
-
readonly height: number;
|
|
263
|
-
readonly maxSpeed: number;
|
|
264
|
-
readonly pathDesiredDistance: number;
|
|
265
|
-
readonly targetDesiredDistance: number;
|
|
266
|
-
constructor(options: NavigationAgent3DOptions);
|
|
267
|
-
get crowdAgent(): CrowdAgent | undefined;
|
|
268
|
-
get avoidanceEnabled(): boolean;
|
|
269
|
-
set avoidanceEnabled(value: boolean);
|
|
270
|
-
on(event: NavigationAgentEvent, handler: NavigationAgentHandler): () => void;
|
|
271
|
-
setTargetPosition(position: Pick<Vector3, "x" | "y" | "z">): void;
|
|
272
|
-
getNextPathPosition(): Vector3;
|
|
273
|
-
isNavigationFinished(): boolean;
|
|
274
|
-
isTargetReachable(position?: Pick<Vector3, "x" | "y" | "z">): boolean;
|
|
275
|
-
getFinalPosition(): Vector3;
|
|
276
|
-
distanceToTarget(): number;
|
|
277
|
-
syncCrowd(): void;
|
|
278
|
-
advance(): void;
|
|
279
|
-
dispose(): void;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
interface NavigationObstacle3DOptions {
|
|
283
|
-
readonly navigation: NavigationContext;
|
|
284
|
-
readonly object: Object3D;
|
|
285
|
-
readonly radius?: number;
|
|
286
|
-
readonly height?: number;
|
|
287
|
-
readonly avoidanceEnabled?: boolean;
|
|
288
|
-
}
|
|
289
|
-
declare class NavigationObstacle3D {
|
|
290
|
-
#private;
|
|
291
|
-
readonly navigation: NavigationContext;
|
|
292
|
-
readonly object: Object3D;
|
|
293
|
-
readonly radius: number;
|
|
294
|
-
readonly height: number;
|
|
295
|
-
crowdAgent: CrowdAgent | undefined;
|
|
296
|
-
constructor(options: NavigationObstacle3DOptions);
|
|
297
|
-
get avoidanceEnabled(): boolean;
|
|
298
|
-
set avoidanceEnabled(value: boolean);
|
|
299
|
-
syncCrowd(): void;
|
|
300
|
-
dispose(): void;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
interface NavigationRegion3DOptions {
|
|
304
|
-
readonly navigation: NavigationContext;
|
|
305
|
-
readonly meshes: readonly Object3D[];
|
|
306
|
-
readonly cellSize?: number;
|
|
307
|
-
readonly cellHeight?: number;
|
|
308
|
-
readonly agentRadius?: number;
|
|
309
|
-
readonly agentHeight?: number;
|
|
310
|
-
readonly agentMaxClimb?: number;
|
|
311
|
-
readonly agentMaxSlope?: number;
|
|
312
|
-
}
|
|
313
|
-
declare class NavigationRegion3D {
|
|
314
|
-
#private;
|
|
315
|
-
readonly navigation: NavigationContext;
|
|
316
|
-
readonly meshes: readonly Object3D[];
|
|
317
|
-
navigationMesh: NavMesh;
|
|
318
|
-
constructor(options: NavigationRegion3DOptions);
|
|
319
|
-
get enabled(): boolean;
|
|
320
|
-
set enabled(value: boolean);
|
|
321
|
-
bakeNavigationMesh(): NavMesh;
|
|
322
|
-
dispose(): void;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
interface NavigationContext {
|
|
326
|
-
navMesh: NavMesh;
|
|
327
|
-
query: NavMeshQuery;
|
|
328
|
-
readonly regions: Set<NavigationRegion3D>;
|
|
329
|
-
readonly agents: Set<NavigationAgent3D>;
|
|
330
|
-
readonly obstacles: Set<NavigationObstacle3D>;
|
|
331
|
-
crowd?: Crowd;
|
|
332
|
-
}
|
|
333
|
-
type NavigationPlugin = GamePluginHooks<Record<string, unknown>, PhysicsContext>;
|
|
334
|
-
declare function recast(): NavigationPlugin;
|
|
335
|
-
|
|
336
|
-
interface PhysicsOptions {
|
|
337
|
-
readonly gravity?: {
|
|
338
|
-
readonly x: number;
|
|
339
|
-
readonly y: number;
|
|
340
|
-
readonly z: number;
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
type PhysicsBody3D = RigidBody3D | CharacterBody3D;
|
|
344
|
-
interface PhysicsContext {
|
|
345
|
-
readonly world: ReturnType<typeof physicsWorldHandle>;
|
|
346
|
-
readonly eventQueue: ReturnType<typeof physicsHandle>;
|
|
347
|
-
readonly simulation: PhysicsSimulation;
|
|
348
|
-
navigation?: NavigationContext;
|
|
349
|
-
add(body: PhysicsBody3D): void;
|
|
350
|
-
numBodies(): number;
|
|
351
|
-
kinematicMotion?(colliderHandle: number): {
|
|
352
|
-
readonly x: number;
|
|
353
|
-
readonly y: number;
|
|
354
|
-
readonly z: number;
|
|
355
|
-
} | undefined;
|
|
356
|
-
remove(body: PhysicsBody3D): void;
|
|
357
|
-
addArea(area: Area3D): void;
|
|
358
|
-
removeArea(area: Area3D): void;
|
|
359
|
-
}
|
|
360
|
-
type PhysicsPlugin = GamePluginHooks<Record<string, unknown>, PhysicsContext>;
|
|
361
|
-
declare function rapier(options?: PhysicsOptions): PhysicsPlugin;
|
|
362
|
-
|
|
363
|
-
type AreaEvent = "bodyEntered" | "bodyExited";
|
|
364
|
-
type AreaHandler = (body: PhysicsBody3D) => void;
|
|
365
|
-
interface AreaContact {
|
|
366
|
-
readonly area: Area3D;
|
|
367
|
-
readonly body: PhysicsBody3D;
|
|
368
|
-
readonly entity?: string;
|
|
369
|
-
readonly started: boolean;
|
|
370
|
-
}
|
|
371
|
-
interface Area3DOptions {
|
|
372
|
-
readonly entity?: string;
|
|
373
|
-
readonly physics?: PhysicsContext;
|
|
374
|
-
/** @deprecated Prefer `physics`; a raw web world is backend-specific. */
|
|
375
|
-
readonly world?: PhysicsWorldHandle | unknown;
|
|
376
|
-
readonly shape: CollisionShape3D;
|
|
377
|
-
readonly position?: Pick<Vector3, "x" | "y" | "z">;
|
|
378
|
-
/** Godot's collision_layer — which layers this area occupies. Default 1. */
|
|
379
|
-
readonly collisionLayer?: number;
|
|
380
|
-
/** Godot's collision_mask — which layers this area scans. Default 0xffff. */
|
|
381
|
-
readonly collisionMask?: number;
|
|
382
|
-
}
|
|
383
|
-
declare class Area3D {
|
|
384
|
-
#private;
|
|
385
|
-
readonly entity: string | undefined;
|
|
386
|
-
readonly body: PhysicsBodyHandle;
|
|
387
|
-
readonly collider: PhysicsColliderHandle;
|
|
388
|
-
constructor(options: Area3DOptions);
|
|
389
|
-
on(event: AreaEvent, handler: AreaHandler): () => void;
|
|
390
|
-
/** Mirrors Godot's Area3D.monitoring. When false the area reports no contacts. */
|
|
391
|
-
get monitoring(): boolean;
|
|
392
|
-
set monitoring(value: boolean);
|
|
393
|
-
setPosition(position: Pick<Vector3, "x" | "y" | "z">): void;
|
|
394
|
-
/** Called by the shared plugin before a bulk step. */
|
|
395
|
-
writeKinematic(buffer: Float32Array, offset: number): void;
|
|
396
|
-
applyTransform(values: Readonly<Float32Array>, offset: number): void;
|
|
397
|
-
handleCollision(body: PhysicsBody3D, started: boolean): void;
|
|
398
|
-
drainContacts(): AreaContact[];
|
|
399
|
-
reconcileIntersections(current: ReadonlyMap<number, PhysicsBody3D>): void;
|
|
400
|
-
dispose(): void;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
export { Area3D as A, rapier as B, CharacterBody3D as C, type NavigationAgent3DOptions as D, type NavigationAgentEvent as E, type NavigationAgentHandler as F, type NavigationContext as G, NavigationObstacle3D as H, type NavigationObstacle3DOptions as I, type NavigationPlugin as J, NavigationRegion3D as K, type NavigationRegion3DOptions as L, recast as M, NavigationAgent3D as N, PHYSICS_COLLISION_EVENT_STRIDE as P, RigidBody3D as R, type Area3DOptions as a, type AreaContact as b, type AreaEvent as c, type AreaHandler as d, type CharacterBody3DOptions as e, CollisionShape3D as f, type CollisionShapeHandle as g, type CollisionShapeKind as h, PHYSICS_TRANSFORM_STRIDE as i, type PhysicsBody3D as j, type PhysicsBodyCreateOptions as k, type PhysicsBodyHandle as l, type PhysicsCharacterOptions as m, type PhysicsColliderHandle as n, type PhysicsContext as o, type PhysicsHandle as p, type PhysicsInputSnapshot as q, type PhysicsOptions as r, type PhysicsPlugin as s, type PhysicsRuntimeSimulation as t, type PhysicsShapeDescriptor as u, type PhysicsShapeKind as v, type PhysicsSimulation as w, type PhysicsWorldHandle as x, type RigidBody3DOptions as y, type RigidBodyType as z };
|