@adatechnology/game-destruction-three 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.global.js +1756 -1679
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +215 -139
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ renderer.impulse(id, [0, 40, -120], [2, 0.6, -3])
|
|
|
69
69
|
|
|
70
70
|
`bind` finds the meshes of each part from `options.parts` (what `specFromObject3D` returns), else from `userData.destructionPart` or a mesh name that
|
|
71
71
|
equals a part id, else by the part box that contains the mesh centre. `specFromObject3D` reads `userData.destructionMaterial`,
|
|
72
|
-
`destructionPart
|
|
72
|
+
`destructionPart` (a part id, or `{ id, material?, parent?, kind? }`: `parent` + `kind` attach the part to its parent with a joint of that kind), `destructionIgnore`, `destructionTags` and `hollow`.
|
|
73
73
|
|
|
74
74
|
## What each event draws
|
|
75
75
|
|
package/dist/index.d.ts
CHANGED
|
@@ -123,6 +123,13 @@ interface SpecFromObjectResult {
|
|
|
123
123
|
/** Create the renderer. See `DestructionRenderer`. */
|
|
124
124
|
declare function createDestructionRenderer(THREE: ThreeNamespace, options: RendererOptions): DestructionRenderer;
|
|
125
125
|
|
|
126
|
+
/** What `userData.destructionPart` says: a string (the part id) or an object `{ id, material?, parent?, kind? }`. */
|
|
127
|
+
interface PartHint {
|
|
128
|
+
id: string;
|
|
129
|
+
material?: string;
|
|
130
|
+
parent?: string;
|
|
131
|
+
kind?: string;
|
|
132
|
+
}
|
|
126
133
|
/**
|
|
127
134
|
* Build a `DestructibleSpec` from a three.js object: one part per mesh (meshes sharing `userData.destructionPart` become one part), each an
|
|
128
135
|
* axis-aligned box in the root's space (rotation omitted), with the material taken from `options.materialOf`, `userData.destructionMaterial`
|
|
@@ -142,4 +149,4 @@ declare function heatColor(temperatureC: number): number;
|
|
|
142
149
|
/** Every particle kind the renderer can emit. */
|
|
143
150
|
type ParticleKind = DebrisKind | 'fire' | 'flash' | 'foam';
|
|
144
151
|
|
|
145
|
-
export { type BindOptions, type DestructionRenderer, type Mesh, type Object3D, type ParticleKind, type Piece, type Quality, type RendererOptions, type SpecFromObjectOptions, type SpecFromObjectResult, type ThreeNamespace, createDestructionRenderer, heatColor, specFromObject3D };
|
|
152
|
+
export { type BindOptions, type DestructionRenderer, type Mesh, type Object3D, type PartHint, type ParticleKind, type Piece, type Quality, type RendererOptions, type SpecFromObjectOptions, type SpecFromObjectResult, type ThreeNamespace, createDestructionRenderer, heatColor, specFromObject3D };
|