From 5d389732d9a9196f638f4b79e366234f4f2ef9a9 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:27:56 +0900 Subject: [PATCH] Update randomBooks.ts --- packages/frontend/src/world/room/objects/randomBooks.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/world/room/objects/randomBooks.ts b/packages/frontend/src/world/room/objects/randomBooks.ts index 375a2dfe62..ddc0c14fd8 100644 --- a/packages/frontend/src/world/room/objects/randomBooks.ts +++ b/packages/frontend/src/world/room/objects/randomBooks.ts @@ -6,7 +6,7 @@ import * as BABYLON from '@babylonjs/core'; import seedrandom from 'seedrandom'; import { defineObject } from '../object.js'; -import { WORLD_SCALE } from '@/world/utility.js'; +import { cm, WORLD_SCALE } from '@/world/utility.js'; const remap = (value: number, fromMin: number, fromMax: number, toMin: number, toMax: number) => { return toMin + ((value - fromMin) / (fromMax - fromMin)) * (toMax - toMin); @@ -94,9 +94,9 @@ export const randomBooks = defineObject({ mesh.morphTargetManager!.getTargetByName('Width')!.influence = width; mesh.morphTargetManager!.getTargetByName('Height')!.influence = height; mesh.morphTargetManager!.getTargetByName('Thickness')!.influence = thickness; - const thicknessCm = 2 + remap(thickness, 0, 1, 0, 100); - const widthCm = 2 + remap(width, 0, 1, 0, 100); - const gap = 0.25; + const thicknessCm = cm(2) + remap(thickness, 0, 1, 0, cm(100)); + const widthCm = cm(2) + remap(width, 0, 1, 0, cm(100)); + const gap = cm(0.25); mesh.position.x = (accumulatedPos + (thicknessCm / 2)) / WORLD_SCALE; mesh.position.z = widthCm / 2 / WORLD_SCALE; mesh.refreshBoundingInfo();