@adatechnology/game-destruction-three 0.15.0 → 0.15.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.js CHANGED
@@ -2480,7 +2480,6 @@ var Visuals = class {
2480
2480
  var rendererCount = 0;
2481
2481
  var COLLAPSE_CLOUD_KG = 1e3;
2482
2482
  var CHIP_DECAL_EDGE = 0.05;
2483
- var OPAQUE_CRACK = 0.1;
2484
2483
  var WOOD_RIM = 1.5;
2485
2484
  var IMPACT_TAGS = ["metal", "glass", "wood"];
2486
2485
  var GLOW_FROM_C = 430;
@@ -3416,14 +3415,11 @@ var Renderer = class {
3416
3415
  const pv = b?.parts.get(ev.part);
3417
3416
  if (!b || !pv) return;
3418
3417
  const def = this.world.materials.get(pv.material);
3419
- const wp = new this.THREE.Vector3(ev.worldPoint[0], ev.worldPoint[1], ev.worldPoint[2]);
3420
- const mv = this.nearestMesh(pv, wp);
3421
- if (mv) {
3422
- const glass2 = !!def?.visual?.transparent;
3423
- const own = this.partColor(pv, def) ?? fallbackColor(pv.material, def);
3424
- const color = glass2 ? 15267071 : new this.THREE.Color(own).multiplyScalar(0.45).getHex();
3425
- const length = glass2 ? ev.crack.length : Math.min(ev.crack.length, OPAQUE_CRACK);
3426
- this.visuals.addCrack(mv, wp, this.worldDir(b, ev.crack.normal), ev.crack.rays, length, color, hashNumbers(ev.time, ev.worldPoint[0], ev.worldPoint[1], ev.worldPoint[2]));
3418
+ if (def?.visual?.transparent) {
3419
+ const wp = new this.THREE.Vector3(ev.worldPoint[0], ev.worldPoint[1], ev.worldPoint[2]);
3420
+ const mv = this.nearestMesh(pv, wp);
3421
+ const seed = hashNumbers(ev.time, ev.worldPoint[0], ev.worldPoint[1], ev.worldPoint[2]);
3422
+ if (mv) this.visuals.addCrack(mv, wp, this.worldDir(b, ev.crack.normal), ev.crack.rays, ev.crack.length, 15267071, seed);
3427
3423
  }
3428
3424
  this.impactSound(pv.material, ev.worldPoint, 0.5, ev.blow);
3429
3425
  }