update : put every constante in the data folder

This commit is contained in:
2026-04-17 15:42:10 +02:00
parent 20fbaf05e1
commit 638022339e
21 changed files with 570 additions and 209 deletions
+24 -2
View File
@@ -1,3 +1,25 @@
export function Environment(): React.JSX.Element {
return <color attach="background" args={["#0b1018"]} />;
import * as THREE from "three";
import { useLoader } from "@react-three/fiber";
import {
PHYSICS_SCENE_BACKGROUND_COLOR,
SKYBOX_FACES,
} from "@/data/environmentConfig";
import { useSceneMode } from "@/hooks/debug/useSceneMode";
function SkyBox(): React.JSX.Element {
const texture = useLoader(THREE.CubeTextureLoader, [...SKYBOX_FACES]);
return <primitive attach="background" object={texture} />;
}
export function Environment(): React.JSX.Element {
const sceneMode = useSceneMode();
if (sceneMode === "physics") {
return (
<color attach="background" args={[PHYSICS_SCENE_BACKGROUND_COLOR]} />
);
}
return <SkyBox />;
}