diff --git a/packages/client/src/scene/scene.ts b/packages/client/src/scene/scene.ts index dfcd520..7b3ce3b 100644 --- a/packages/client/src/scene/scene.ts +++ b/packages/client/src/scene/scene.ts @@ -11,7 +11,7 @@ import { } from "@babylonjs/core"; import HavokPhysics from "@babylonjs/havok"; -import { addBox, addColors, addVehicle } from "../utils"; +import { addColors, addVehicle } from "../utils"; import type { Engine } from "@babylonjs/core"; import type { GameConfig, GameObject } from "@neu5/types/src"; @@ -165,7 +165,6 @@ const startRace = async ({ scene ); - // const sphere = addSphere({ diameter: 2, shadowGenerator }); const sphere = MeshBuilder.CreateSphere( "sphere", { diameter: 4, segments: 32 }, diff --git a/packages/client/src/utils/index.ts b/packages/client/src/utils/index.ts index 2b11ed2..7c8b94c 100644 --- a/packages/client/src/utils/index.ts +++ b/packages/client/src/utils/index.ts @@ -70,32 +70,6 @@ const getName = (name: string) => { return `${name}_${meshCounter}`; }; -const addPlane = ({ - name = "plane", - width = 100, - height = 100, - scene, -}: { - name?: string; - width?: number; - height?: number; - scene: Scene; -}) => { - // Graphics - const plane = MeshBuilder.CreatePlane( - getName(name), - { - width, - height, - }, - scene - ); - plane.rotation = new Vector3(Math.PI / 2, 0, 0); - plane.receiveShadows = true; - - return plane; -}; - const addBox = ({ width, height, @@ -145,24 +119,6 @@ const addBox = ({ return box; }; -const addSphere = ({ - diameter, - name = "sphere", - shadowGenerator, -}: { - name?: string; - diameter: number; - shadowGenerator: ShadowGenerator; -}) => { - // Graphics - const sphere = MeshBuilder.CreateSphere(getName(name)); - sphere.scalingDeterminant = diameter * 2; - sphere.rotationQuaternion = sphere.rotationQuaternion || new Quaternion(); - shadowGenerator.addShadowCaster(sphere, true); - - return sphere; -}; - const addVehicle = ({ // colorName, scene, @@ -172,11 +128,6 @@ const addVehicle = ({ scene: Scene; shadowGenerator: ShadowGenerator; }) => { - // const car = addSphere({ - // diameter: 2, - // shadowGenerator, - // }); - // car.material = scene.getMaterialByName(colorName); const chassisMesh = MeshBuilder.CreateBox("Chassis", { @@ -317,49 +268,6 @@ const addVehicle = ({ return vehicle; }; -const addRigidVehicle = ({ - colorName, - scene, - shadowGenerator, -}: { - colorName: string; - scene: Scene; - shadowGenerator: ShadowGenerator; -}) => { - const carChassisSize = { - width: 4, - height: 0.5, - depth: 2, - }; - const carWheelSize = 0.8; - - const carBody = addBox({ - width: carChassisSize.width, - height: carChassisSize.height, - depth: carChassisSize.depth, - shadowGenerator, - }); - - carBody.material = scene.getMaterialByName(colorName); - - let wheels = []; - - // wheels - for (let idx = 0; idx < 4; idx++) { - const wheel = addSphere({ - diameter: carWheelSize, - shadowGenerator, - }); - wheel.material = scene.getMaterialByName(COLOR_NAMES.BLACK); - wheels.push(wheel); - } - - return { - body: carBody, - wheels, - }; -}; - const TOAST_COLORS = { RED: "linear-gradient(to right, rgb(255, 95, 109), rgb(255, 195, 113))", }; @@ -409,9 +317,6 @@ const toggleStartRaceBtns = ( export { addBox, addColors, - addPlane, - addSphere, - addRigidVehicle, addVehicle, debounce, log,