@adatechnology/game-vehicles-three 0.3.2 → 0.3.3
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 +22 -15
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -15
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -303,6 +303,7 @@ function markDamageables(c, damageables) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
// src/test-area/module.ts
|
|
306
|
+
import { footprintBlocker } from "@adatechnology/game-contracts";
|
|
306
307
|
import { buildVehicleItem, createVehicleDestructible, createVehicleKit } from "@adatechnology/game-vehicles";
|
|
307
308
|
import { createArcadeDriver as createArcadeDriver2, createSemiSimDriver as createSemiSimDriver2, createSurfaces as createSurfaces2, vehicleCorners as vehicleCorners2 } from "@adatechnology/game-vehicles-driving";
|
|
308
309
|
import { colorFromSeed as colorFromSeed2, fleetDims as fleetDims2, installFleet, paintPalettes as paintPalettes2, paletteOf as paletteOf2 } from "@adatechnology/game-vehicles-fleet";
|
|
@@ -924,22 +925,13 @@ function createVehiclesTestModule(options = {}) {
|
|
|
924
925
|
}
|
|
925
926
|
helpersShown = boxKey();
|
|
926
927
|
};
|
|
927
|
-
const
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
local.v ?? (local.v = new three.Vector3());
|
|
932
|
-
root.updateWorldMatrix(true, false);
|
|
933
|
-
const p = local.v.set(x, 0, z).applyMatrix4(local.m.copy(root.matrixWorld).invert());
|
|
934
|
-
return p.x > fp.minX - radius && p.x < fp.maxX + radius && p.z > fp.minZ - radius && p.z < fp.maxZ + radius;
|
|
935
|
-
};
|
|
928
|
+
const laneBlocked = footprintBlocker(
|
|
929
|
+
() => lane?.group,
|
|
930
|
+
() => lane ? { minX: -lane.car.width / 2, maxX: lane.car.width / 2, minZ: -lane.car.length / 2, maxZ: lane.car.length / 2 } : null
|
|
931
|
+
);
|
|
936
932
|
const blocked = (x, z, radius) => {
|
|
937
|
-
for (const entry of placed.values()) if (entry.
|
|
938
|
-
|
|
939
|
-
const half = { l: lane.car.length / 2, w: lane.car.width / 2 };
|
|
940
|
-
if (inside(lane.group, { minX: -half.w, maxX: half.w, minZ: -half.l, maxZ: half.l }, x, z, radius)) return true;
|
|
941
|
-
}
|
|
942
|
-
return false;
|
|
933
|
+
for (const entry of placed.values()) if (entry.footprint && footprintBlocker(entry.root, entry.footprint)(x, z, radius)) return true;
|
|
934
|
+
return laneBlocked(x, z, radius);
|
|
943
935
|
};
|
|
944
936
|
const clearLane = () => {
|
|
945
937
|
stopEngine();
|