feat: ajoute les potagers à la map

This commit is contained in:
tom-boullay
2026-05-28 15:48:33 +02:00
parent 9bbed06ddc
commit 0b3d49e8d1
12 changed files with 283 additions and 58 deletions
+3
View File
@@ -15,6 +15,7 @@ export type MapPerformanceModelName =
| "champdeble"
| "champdesoja"
| "champsdetournesol"
| "potager"
| "ecole"
| "generateur"
| "fermeverticale"
@@ -50,6 +51,7 @@ export const MAP_PERFORMANCE_MODEL_NAMES: readonly MapPerformanceModelName[] = [
"champdeble",
"champdesoja",
"champsdetournesol",
"potager",
"ecole",
"generateur",
"fermeverticale",
@@ -78,6 +80,7 @@ export const MAP_PERFORMANCE_MODEL_GROUPS: Record<
champdeble: ["vegetation", "crops"],
champdesoja: ["vegetation", "crops"],
champsdetournesol: ["vegetation", "crops"],
potager: ["vegetation", "crops"],
ecole: ["buildings", "landmarks"],
generateur: ["landmarks"],
fermeverticale: ["buildings", "landmarks"],
+1 -9
View File
@@ -1,15 +1,9 @@
import type {
TerrainSurfaceColorConfig,
TerrainSurfaceProjectionConfig,
} from "@/types/world/terrainSurface";
import type { TerrainSurfaceColorConfig } from "@/types/world/terrainSurface";
export const TERRAIN_MODEL_PATH = "/models/terrain/model.gltf";
export const TERRAIN_WATER_HEIGHT = 0.8;
export const TERRAIN_TILE_SIZE = 1;
export const TERRAIN_SURFACE_COLOR_TOLERANCE = 5;
export const TERRAIN_SURFACE_PROJECTION =
{} satisfies TerrainSurfaceProjectionConfig;
export const TERRAIN_COLORS = {
grass1: {
@@ -60,5 +54,3 @@ export const TERRAIN_COLORS = {
kind: "rock",
},
} satisfies Record<string, TerrainSurfaceColorConfig>;
export type TerrainColorKey = keyof typeof TERRAIN_COLORS;
+30 -6
View File
@@ -5,7 +5,8 @@ export const VEGETATION_TYPES = {
scaleMultiplier: 1.5,
castShadow: true,
receiveShadow: true,
windStrength: 0.08,
windStrength: 0.06,
rotationOffset: [0, 0, 0],
enabled: true,
},
sapin: {
@@ -14,7 +15,8 @@ export const VEGETATION_TYPES = {
scaleMultiplier: 4,
castShadow: true,
receiveShadow: true,
windStrength: 0.04,
windStrength: 0.12,
rotationOffset: [0, 0, 0],
enabled: true,
},
arbre: {
@@ -23,7 +25,8 @@ export const VEGETATION_TYPES = {
scaleMultiplier: 1,
castShadow: true,
receiveShadow: true,
windStrength: 0.06,
windStrength: 0.15,
rotationOffset: [0, 0, 0],
enabled: true,
},
champdeble: {
@@ -32,7 +35,8 @@ export const VEGETATION_TYPES = {
scaleMultiplier: 1,
castShadow: true,
receiveShadow: true,
windStrength: 0.18,
windStrength: 0.15,
rotationOffset: [0, 0, 0],
enabled: true,
},
champdesoja: {
@@ -41,7 +45,8 @@ export const VEGETATION_TYPES = {
scaleMultiplier: 1,
castShadow: true,
receiveShadow: true,
windStrength: 0.16,
windStrength: 0.15,
rotationOffset: [0, 0, 0],
enabled: true,
},
champsdetournesol: {
@@ -50,7 +55,18 @@ export const VEGETATION_TYPES = {
scaleMultiplier: 1,
castShadow: true,
receiveShadow: true,
windStrength: 0.14,
windStrength: 0.15,
rotationOffset: [0, 0, 0],
enabled: true,
},
potager: {
mapName: "potager",
modelPath: "/models/potager/potager.gltf",
scaleMultiplier: 1,
castShadow: true,
receiveShadow: true,
windStrength: 0,
rotationOffset: [0, 0, 0],
enabled: true,
},
} as const;
@@ -62,10 +78,18 @@ export const VEGETATION_TYPE_KEYS = [
"champdeble",
"champdesoja",
"champsdetournesol",
"potager",
] as const satisfies readonly (keyof typeof VEGETATION_TYPES)[];
export type VegetationType = (typeof VEGETATION_TYPE_KEYS)[number];
export function getVegetationModelScaleMultiplier(name: string): number {
return (
Object.values(VEGETATION_TYPES).find((config) => config.mapName === name)
?.scaleMultiplier ?? 1
);
}
export const INSTANCED_MAP_EXCEPTIONS = new Set([
"Scene",
"blocking",