fix(map): add world plane collision and respawn

This commit is contained in:
Tom Boullay
2026-05-26 23:52:12 +02:00
parent 0696ca2ae3
commit 665d9f9702
13 changed files with 159 additions and 60 deletions
+2
View File
@@ -10,6 +10,8 @@ export const PLAYER_GRAVITY = 30;
export const PLAYER_MAX_DELTA = 0.05;
export const PLAYER_ACCELERATION_MULTIPLIER = 9;
export const PLAYER_XZ_DAMPING_FACTOR = 8;
export const PLAYER_FALL_RESPAWN_Y = -20;
export const PLAYER_FALL_RESPAWN_DELAY = 3;
export const PLAYER_SPAWN_POSITION_GAME: Vector3Tuple = [0, 50, 0];
export const PLAYER_SPAWN_POSITION_PHYSICS: Vector3Tuple = [0, 3, 0];
-10
View File
@@ -1,10 +0,0 @@
import type { Vector3Tuple } from "@/types/three/three";
export const TERRAIN_BOUNDARY_CONFIG = {
enabled: true,
center: [-10, 8, -2] as Vector3Tuple,
radius: 135,
height: 28,
thickness: 3,
segments: 48,
};
+2 -2
View File
@@ -35,8 +35,8 @@ export const WATER_SHADER_CONFIG = {
export const WATER_STREAMING_CONFIG = {
enabled: true,
loadDistance: 40,
unloadDistance: 35,
updateInterval: 250,
unloadDistance: 48,
updateInterval: 350,
};
export const WATER_SURFACES: WaterSurfaceConfig[] = [
+13
View File
@@ -0,0 +1,13 @@
import { TERRAIN_COLORS } from "@/data/world/terrainConfig";
import type { Vector3Tuple } from "@/types/three/three";
export const WORLD_BOUNDS_CONFIG = {
enabled: true,
center: [0, 0, 0] as Vector3Tuple,
planeColor: TERRAIN_COLORS.grass1.hex,
planeY: -0.04,
planeCollisionThickness: 1,
size: [270, 260] as const,
wallHeight: 28,
wallThickness: 4,
};