@adatechnology/game-destruction-three 0.29.0 → 0.29.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.global.js +8 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4169,7 +4169,7 @@ var EnginePieces = class {
|
|
|
4169
4169
|
}
|
|
4170
4170
|
/** A round piece rolls to a stop by its surface's rolling resistance (the adapter's rule; the engine has none). */
|
|
4171
4171
|
rollingOf(b) {
|
|
4172
|
-
return b.round ? { coefficient: b.friction?.rolling ?? ROLLING_RESISTANCE, radius: b.round.radius } : void 0;
|
|
4172
|
+
return b.round ? { coefficient: b.friction?.rolling ?? ROLLING_RESISTANCE, radius: b.round.radius, damping: b.friction?.rollingDamping ?? PIECE_ROLLING_DAMPING } : void 0;
|
|
4173
4173
|
}
|
|
4174
4174
|
material(b) {
|
|
4175
4175
|
return {
|
|
@@ -4785,11 +4785,13 @@ var EnginePieces = class {
|
|
|
4785
4785
|
/** The surface of the tile's bodies: the ground's own rolling resistance at its middle (`tileRollingAt`), one shared object per value; `GROUND` without the host's. */
|
|
4786
4786
|
groundMaterial(ix, iz) {
|
|
4787
4787
|
const rolling = this.o.groundRollingAt ? tileRollingAt(this.o.groundRollingAt, ix * TILE, iz * TILE) : void 0;
|
|
4788
|
-
|
|
4789
|
-
|
|
4788
|
+
const damping = this.o.groundRollingDampingAt ? tileRollingAt(this.o.groundRollingDampingAt, ix * TILE, iz * TILE) : void 0;
|
|
4789
|
+
if ((rolling === void 0 || rolling === ROLLING_RESISTANCE) && damping === void 0) return GROUND;
|
|
4790
|
+
const key = `${rolling ?? ROLLING_RESISTANCE}|${damping ?? ""}`;
|
|
4791
|
+
let material = this.groundMaterials.get(key);
|
|
4790
4792
|
if (!material) {
|
|
4791
|
-
material = { ...GROUND, rolling };
|
|
4792
|
-
this.groundMaterials.set(
|
|
4793
|
+
material = { ...GROUND, rolling: rolling ?? ROLLING_RESISTANCE, ...damping === void 0 ? {} : { rollingDamping: damping } };
|
|
4794
|
+
this.groundMaterials.set(key, material);
|
|
4793
4795
|
}
|
|
4794
4796
|
return material;
|
|
4795
4797
|
}
|
|
@@ -5324,6 +5326,7 @@ var PieceSystem = class {
|
|
|
5324
5326
|
this.engine = resolved ? new EnginePieces(THREE, resolved.loop.world, {
|
|
5325
5327
|
groundAt: o.terrainAt ?? o.groundAt,
|
|
5326
5328
|
...o.terrainRollingAt ? { groundRollingAt: o.terrainRollingAt } : {},
|
|
5329
|
+
...o.terrainRollingDampingAt ? { groundRollingDampingAt: o.terrainRollingDampingAt } : {},
|
|
5327
5330
|
...o.terrainRangeAt ? { groundRange: o.terrainRangeAt } : {},
|
|
5328
5331
|
// the grid stands for `terrainAt` alone: without it the tiles read `groundAt`, which the grid may not be (a lot flattened, a slab)
|
|
5329
5332
|
...o.terrainGridAt && o.terrainAt ? { groundGrid: o.terrainGridAt } : {},
|