1
0

feat: build deterministic freeway and Lumbridge EV v2

This commit is contained in:
2026-08-19 01:12:47 -07:00
parent 94de2d8bee
commit ddf814a657
15 changed files with 716 additions and 24 deletions
+16
View File
@@ -3,8 +3,10 @@ import { describe, it } from "node:test";
import * as THREE from "three";
import {
MODEL_X_METRICS,
LUMBRIDGE_EV_METRICS,
advanceModelXWheels,
buildModelX,
buildLumbridgeEV,
cloneModelX,
disposeModelX,
modelXInstanceParts,
@@ -21,6 +23,20 @@ function meshes(root: THREE.Object3D): THREE.Mesh[] {
}
describe("procedural Model X vehicle asset", () => {
it("publishes the original unbranded Lumbridge EV identity at both LODs", () => {
const follow = buildLumbridgeEV({ detail: "follow" });
const corridor = buildLumbridgeEV({ detail: "corridor" });
assert.equal(LUMBRIDGE_EV_METRICS, MODEL_X_METRICS);
assert.equal(follow.root.userData.design, "lumbridge-ev-01");
assert.equal(follow.root.userData.unbranded, true);
assert.equal(follow.root.userData.lod, "follow");
assert.equal(corridor.root.userData.lod, "corridor");
const followVertices = meshes(follow.root).reduce((sum, mesh) => sum + mesh.geometry.getAttribute("position").count, 0);
const corridorVertices = meshes(corridor.root).reduce((sum, mesh) => sum + mesh.geometry.getAttribute("position").count, 0);
assert.ok(followVertices > corridorVertices, "follow LOD includes a readable interior and denser wheels");
disposeModelX(follow);
disposeModelX(corridor);
});
it("has a metre-scale crossover silhouette and faces -Z", () => {
const rig = buildModelX({ detail: "corridor" });
const size = new THREE.Box3().setFromObject(rig.root).getSize(new THREE.Vector3());