animation, gathering, deposit, ui

This commit is contained in:
Vasyl Kazakov
2026-06-02 18:22:20 +03:00
parent 6363396f84
commit e14b97b5e7
61 changed files with 2379 additions and 539 deletions
+10 -3
View File
@@ -3,13 +3,16 @@ import { ThreeC } from "../ThreeC";
import { PhysicsBody, PhysicsLayer } from "../PhysicsC";
import { PhysicsTriggerC } from "./PhysicsTriggerC";
import { PropC } from "./PropC";
import { findDamageStateLayers } from "./PropDamageLayers";
import { resolvePropType } from "../Resources/PropDropTable";
import { InteractiveZoneC } from "./InteractiveZoneC";
const MAP_PHYSICS_LAYERS = ["Colliders", "Lootable"];
const GATHER_TRIGGER_PADDING = 0.2;
const GATHER_TRIGGER_PADDING = 0.5;
export class Map {
static Init() {
static init() {
const mapObject = ThreeC.getObject("map");
if (!mapObject) {
console.warn("Map model resource not found: map");
@@ -22,6 +25,7 @@ export class Map {
PhysicsTriggerC.init();
this.buildPhysics(mapObject);
InteractiveZoneC.init(mapObject);
}
private static buildPhysics(mapObject: Object3D) {
@@ -55,7 +59,10 @@ export class Map {
private static setupLootableObject(lootableObject: Object3D) {
const propType = resolvePropType(lootableObject.name);
const prop = new PropC(lootableObject, propType);
const damageLayers = findDamageStateLayers(lootableObject);
const maxHealth = damageLayers.length > 0 ? damageLayers.length : 1;
const prop = new PropC(lootableObject, propType, maxHealth);
prop.initDamageLayers(damageLayers);
const colliderMesh = this.findMesh(lootableObject, (name) => name.includes("collider"));
const visualMeshes = this.getVisualMeshes(lootableObject);