Implement ULTRACAT
This commit is contained in:
parent
e320f15ff9
commit
142164edd4
3 changed files with 27 additions and 2 deletions
|
|
@ -73,7 +73,9 @@ export function renderDashboard(root: HTMLElement): () => void {
|
|||
}
|
||||
}
|
||||
try {
|
||||
const complex = await buildLaunchComplex(hasRocket ? rocketH : 18);
|
||||
const complex = await buildLaunchComplex(hasRocket ? rocketH : 18, {
|
||||
includeMascot: hasRocket,
|
||||
});
|
||||
if (disposed) return;
|
||||
view.scene.add(complex);
|
||||
} catch {}
|
||||
|
|
|
|||
|
|
@ -369,6 +369,7 @@ export async function buildRocketMesh(
|
|||
|
||||
export async function buildLaunchComplex(
|
||||
rocketHeight = 50,
|
||||
opts: { includeMascot?: boolean } = {},
|
||||
): Promise<THREE.Group> {
|
||||
const complex = new THREE.Group();
|
||||
const padMesh = new THREE.Mesh(
|
||||
|
|
@ -428,6 +429,28 @@ export async function buildLaunchComplex(
|
|||
);
|
||||
vab.position.set(-110, -2, -130);
|
||||
complex.add(vab);
|
||||
if (opts.includeMascot) {
|
||||
complex.updateMatrixWorld(true);
|
||||
const vabBounds = new THREE.Box3().setFromObject(vab);
|
||||
if (!vabBounds.isEmpty()) {
|
||||
try {
|
||||
const ultracat = await loadFittedModel(
|
||||
encodeModelPath("cat_3d_model_free.glb"),
|
||||
{
|
||||
height: 6.5,
|
||||
anchorBottom: true,
|
||||
},
|
||||
);
|
||||
ultracat.name = "ultracat";
|
||||
ultracat.position.set(
|
||||
(vabBounds.min.x + vabBounds.max.x) / 2,
|
||||
vabBounds.max.y,
|
||||
(vabBounds.min.z + vabBounds.max.z) / 2,
|
||||
);
|
||||
complex.add(ultracat);
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
return complex;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function showTooltipFor(anchor: HTMLElement): void {
|
|||
tip.append(
|
||||
h("div", { class: "hud-tooltip-cat" }, entry.category),
|
||||
h("div", { class: "hud-tooltip-title" }, entry.title),
|
||||
h("div", { class: "hud-tooltip-body" }, entry.summary),
|
||||
h("div", { class: "hud-tooltip-body" }, entry.summary + " -- Your favorite coach, ULTRACAT"),
|
||||
);
|
||||
if (entry.formula) {
|
||||
tip.appendChild(h("div", { class: "hud-tooltip-formula" }, entry.formula));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue