@jgengine/core 0.7.0 → 0.9.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/CHANGELOG.md +63 -0
- package/README.md +2 -0
- package/dist/ai/flock.d.ts +36 -0
- package/dist/ai/flock.js +182 -0
- package/dist/ai/groupAssist.d.ts +19 -0
- package/dist/ai/groupAssist.js +59 -0
- package/dist/ai/laneSelect.d.ts +21 -0
- package/dist/ai/laneSelect.js +37 -0
- package/dist/ai/mobBrain.d.ts +68 -0
- package/dist/ai/mobBrain.js +115 -0
- package/dist/ai/spawnDirector.d.ts +5 -0
- package/dist/ai/spawnDirector.js +14 -2
- package/dist/ai/threat.d.ts +2 -0
- package/dist/ai/threat.js +34 -0
- package/dist/anim/easing.d.ts +14 -0
- package/dist/anim/easing.js +55 -0
- package/dist/behaviour/behaviour.d.ts +136 -0
- package/dist/behaviour/behaviour.js +388 -0
- package/dist/cards/cardPile.d.ts +1 -0
- package/dist/cards/cardPile.js +12 -3
- package/dist/cartridge/runtime.d.ts +15 -0
- package/dist/cartridge/runtime.js +556 -0
- package/dist/cartridge/spec.d.ts +188 -0
- package/dist/cartridge/spec.js +19 -0
- package/dist/cartridge/validate.d.ts +2 -0
- package/dist/cartridge/validate.js +78 -0
- package/dist/combat/abilityKit.d.ts +22 -2
- package/dist/combat/abilityKit.js +72 -13
- package/dist/combat/castRunner.d.ts +40 -0
- package/dist/combat/castRunner.js +56 -0
- package/dist/combat/comboPoints.d.ts +14 -0
- package/dist/combat/comboPoints.js +52 -0
- package/dist/combat/defensiveWindow.d.ts +1 -1
- package/dist/combat/defensiveWindow.js +5 -3
- package/dist/combat/effects.d.ts +1 -1
- package/dist/combat/effects.js +9 -6
- package/dist/combat/projectiles.d.ts +64 -6
- package/dist/combat/projectiles.js +232 -74
- package/dist/combat/resistance.d.ts +16 -4
- package/dist/combat/resistance.js +43 -7
- package/dist/combat/resourcePool.d.ts +20 -0
- package/dist/combat/resourcePool.js +55 -0
- package/dist/combat/shotOrigin.d.ts +40 -0
- package/dist/combat/shotOrigin.js +57 -0
- package/dist/combat/telegraph.d.ts +30 -1
- package/dist/combat/telegraph.js +61 -0
- package/dist/commands/commandRegistry.d.ts +1 -1
- package/dist/commands/commandRegistry.js +2 -1
- package/dist/crafting/recipe.js +4 -1
- package/dist/data/dataSource.d.ts +26 -0
- package/dist/data/dataSource.js +93 -0
- package/dist/data/devProxy.d.ts +11 -0
- package/dist/data/devProxy.js +38 -0
- package/dist/data/fetchJson.d.ts +20 -0
- package/dist/data/fetchJson.js +43 -0
- package/dist/data/jsonDataSource.d.ts +4 -0
- package/dist/data/jsonDataSource.js +6 -0
- package/dist/devtools/devtools.d.ts +205 -0
- package/dist/devtools/devtools.js +832 -0
- package/dist/devtools/transformTunables.d.ts +14 -0
- package/dist/devtools/transformTunables.js +38 -0
- package/dist/devtools/tunableSchema.d.ts +140 -0
- package/dist/devtools/tunableSchema.js +476 -0
- package/dist/faction/factions.d.ts +33 -0
- package/dist/faction/factions.js +76 -0
- package/dist/faction/reputation.d.ts +32 -0
- package/dist/faction/reputation.js +82 -0
- package/dist/game/chat.d.ts +68 -0
- package/dist/game/chat.js +173 -0
- package/dist/game/chatFilter.d.ts +15 -0
- package/dist/game/chatFilter.js +55 -0
- package/dist/game/controlGate.d.ts +4 -0
- package/dist/game/controlGate.js +7 -0
- package/dist/game/defineGame.d.ts +10 -2
- package/dist/game/defineGame.js +2 -1
- package/dist/game/events.d.ts +35 -0
- package/dist/game/gamePhase.d.ts +20 -0
- package/dist/game/gamePhase.js +21 -0
- package/dist/game/levelSequence.d.ts +44 -0
- package/dist/game/levelSequence.js +78 -0
- package/dist/game/lootTable.d.ts +10 -1
- package/dist/game/lootTable.js +27 -7
- package/dist/game/playableGame.d.ts +286 -6
- package/dist/game/playableGame.js +6 -1
- package/dist/game/progression.d.ts +1 -0
- package/dist/game/progression.js +23 -2
- package/dist/game/quest.d.ts +7 -3
- package/dist/game/quest.js +17 -8
- package/dist/game/race.d.ts +44 -1
- package/dist/game/race.js +116 -11
- package/dist/game/recordBook.d.ts +29 -0
- package/dist/game/recordBook.js +86 -0
- package/dist/game/social.d.ts +42 -0
- package/dist/game/social.js +122 -0
- package/dist/game/spawnPoints.d.ts +19 -0
- package/dist/game/spawnPoints.js +23 -0
- package/dist/game/talents.d.ts +47 -0
- package/dist/game/talents.js +140 -0
- package/dist/game/worldItem.d.ts +3 -0
- package/dist/game/worldItem.js +12 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/input/actionBindings.d.ts +10 -0
- package/dist/input/actionBindings.js +14 -0
- package/dist/input/axisInput.d.ts +26 -3
- package/dist/input/axisInput.js +44 -4
- package/dist/input/bindingOverrides.d.ts +25 -0
- package/dist/input/bindingOverrides.js +95 -0
- package/dist/input/gestureSurface.d.ts +31 -0
- package/dist/input/gestureSurface.js +120 -0
- package/dist/input/pointer.d.ts +45 -0
- package/dist/input/pointer.js +48 -0
- package/dist/input/pointerAxis.d.ts +30 -0
- package/dist/input/pointerAxis.js +31 -0
- package/dist/input/touchScheme.d.ts +89 -0
- package/dist/input/touchScheme.js +153 -0
- package/dist/item/affix.d.ts +1 -1
- package/dist/item/affix.js +1 -19
- package/dist/meta/changelog.d.ts +1 -1
- package/dist/meta/changelog.js +59 -1
- package/dist/movement/dash.d.ts +3 -0
- package/dist/movement/dash.js +19 -5
- package/dist/movement/glideModel.d.ts +44 -0
- package/dist/movement/glideModel.js +54 -0
- package/dist/movement/grappleSwing.d.ts +34 -0
- package/dist/movement/grappleSwing.js +56 -0
- package/dist/movement/leaderTrail.d.ts +29 -0
- package/dist/movement/leaderTrail.js +67 -0
- package/dist/movement/movementModel.d.ts +36 -3
- package/dist/movement/movementModel.js +81 -5
- package/dist/movement/steering.d.ts +27 -0
- package/dist/movement/steering.js +40 -0
- package/dist/movement/voxelController.d.ts +61 -0
- package/dist/movement/voxelController.js +229 -0
- package/dist/multiplayer/chatContract.d.ts +42 -0
- package/dist/multiplayer/chatContract.js +57 -0
- package/dist/multiplayer/feedWriteGate.d.ts +10 -0
- package/dist/multiplayer/feedWriteGate.js +12 -0
- package/dist/multiplayer/identity.d.ts +13 -0
- package/dist/multiplayer/identity.js +20 -0
- package/dist/multiplayer/poseSyncGate.d.ts +1 -0
- package/dist/multiplayer/poseSyncGate.js +13 -1
- package/dist/multiplayer/presenceModel.d.ts +17 -2
- package/dist/multiplayer/presenceModel.js +30 -4
- package/dist/multiplayer/voiceContract.d.ts +44 -0
- package/dist/multiplayer/voiceContract.js +108 -0
- package/dist/nav/corridors.d.ts +30 -0
- package/dist/nav/corridors.js +69 -0
- package/dist/nav/navConstrain.d.ts +14 -0
- package/dist/nav/navConstrain.js +26 -0
- package/dist/nav/navFromEnvironment.d.ts +11 -0
- package/dist/nav/navFromEnvironment.js +16 -0
- package/dist/nav/navGrid.d.ts +10 -0
- package/dist/nav/navGrid.js +48 -5
- package/dist/nav/pathFollow.d.ts +4 -2
- package/dist/nav/pathFollow.js +5 -3
- package/dist/nav/railGraph.d.ts +66 -0
- package/dist/nav/railGraph.js +129 -0
- package/dist/nav/timetable.d.ts +41 -0
- package/dist/nav/timetable.js +94 -0
- package/dist/physics/ballisticSweep.d.ts +18 -0
- package/dist/physics/ballisticSweep.js +49 -0
- package/dist/physics/buoyancy.d.ts +6 -0
- package/dist/physics/buoyancy.js +14 -0
- package/dist/physics/flowTube.d.ts +32 -0
- package/dist/physics/flowTube.js +64 -0
- package/dist/physics/forceVolume.d.ts +27 -0
- package/dist/physics/forceVolume.js +43 -5
- package/dist/physics/kinematicVehicle.d.ts +52 -0
- package/dist/physics/kinematicVehicle.js +81 -0
- package/dist/physics/physicsWorld.d.ts +54 -8
- package/dist/physics/physicsWorld.js +400 -79
- package/dist/physics/ragdoll.js +1 -1
- package/dist/physics/spatialGrid.d.ts +1 -1
- package/dist/physics/spatialGrid.js +5 -0
- package/dist/physics/vehicleBody.d.ts +6 -0
- package/dist/physics/vehicleBody.js +18 -18
- package/dist/puzzle/cellGrid.d.ts +26 -0
- package/dist/puzzle/cellGrid.js +110 -0
- package/dist/puzzle/fallingPiece.d.ts +24 -0
- package/dist/puzzle/fallingPiece.js +51 -0
- package/dist/random/nameGen.d.ts +18 -0
- package/dist/random/nameGen.js +35 -0
- package/dist/random/rng.d.ts +2 -0
- package/dist/random/rng.js +23 -0
- package/dist/random/seedLink.d.ts +5 -0
- package/dist/random/seedLink.js +35 -0
- package/dist/runtime/adapter.d.ts +35 -0
- package/dist/runtime/adapter.js +37 -1
- package/dist/runtime/cameraDirector.d.ts +15 -0
- package/dist/runtime/cameraDirector.js +31 -0
- package/dist/runtime/commandRunner.d.ts +2 -2
- package/dist/runtime/commandRunner.js +2 -2
- package/dist/runtime/gameContext.d.ts +65 -2
- package/dist/runtime/gameContext.js +280 -9
- package/dist/runtime/gameRuntime.d.ts +5 -1
- package/dist/runtime/gameRuntime.js +13 -12
- package/dist/runtime/hostPersistence.d.ts +30 -1
- package/dist/runtime/hostPersistence.js +70 -5
- package/dist/runtime/inputSnapshot.d.ts +12 -0
- package/dist/runtime/inputSnapshot.js +17 -0
- package/dist/runtime/motionIntents.d.ts +33 -0
- package/dist/runtime/motionIntents.js +43 -0
- package/dist/runtime/snapshot.d.ts +1 -0
- package/dist/runtime/snapshot.js +1 -1
- package/dist/runtime/transport.d.ts +32 -0
- package/dist/runtime/visibility.d.ts +74 -0
- package/dist/runtime/visibility.js +127 -0
- package/dist/scene/colliders.d.ts +44 -0
- package/dist/scene/colliders.js +77 -0
- package/dist/scene/entityStore.d.ts +30 -5
- package/dist/scene/entityStore.js +83 -13
- package/dist/scene/movementSpeed.d.ts +35 -0
- package/dist/scene/movementSpeed.js +20 -0
- package/dist/scene/objectQuery.d.ts +29 -0
- package/dist/scene/objectQuery.js +140 -0
- package/dist/scene/objectStore.d.ts +13 -0
- package/dist/scene/objectStore.js +130 -6
- package/dist/scene/paintLayer.d.ts +15 -0
- package/dist/scene/paintLayer.js +53 -0
- package/dist/scene/sceneRaycast.d.ts +80 -0
- package/dist/scene/sceneRaycast.js +284 -0
- package/dist/scene/spatial.d.ts +17 -1
- package/dist/scene/spatial.js +140 -17
- package/dist/sensor/concealment.d.ts +21 -0
- package/dist/sensor/concealment.js +63 -0
- package/dist/sensor/freezeMonitor.d.ts +17 -0
- package/dist/sensor/freezeMonitor.js +35 -0
- package/dist/sensor/recordingBuffer.d.ts +6 -0
- package/dist/sensor/recordingBuffer.js +7 -0
- package/dist/sensor/replayLoop.d.ts +39 -0
- package/dist/sensor/replayLoop.js +64 -0
- package/dist/sensor/visionCone.d.ts +31 -0
- package/dist/sensor/visionCone.js +72 -0
- package/dist/session/extraction.d.ts +2 -2
- package/dist/session/extraction.js +13 -2
- package/dist/session/roles.d.ts +6 -0
- package/dist/session/roles.js +32 -0
- package/dist/session/roundState.d.ts +41 -17
- package/dist/session/roundState.js +67 -38
- package/dist/settings/settingsModel.d.ts +97 -0
- package/dist/settings/settingsModel.js +100 -0
- package/dist/stats/statModifiers.d.ts +5 -2
- package/dist/stats/statModifiers.js +32 -14
- package/dist/store/observableKeyedStore.js +8 -2
- package/dist/survival/decayMeter.d.ts +1 -1
- package/dist/survival/decayMeter.js +0 -1
- package/dist/tactics/fallingGrid.d.ts +62 -0
- package/dist/tactics/fallingGrid.js +158 -0
- package/dist/tactics/tacticalGrid.d.ts +11 -0
- package/dist/tactics/tacticalGrid.js +17 -0
- package/dist/time/beatClock.d.ts +18 -0
- package/dist/time/beatClock.js +24 -0
- package/dist/time/idleProgress.d.ts +29 -0
- package/dist/time/idleProgress.js +31 -0
- package/dist/time/serverTick.d.ts +7 -1
- package/dist/time/serverTick.js +27 -4
- package/dist/time/simClock.d.ts +25 -1
- package/dist/time/simClock.js +28 -3
- package/dist/time/stateSchedule.d.ts +57 -0
- package/dist/time/stateSchedule.js +121 -0
- package/dist/turn/commit.d.ts +2 -2
- package/dist/turn/commit.js +2 -2
- package/dist/turn/intent.d.ts +14 -0
- package/dist/turn/intent.js +29 -0
- package/dist/turn/turnLoop.d.ts +2 -0
- package/dist/turn/turnLoop.js +8 -1
- package/dist/ui/hudLayout.d.ts +58 -0
- package/dist/ui/hudLayout.js +207 -0
- package/dist/ui/hudScale.d.ts +44 -0
- package/dist/ui/hudScale.js +55 -0
- package/dist/visibility/assetStreaming.d.ts +66 -0
- package/dist/visibility/assetStreaming.js +201 -0
- package/dist/visibility/bounds.d.ts +66 -0
- package/dist/visibility/bounds.js +113 -0
- package/dist/visibility/camera.d.ts +21 -0
- package/dist/visibility/camera.js +3 -0
- package/dist/visibility/config.d.ts +21 -0
- package/dist/visibility/config.js +1 -0
- package/dist/visibility/diagnostics.d.ts +26 -0
- package/dist/visibility/diagnostics.js +36 -0
- package/dist/visibility/distance.d.ts +11 -0
- package/dist/visibility/distance.js +30 -0
- package/dist/visibility/frustum.d.ts +47 -0
- package/dist/visibility/frustum.js +186 -0
- package/dist/visibility/occlusion.d.ts +36 -0
- package/dist/visibility/occlusion.js +45 -0
- package/dist/visibility/settings.d.ts +75 -0
- package/dist/visibility/settings.js +49 -0
- package/dist/visibility/simulationCulling.d.ts +34 -0
- package/dist/visibility/simulationCulling.js +36 -0
- package/dist/visibility/spatialIndex.d.ts +45 -0
- package/dist/visibility/spatialIndex.js +198 -0
- package/dist/visibility/visibilitySystem.d.ts +90 -0
- package/dist/visibility/visibilitySystem.js +257 -0
- package/dist/world/buildings.d.ts +6 -0
- package/dist/world/buildings.js +152 -0
- package/dist/world/carve.d.ts +7 -2
- package/dist/world/carve.js +17 -7
- package/dist/world/cellStates.d.ts +45 -0
- package/dist/world/cellStates.js +103 -0
- package/dist/world/environmentSummary.d.ts +61 -0
- package/dist/world/environmentSummary.js +138 -0
- package/dist/world/features.d.ts +138 -9
- package/dist/world/features.js +73 -2
- package/dist/world/gridInstances.d.ts +12 -0
- package/dist/world/gridInstances.js +160 -0
- package/dist/world/lod.d.ts +17 -0
- package/dist/world/lod.js +66 -0
- package/dist/world/mapLayers.d.ts +60 -0
- package/dist/world/mapLayers.js +44 -0
- package/dist/world/massing.d.ts +45 -0
- package/dist/world/massing.js +581 -0
- package/dist/world/minimap.d.ts +13 -1
- package/dist/world/minimap.js +21 -2
- package/dist/world/placementController.d.ts +22 -1
- package/dist/world/placementController.js +56 -0
- package/dist/world/terrain.d.ts +62 -1
- package/dist/world/terrain.js +253 -9
- package/dist/world/voxelField.d.ts +54 -0
- package/dist/world/voxelField.js +241 -0
- package/dist/world/water.d.ts +7 -0
- package/dist/world/water.js +19 -4
- package/dist/world/weather.d.ts +3 -18
- package/dist/world/weather.js +4 -17
- package/dist/world/windZones.d.ts +47 -0
- package/dist/world/windZones.js +59 -0
- package/llms.txt +4983 -0
- package/package.json +14 -3
|
@@ -49,9 +49,8 @@ export interface PhysicsStats {
|
|
|
49
49
|
substeps: number;
|
|
50
50
|
stepMs: number;
|
|
51
51
|
}
|
|
52
|
-
export interface
|
|
52
|
+
export interface BodyCommonOptions {
|
|
53
53
|
position: readonly [number, number, number];
|
|
54
|
-
halfExtents: readonly [number, number, number];
|
|
55
54
|
velocity?: readonly [number, number, number];
|
|
56
55
|
/** ≤ 0 or omitted with `static` → infinite mass (immovable collider). Default 1. */
|
|
57
56
|
mass?: number;
|
|
@@ -60,12 +59,28 @@ export interface AddBodyOptions {
|
|
|
60
59
|
/** Seed the body asleep (a settled bed pays no integration cost until woken). */
|
|
61
60
|
asleep?: boolean;
|
|
62
61
|
}
|
|
62
|
+
export interface BoxBodyOptions extends BodyCommonOptions {
|
|
63
|
+
shape?: "box";
|
|
64
|
+
halfExtents: readonly [number, number, number];
|
|
65
|
+
}
|
|
66
|
+
/** The radius fills all three half-extent columns, so broadphase and bounds see the sphere's enclosing AABB. */
|
|
67
|
+
export interface SphereBodyOptions extends BodyCommonOptions {
|
|
68
|
+
shape: "sphere";
|
|
69
|
+
radius: number;
|
|
70
|
+
}
|
|
71
|
+
export type AddBodyOptions = BoxBodyOptions | SphereBodyOptions;
|
|
72
|
+
export declare const SHAPE_BOX = 0;
|
|
73
|
+
export declare const SHAPE_SPHERE = 1;
|
|
63
74
|
/**
|
|
64
|
-
* `
|
|
65
|
-
*
|
|
66
|
-
* holds a fixed separation
|
|
75
|
+
* Hard bilateral: `fixed` pins the shared anchor (3-DOF), `hinge` pins only the plane
|
|
76
|
+
* perpendicular to `axis` (free along the axis — translational cylindrical), `distance`
|
|
77
|
+
* holds a fixed separation. `spring` is a soft PD drive toward `restLength`.
|
|
67
78
|
*/
|
|
68
79
|
export type JointKind = "hinge" | "distance" | "spring" | "fixed";
|
|
80
|
+
export declare const JOINT_FIXED = 0;
|
|
81
|
+
export declare const JOINT_HINGE = 1;
|
|
82
|
+
export declare const JOINT_DISTANCE = 2;
|
|
83
|
+
export declare const JOINT_SPRING = 3;
|
|
69
84
|
export interface JointOptions {
|
|
70
85
|
/** First body index. */
|
|
71
86
|
bodyA: number;
|
|
@@ -83,7 +98,7 @@ export interface JointOptions {
|
|
|
83
98
|
damping?: number;
|
|
84
99
|
/** Clamp on the per-substep spring impulse (a follow-point that never yanks). Default unbounded. */
|
|
85
100
|
maxImpulse?: number;
|
|
86
|
-
/**
|
|
101
|
+
/** Unit hinge axis (world). Required semantics for `hingeJoint`; free motion along this axis. Default [0,1,0]. */
|
|
87
102
|
axis?: readonly [number, number, number];
|
|
88
103
|
}
|
|
89
104
|
/** A contact reported to `onCollision`. The object is reused each call — read/copy, never retain. */
|
|
@@ -96,6 +111,8 @@ export interface CollisionEvent {
|
|
|
96
111
|
approachSpeed: number;
|
|
97
112
|
impulse: number;
|
|
98
113
|
}
|
|
114
|
+
/** Cap on `nx*ny*nz` broadphase cells — guards a huge-bounds/tiny-cellSize config from hanging `step()`. */
|
|
115
|
+
export declare const MAX_BROADPHASE_CELLS = 1000000;
|
|
99
116
|
/** Grid cell containing a point, clamped into the grid. Pure — exported for tests. */
|
|
100
117
|
export declare function cellCoord(value: number, min: number, cellSize: number, cells: number): number;
|
|
101
118
|
/** Linear cell index from clamped 3D coords. Pure — exported for tests. */
|
|
@@ -130,6 +147,8 @@ export declare class PhysicsWorld {
|
|
|
130
147
|
readonly halfZ: Float32Array;
|
|
131
148
|
readonly invMass: Float32Array;
|
|
132
149
|
readonly flags: Uint8Array;
|
|
150
|
+
/** `SHAPE_BOX` (0) or `SHAPE_SPHERE` (1) per body; spheres keep their radius in halfX/halfY/halfZ. */
|
|
151
|
+
readonly shape: Uint8Array;
|
|
133
152
|
/** 1 for a body that took part in a contact this frame; reset each `step()`. Render tint reads this. */
|
|
134
153
|
readonly contact: Uint8Array;
|
|
135
154
|
private readonly sleepTimer;
|
|
@@ -142,12 +161,12 @@ export declare class PhysicsWorld {
|
|
|
142
161
|
private readonly numCells;
|
|
143
162
|
private readonly cellStart;
|
|
144
163
|
private readonly cursor;
|
|
145
|
-
private
|
|
164
|
+
private sorted;
|
|
146
165
|
private readonly bodyCell;
|
|
147
166
|
private readonly awakeList;
|
|
148
167
|
private readonly awakeSlot;
|
|
149
168
|
private awakeCount;
|
|
150
|
-
private readonly
|
|
169
|
+
private readonly jKind;
|
|
151
170
|
private readonly jActive;
|
|
152
171
|
private readonly jBodyA;
|
|
153
172
|
private readonly jBodyB;
|
|
@@ -157,6 +176,9 @@ export declare class PhysicsWorld {
|
|
|
157
176
|
private readonly jAnchorBX;
|
|
158
177
|
private readonly jAnchorBY;
|
|
159
178
|
private readonly jAnchorBZ;
|
|
179
|
+
private readonly jAxisX;
|
|
180
|
+
private readonly jAxisY;
|
|
181
|
+
private readonly jAxisZ;
|
|
160
182
|
private readonly jRest;
|
|
161
183
|
private readonly jStiffness;
|
|
162
184
|
private readonly jDamping;
|
|
@@ -165,6 +187,9 @@ export declare class PhysicsWorld {
|
|
|
165
187
|
private jFreeCount;
|
|
166
188
|
private jointHigh;
|
|
167
189
|
private jointActiveCount;
|
|
190
|
+
private readonly bodyFree;
|
|
191
|
+
private bodyFreeCount;
|
|
192
|
+
private bodyHigh;
|
|
168
193
|
private collisionListener;
|
|
169
194
|
private collisionMinSpeed;
|
|
170
195
|
private readonly collisionEvent;
|
|
@@ -175,6 +200,8 @@ export declare class PhysicsWorld {
|
|
|
175
200
|
private addAwake;
|
|
176
201
|
private removeAwake;
|
|
177
202
|
get count(): number;
|
|
203
|
+
/** One past the highest slot `addBody` has ever handed out — the range `removeBody` leaves holes in. */
|
|
204
|
+
get highWater(): number;
|
|
178
205
|
get cells(): {
|
|
179
206
|
nx: number;
|
|
180
207
|
ny: number;
|
|
@@ -196,13 +223,32 @@ export declare class PhysicsWorld {
|
|
|
196
223
|
removeJoint(id: number): void;
|
|
197
224
|
/** Move a joint's world anchor point (only meaningful when `bodyB` is a world anchor). */
|
|
198
225
|
setJointAnchor(id: number, x: number, y: number, z: number): void;
|
|
226
|
+
/** Move a joint's local anchor offset on A (world axes, no rotation applied by the solver). */
|
|
227
|
+
setJointAnchorA(id: number, x: number, y: number, z: number): void;
|
|
199
228
|
setJointRest(id: number, restLength: number): void;
|
|
200
229
|
private jointDistance;
|
|
201
230
|
/** Write [ax,ay,az,bx,by,bz] world endpoints per active joint into `out`; returns the joint count. */
|
|
202
231
|
readJointSegments(out: Float32Array): number;
|
|
203
232
|
addBody(options: AddBodyOptions): number;
|
|
233
|
+
/**
|
|
234
|
+
* Remove a body: it drops out of integration, the solver, and the broadphase, and its slot is
|
|
235
|
+
* queued for the next `addBody` to reuse. `id` and every other body's `id` stay valid — a dead
|
|
236
|
+
* slot is tombstoned (`FLAG_DEAD`), never swapped, since ids are handed out raw and stored as-is
|
|
237
|
+
* in joints and game state. There is no persistent contact set to consult, so — conservatively —
|
|
238
|
+
* any sleeping body whose AABB touches the removed body's (padded by `slop`) is woken; a body
|
|
239
|
+
* that was resting on it always qualifies.
|
|
240
|
+
*/
|
|
241
|
+
removeBody(id: number): void;
|
|
242
|
+
private wakeTouching;
|
|
204
243
|
isSleeping(i: number): boolean;
|
|
244
|
+
isAlive(i: number): boolean;
|
|
205
245
|
wake(i: number): void;
|
|
246
|
+
/** Overwrite a body's velocity directly, waking it if asleep. */
|
|
247
|
+
setVelocity(id: number, x: number, y: number, z: number): void;
|
|
248
|
+
/** Move a body, keeping its current velocity, and wake it if asleep. */
|
|
249
|
+
setPosition(id: number, x: number, y: number, z: number): void;
|
|
250
|
+
/** Move a body and zero its velocity — a hard reset (respawn, teleporter) instead of a slide. */
|
|
251
|
+
teleport(id: number, x: number, y: number, z: number): void;
|
|
206
252
|
wakeAll(): void;
|
|
207
253
|
clear(): void;
|
|
208
254
|
/** Advance by a real frame delta; runs whole fixed substeps and carries the remainder. */
|