refacto: enleve la map

This commit is contained in:
2026-04-16 16:11:20 +02:00
parent 1eed905e8b
commit b26da614f0
10 changed files with 66 additions and 111 deletions
+1 -12
View File
@@ -1,25 +1,14 @@
import { useEffect } from "react";
import { PointerLockControls } from "@react-three/drei";
import { useThree } from "@react-three/fiber";
import * as THREE from "three";
export const PLAYER_EYE_HEIGHT = 1.75;
const PLAYER_SPAWN_POSITION = new THREE.Vector3(0, PLAYER_EYE_HEIGHT, 6);
const PLAYER_LOOK_AT = new THREE.Vector3(0, PLAYER_EYE_HEIGHT, 0);
export function PlayerCamera(): React.JSX.Element {
const camera = useThree((state) => state.camera);
useEffect(() => {
camera.position.copy(PLAYER_SPAWN_POSITION);
camera.lookAt(PLAYER_LOOK_AT);
camera.updateProjectionMatrix();
return () => {
document.exitPointerLock?.();
};
}, [camera]);
}, []);
return <PointerLockControls />;
}