@adatechnology/game-destruction-three 0.26.5 → 0.27.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/README.md +4 -0
- package/dist/ground-worker.global.js.map +1 -1
- package/dist/ground-worker.js.map +1 -1
- package/dist/index.d.ts +37 -24
- package/dist/index.global.js +508 -51
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +341 -19
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Vec3, Fragment, DebrisKind, HitResult, DestructionWorld, MaterialId, DestructibleSpec, MaterialDef, DestructionEvent, BlastOptions, DamageType } from '@adatechnology/game-destruction';
|
|
2
2
|
export { Quat, Vec3 } from '@adatechnology/game-destruction';
|
|
3
3
|
import { WorkerCoordinator, KitOrigin, DeferredQueue, DeferredQueueOptions, WarmUpProbes, BlastShoveOptions, TaskKind, Vec3 as Vec3$1 } from '@adatechnology/game-contracts';
|
|
4
4
|
import { HeightPatch } from '@adatechnology/game-terrain';
|
|
5
5
|
import { WorkerLike, WorkerScopeLike } from '@adatechnology/game-shapes';
|
|
6
6
|
import * as THREE_NS from 'three';
|
|
7
|
-
import { WorkBudgetOptions, PhysicsLoop, SeamWorld, PhysicsEngine, WorldDesc
|
|
7
|
+
import { Quat, WorkBudgetOptions, PhysicsLoop, SeamWorld, PhysicsEngine, WorldDesc } from '@adatechnology/game-physics';
|
|
8
8
|
export { DEFAULT_WORK_BUDGET_MS, isPhysicsLoop, physicsPieceCount } from '@adatechnology/game-physics';
|
|
9
9
|
import { VfxWorld, SpriteKind } from '@adatechnology/game-vfx';
|
|
10
10
|
import { LoopRecipe, SoundBank, SoundRecipe, Falloff, AudioEngine, VoiceGroup, SampleDefaults, SfxManifest } from '@adatechnology/game-audio';
|
|
@@ -114,6 +114,37 @@ declare const createCoordinatorGroundPort: (workers: WorkerCoordinator) => Groun
|
|
|
114
114
|
/** The worker side: each job answered with its tile, every array transferred back (the job's own included, for the main thread's pool). */
|
|
115
115
|
declare const installGroundWorker: (scope: WorkerScopeLike) => void;
|
|
116
116
|
|
|
117
|
+
/** The triangles of a fixed drawn part where no box fits it (world space, three indices a triangle). */
|
|
118
|
+
interface StaticMesh {
|
|
119
|
+
readonly vertices: Float32Array;
|
|
120
|
+
readonly indices: Uint32Array;
|
|
121
|
+
}
|
|
122
|
+
/** A fixed box of what does not move, as it is drawn: centre, half sizes and rotation (world). With `mesh` the part is those triangles, and the box is the one around them. */
|
|
123
|
+
interface StaticSolid {
|
|
124
|
+
readonly center: Vec3;
|
|
125
|
+
readonly half: Vec3;
|
|
126
|
+
readonly rotation: Quat;
|
|
127
|
+
readonly mesh?: StaticMesh;
|
|
128
|
+
/** Names the part across lists (a part measured again is the same part): without it, the place in the list. */
|
|
129
|
+
readonly key?: string;
|
|
130
|
+
/** The Coulomb friction and rolling resistance of the part's material; without it the body has the ground's. */
|
|
131
|
+
readonly friction?: {
|
|
132
|
+
readonly static: number;
|
|
133
|
+
readonly dynamic: number;
|
|
134
|
+
readonly rolling: number;
|
|
135
|
+
readonly rollingDamping?: number;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface EngineImpactsOptions {
|
|
140
|
+
/** Blows under this impulse (N s) do nothing. Default 30. */
|
|
141
|
+
readonly minImpulse?: number;
|
|
142
|
+
/** Most fixed parts hit in a frame, in the order the engine met them. Default 32. */
|
|
143
|
+
readonly hitsMax?: number;
|
|
144
|
+
/** The radius (m) of the blunt contact. Default 0.1. */
|
|
145
|
+
readonly contactRadius?: number;
|
|
146
|
+
}
|
|
147
|
+
|
|
117
148
|
/** What happens to debris that is far from the player and old (`FarDebrisOptions.action`): it sleeps where it lies, or shrinks away and leaves the scene. Debris at rest is already drawn merged by `settledBatches`. */
|
|
118
149
|
type FarDebrisAction = 'sleep' | 'fade';
|
|
119
150
|
interface FarDebrisOptions {
|
|
@@ -326,6 +357,10 @@ interface SoundDetail {
|
|
|
326
357
|
interface RendererOptions {
|
|
327
358
|
/** What steps the loose pieces; required, so a host never ends up on the kit's solver by forgetting it. See `PieceSystemOptions.physics`. */
|
|
328
359
|
physics: PiecePhysics;
|
|
360
|
+
/** The engine's fixed bodies as the broad phase of the world's rays (`DestructionWorld.setRayBroadPhase`): shots, sweeps of the kit and blast sight lines skip objects the engine proves out of the way. Off by default. */
|
|
361
|
+
rayBroadPhase?: boolean;
|
|
362
|
+
/** A blow of the engine on a fixed part of the drawn world (a flying piece into a wall) becomes a `blunt` hit of the world, with the energy of the blow (`engine-impacts.ts`); `true` for the defaults. Needs the pieces in a `PhysicsLoop`. Off by default. */
|
|
363
|
+
contactHits?: boolean | EngineImpactsOptions;
|
|
329
364
|
/** Scene that receives fragments, loose pieces, decals and particles. */
|
|
330
365
|
scene: THREE_NS.Scene;
|
|
331
366
|
world: DestructionWorld;
|
|
@@ -882,28 +917,6 @@ type BlastPacer = {
|
|
|
882
917
|
*/
|
|
883
918
|
declare function createBlastPacer(options: BlastPacerOptions): BlastPacer;
|
|
884
919
|
|
|
885
|
-
/** The triangles of a fixed drawn part where no box fits it (world space, three indices a triangle). */
|
|
886
|
-
interface StaticMesh {
|
|
887
|
-
readonly vertices: Float32Array;
|
|
888
|
-
readonly indices: Uint32Array;
|
|
889
|
-
}
|
|
890
|
-
/** A fixed box of what does not move, as it is drawn: centre, half sizes and rotation (world). With `mesh` the part is those triangles, and the box is the one around them. */
|
|
891
|
-
interface StaticSolid {
|
|
892
|
-
readonly center: Vec3;
|
|
893
|
-
readonly half: Vec3;
|
|
894
|
-
readonly rotation: Quat;
|
|
895
|
-
readonly mesh?: StaticMesh;
|
|
896
|
-
/** Names the part across lists (a part measured again is the same part): without it, the place in the list. */
|
|
897
|
-
readonly key?: string;
|
|
898
|
-
/** The Coulomb friction and rolling resistance of the part's material; without it the body has the ground's. */
|
|
899
|
-
readonly friction?: {
|
|
900
|
-
readonly static: number;
|
|
901
|
-
readonly dynamic: number;
|
|
902
|
-
readonly rolling: number;
|
|
903
|
-
readonly rollingDamping?: number;
|
|
904
|
-
};
|
|
905
|
-
}
|
|
906
|
-
|
|
907
920
|
/**
|
|
908
921
|
* One fixed drawn part to measure (`measureStaticPart`): plain arrays, so it crosses to a worker (`destruction.static-colliders`). The main thread reads the vertices,
|
|
909
922
|
* the triangles and the mesh's world matrix (with three's own `decompose` of it); the measuring is here.
|