edit electricienne + poto

This commit is contained in:
math-pixel
2026-06-03 00:05:07 +02:00
parent 0a3966a339
commit 18fb5e39e9
8 changed files with 96 additions and 31 deletions
+1 -1
View File
@@ -264,7 +264,7 @@ export function TestMap({ onOctreeReady }: TestMapProps): React.JSX.Element {
</mesh>
*/}
{/* GPS Map screen plane */}
<group position={[0, 0, 0.06]}>
<group position={[0, -8, 0.06]}>
<EbikeGPSMap
width={4}
height={4}
@@ -20,6 +20,7 @@ import {
isMapModelVisible,
useMapPerformanceStore,
} from "@/managers/stores/useMapPerformanceStore";
import { useGameStore } from "@/managers/stores/useGameStore";
import { InstancedMapAsset } from "@/world/map-instancing/InstancedMapAsset";
import {
MAP_INSTANCING_ASSETS,
@@ -27,6 +28,8 @@ import {
type MapInstancingAssetConfig,
type MapInstancingAssetType,
} from "@/data/world/mapInstancingConfig";
import { REPAIR_MISSION_ANCHOR_IDS } from "@/data/gameplay/repairMissionAnchors";
import { isRepairGameStep } from "@/types/gameplay/repairMission";
import { useMapInstancingData } from "@/hooks/world/useMapInstancingData";
import type { MapAssetInstance } from "@/types/map/mapScene";
import type { GraphicsPreset } from "@/data/world/graphicsConfig";
@@ -146,6 +149,8 @@ export function MapInstancingSystem({
const groups = useMapPerformanceStore((state) => state.groups);
const models = useMapPerformanceStore((state) => state.models);
const { data, isLoading } = useMapInstancingData();
const mainState = useGameStore((state) => state.mainState);
const pylonStep = useGameStore((state) => state.pylon.currentStep);
const streamingEnabled =
streaming &&
CHUNK_CONFIG.enabled &&
@@ -153,6 +158,15 @@ export function MapInstancingSystem({
sceneMode === "game" &&
cameraMode === "player";
// During the pylon narrative phase (before the pylon is raised), hide the
// repair:pylon instanced mesh so the PylonDownedPylon component takes its place.
// Once the pylon is raised (repair-game steps), restore it so the normal model
// appears upright in the world while the repair mini-game runs.
const hidePylonAnchorId =
mainState === "pylon" && !isRepairGameStep(pylonStep)
? REPAIR_MISSION_ANCHOR_IDS.pylon
: undefined;
const chunks = useMemo(() => {
if (!data) return [];
@@ -168,12 +182,18 @@ export function MapInstancingSystem({
return [];
}
const instances = data.get(type);
let instances = data.get(type);
if (!instances || instances.length === 0) return [];
// Filter out the repair-mission pylon instance during the narrative phase
if (hidePylonAnchorId && config.mapName === "pylone") {
instances = instances.filter((inst) => inst.id !== hidePylonAnchorId);
if (instances.length === 0) return [];
}
return createMapAssetChunks(type, config, instances);
});
}, [data, groups, models, onlyMapName]);
}, [data, groups, models, onlyMapName, hidePylonAnchorId]);
const visibleChunks = useVisibleWorldChunks(chunks, streamingEnabled, {
loadRadius: graphicsPresetConfig.chunkLoadRadius,