@adatechnology/game-items-three 0.3.2 → 0.4.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/dist/index.d.ts +13 -1
- package/dist/index.global.js +726 -122
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +64 -11
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -151,9 +151,14 @@ interface ItemDestruction {
|
|
|
151
151
|
readonly materials?: Readonly<Record<string, string>>;
|
|
152
152
|
/** Segments the cylinder and box meshes of the model are rebuilt with, so a bullet dent (a few millimetres wide) finds vertices to push in. */
|
|
153
153
|
readonly tessellate?: {
|
|
154
|
+
/**
|
|
155
|
+
* With `capRings` (and `three` given to `tagForDestruction`) a cylinder becomes one lathe with that many rings on each end, so the lid and the bottom dent
|
|
156
|
+
* too; its rows then are about as tall as its columns are wide, never more than `heightSegments`.
|
|
157
|
+
*/
|
|
154
158
|
readonly cylinder?: {
|
|
155
159
|
readonly heightSegments: number;
|
|
156
160
|
readonly radialSegments: number;
|
|
161
|
+
readonly capRings?: number;
|
|
157
162
|
};
|
|
158
163
|
readonly box?: {
|
|
159
164
|
readonly widthSegments: number;
|
|
@@ -161,6 +166,11 @@ interface ItemDestruction {
|
|
|
161
166
|
readonly depthSegments: number;
|
|
162
167
|
};
|
|
163
168
|
};
|
|
169
|
+
/** Real wall thickness in metres of the shell (`body`, the largest mesh) and of its other parts (`ends`: lid, bottom, neck), for the destruction world. */
|
|
170
|
+
readonly wall?: {
|
|
171
|
+
readonly body: number;
|
|
172
|
+
readonly ends: number;
|
|
173
|
+
};
|
|
164
174
|
}
|
|
165
175
|
/** A family of models that behave alike: one rule for all of them, so adding a model is one id and changing the rule changes them all. */
|
|
166
176
|
interface ItemFamily {
|
|
@@ -205,11 +215,13 @@ interface DestructionTagOptions {
|
|
|
205
215
|
readonly weight?: number;
|
|
206
216
|
/** Size in metres, for the contents of the shell. */
|
|
207
217
|
readonly size?: readonly [number, number, number];
|
|
218
|
+
/** three.js, for the shapes three only makes from scratch (a cylinder with rings on its ends: `tessellate.cylinder.capRings`). */
|
|
219
|
+
readonly three?: typeof THREE_NS;
|
|
208
220
|
}
|
|
209
221
|
/**
|
|
210
222
|
* Writes the `userData` that `specFromObject3D` reads onto the meshes of a drawn item: the destruction material of each mesh from its kit material tag,
|
|
211
223
|
* the item's real weight in kg (`destructionMass`, so the world weighs what the thing weighs) and what the model's family in `data/destruction.json` asks for (hollow shells, welded parts, skins),
|
|
212
|
-
* with the liquid the model holds on its shell (`destructionContains`).
|
|
224
|
+
* with the liquid the model holds on its shell (`destructionContains`) and the real thickness of each wall (`destructionThickness`).
|
|
213
225
|
*/
|
|
214
226
|
declare function tagForDestruction(root: THREE_NS.Object3D, options?: DestructionTagOptions): void;
|
|
215
227
|
|