update : put every constante in the data folder

This commit is contained in:
Tom Boullay
2026-04-17 15:42:10 +02:00
parent 4b14295749
commit 7e72f1e803
21 changed files with 570 additions and 209 deletions
+7 -2
View File
@@ -1,6 +1,11 @@
import { useEffect } from "react";
import { useThree } from "@react-three/fiber";
import type { Octree } from "three/addons/math/Octree.js";
import {
PLAYER_SPAWN_X,
PLAYER_SPAWN_Y_DEFAULT,
PLAYER_SPAWN_Z,
} from "@/data/playerConfig";
import { PlayerCamera } from "@/world/player/PlayerCamera";
import { PlayerController } from "@/world/player/PlayerController";
@@ -11,12 +16,12 @@ interface PlayerComponentProps {
export function PlayerComponent({
octree = null,
spawnY = 100,
spawnY = PLAYER_SPAWN_Y_DEFAULT,
}: PlayerComponentProps): React.JSX.Element {
const camera = useThree((state) => state.camera);
useEffect(() => {
camera.position.set(0, spawnY, 0);
camera.position.set(PLAYER_SPAWN_X, spawnY, PLAYER_SPAWN_Z);
}, [camera, spawnY]);
return (