@adatechnology/game-destruction-three 0.29.0 → 0.29.2
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 +4 -4
package/dist/index.global.js
CHANGED
|
@@ -14902,7 +14902,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
|
|
|
14902
14902
|
}
|
|
14903
14903
|
/** A round piece rolls to a stop by its surface's rolling resistance (the adapter's rule; the engine has none). */
|
|
14904
14904
|
rollingOf(b) {
|
|
14905
|
-
return b.round ? { coefficient: b.friction?.rolling ?? ROLLING_RESISTANCE, radius: b.round.radius } : void 0;
|
|
14905
|
+
return b.round ? { coefficient: b.friction?.rolling ?? ROLLING_RESISTANCE, radius: b.round.radius, damping: b.friction?.rollingDamping ?? PIECE_ROLLING_DAMPING } : void 0;
|
|
14906
14906
|
}
|
|
14907
14907
|
material(b) {
|
|
14908
14908
|
return {
|
|
@@ -15518,11 +15518,13 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
|
|
|
15518
15518
|
/** 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. */
|
|
15519
15519
|
groundMaterial(ix, iz) {
|
|
15520
15520
|
const rolling = this.o.groundRollingAt ? tileRollingAt(this.o.groundRollingAt, ix * TILE, iz * TILE) : void 0;
|
|
15521
|
-
|
|
15522
|
-
|
|
15521
|
+
const damping = this.o.groundRollingDampingAt ? tileRollingAt(this.o.groundRollingDampingAt, ix * TILE, iz * TILE) : void 0;
|
|
15522
|
+
if ((rolling === void 0 || rolling === ROLLING_RESISTANCE) && damping === void 0) return GROUND;
|
|
15523
|
+
const key = `${rolling ?? ROLLING_RESISTANCE}|${damping ?? ""}`;
|
|
15524
|
+
let material = this.groundMaterials.get(key);
|
|
15523
15525
|
if (!material) {
|
|
15524
|
-
material = { ...GROUND, rolling };
|
|
15525
|
-
this.groundMaterials.set(
|
|
15526
|
+
material = { ...GROUND, rolling: rolling ?? ROLLING_RESISTANCE, ...damping === void 0 ? {} : { rollingDamping: damping } };
|
|
15527
|
+
this.groundMaterials.set(key, material);
|
|
15526
15528
|
}
|
|
15527
15529
|
return material;
|
|
15528
15530
|
}
|
|
@@ -16056,6 +16058,7 @@ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)
|
|
|
16056
16058
|
this.engine = resolved ? new EnginePieces(THREE, resolved.loop.world, {
|
|
16057
16059
|
groundAt: o.terrainAt ?? o.groundAt,
|
|
16058
16060
|
...o.terrainRollingAt ? { groundRollingAt: o.terrainRollingAt } : {},
|
|
16061
|
+
...o.terrainRollingDampingAt ? { groundRollingDampingAt: o.terrainRollingDampingAt } : {},
|
|
16059
16062
|
...o.terrainRangeAt ? { groundRange: o.terrainRangeAt } : {},
|
|
16060
16063
|
// the grid stands for `terrainAt` alone: without it the tiles read `groundAt`, which the grid may not be (a lot flattened, a slab)
|
|
16061
16064
|
...o.terrainGridAt && o.terrainAt ? { groundGrid: o.terrainGridAt } : {},
|