update: add a physic scenne

This commit is contained in:
Tom Boullay
2026-04-17 10:48:18 +02:00
parent 1d4f223c35
commit 5111f2e558
22 changed files with 2050 additions and 216 deletions
+11 -1
View File
@@ -1,8 +1,11 @@
import { Physics, RigidBody, CuboidCollider } from "@react-three/rapier";
import { useCameraMode } from "@/hooks/debug/useCameraMode";
import { DebugCameraControls } from "@/utils/debug/scene/DebugCameraControls";
import { DebugHelpers } from "@/utils/debug/scene/DebugHelpers";
import { Environment } from "@/world/Environment";
import { Lighting } from "@/world/Lighting";
import { GrabCube } from "@/world/objects/GrabCube";
import { TriggerSphere } from "@/world/objects/TriggerSphere";
import { PlayerComponent } from "@/world/player/PlayerComponent";
export function World(): React.JSX.Element {
@@ -14,7 +17,14 @@ export function World(): React.JSX.Element {
<Lighting />
<DebugHelpers />
{cameraMode === "debug" ? <DebugCameraControls /> : null}
{cameraMode === "debug" ? null : <PlayerComponent />}
<Physics>
<RigidBody type="fixed">
<CuboidCollider args={[50, 0.1, 50]} position={[0, -0.1, 0]} />
</RigidBody>
<GrabCube />
<TriggerSphere />
{cameraMode === "debug" ? null : <PlayerComponent />}
</Physics>
</>
);
}