refactor: clean map gameplay architecture
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const HAND_TRACKING_LOCAL_WS_URL = "ws://localhost:8000/ws";
|
||||
const HAND_TRACKING_PROD_WS_URL = "wss://handtracking.la-fabrik.fr/ws";
|
||||
|
||||
export function getHandTrackingWsUrl(): string {
|
||||
const configuredUrl = import.meta.env.VITE_HAND_TRACKING_WS_URL;
|
||||
|
||||
if (configuredUrl) {
|
||||
return configuredUrl;
|
||||
}
|
||||
|
||||
return import.meta.env.DEV
|
||||
? HAND_TRACKING_LOCAL_WS_URL
|
||||
: HAND_TRACKING_PROD_WS_URL;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { MAP_INSTANCING_ASSETS } from "@/data/world/mapInstancingConfig";
|
||||
|
||||
const MAP_INSTANCED_NODE_NAMES: ReadonlySet<string> = new Set(
|
||||
Object.values(MAP_INSTANCING_ASSETS)
|
||||
.filter((config) => config.enabled)
|
||||
.map((config) => config.mapName),
|
||||
);
|
||||
|
||||
export function isInstancedMapNodeName(name: string): boolean {
|
||||
return MAP_INSTANCED_NODE_NAMES.has(name);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { MapNode } from "@/types/map/mapScene";
|
||||
import { isInstancedMapNodeName } from "@/data/world/mapInstancingConfig";
|
||||
import { isInstancedMapNodeName } from "@/utils/map/isInstancedMapNodeName";
|
||||
|
||||
const MAP_STRUCTURE_NODE_NAMES = new Set(["Scene", "blocking", "terrain"]);
|
||||
const RUNTIME_VEGETATION_NODE_NAMES = new Set([
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { WindState } from "@/data/world/windConfig";
|
||||
|
||||
export function getWindVector(wind: WindState): { x: number; z: number } {
|
||||
const intensity = wind.speed * wind.strength;
|
||||
|
||||
return {
|
||||
x: Math.cos(wind.direction) * intensity,
|
||||
z: Math.sin(wind.direction) * intensity,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user