@adatechnology/game-destruction 0.8.0 → 0.8.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 +3 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3897,13 +3897,14 @@ var createDestruction = (options = {}) => {
|
|
|
3897
3897
|
const crackLen = clamp2(0.03 + ratio * 0.2, 0.03, 0.8);
|
|
3898
3898
|
let exitPoint;
|
|
3899
3899
|
if (penetrated) {
|
|
3900
|
-
|
|
3900
|
+
const exitDist = p.spec.contains || p.spec.fill !== void 0 && p.spec.fill < 0.5 || p.thickness < pathLen * 0.5 ? pathLen : Math.min(pathLen, effM + layersThickness(p.layers, face) / slant + layersThickness(p.layers, -face) / slant);
|
|
3901
|
+
exitPoint = vec.madd(entry, d, exitDist);
|
|
3901
3902
|
const hole = addHole(o, p, entry, n, caliber / 1e3 * (mat.ductility >= 0.3 ? 1 : 1.5), true, exitPoint, src);
|
|
3902
3903
|
if (p.layers.length > 0) spallOuter(o, p, exitPoint, -face, vec.scale(n, -1), Math.max(0.03, caliber / 1e3 * 4), src);
|
|
3903
3904
|
addBreach(o, p, entry, Math.PI * (hole.diameter / 2) * (hole.diameter / 2), E, d, src);
|
|
3904
3905
|
if (mat.ductility >= 0.5 && p.thickness <= THIN_SHEET_DISHING) addDent(o, p, entry, n, Math.max(caliber * 3 / 1e3, 0.012), clamp2(E * 2e-5, 1e-3, 0.03), src);
|
|
3905
3906
|
if (brittle && mat.fracture === "shatter") addCrack(o, p, entry, n, crackLen, src);
|
|
3906
|
-
if (p.spec.contains && (p.st.liters ?? 0) >
|
|
3907
|
+
if (p.spec.contains && (p.st.liters ?? 0) > 1e-4) {
|
|
3907
3908
|
emit({
|
|
3908
3909
|
...base(o, src),
|
|
3909
3910
|
type: "leak",
|