fixed bug for platfrom

This commit is contained in:
Vasyl Kazakov
2026-06-19 11:56:35 +03:00
parent ce3f254bc1
commit f922fd53ae
4 changed files with 14 additions and 4965 deletions
-2
View File
@@ -38,7 +38,6 @@ export const globalSettings: ConfigUiParamsCategories[] = [
name: "Camera position (portrait)", name: "Camera position (portrait)",
type: "float", type: "float",
array: true, array: true,
visible: "position",
values: [ values: [
[ [
-10, -10,
@@ -96,7 +95,6 @@ export const globalSettings: ConfigUiParamsCategories[] = [
name: "Camera position (landscape)", name: "Camera position (landscape)",
type: "float", type: "float",
array: true, array: true,
visible: "position",
values: [ values: [
[ [
-10, -10,
+12 -3
View File
@@ -40,14 +40,17 @@ export class FollowCameraC {
this.mainContainer.position.x += this.Offset.x; this.mainContainer.position.x += this.Offset.x;
this.mainContainer.position.z += this.Offset.z; this.mainContainer.position.z += this.Offset.z;
this.cameraContainer.position.y += this.Offset.y; this.cameraContainer.position.y = this.Offset.y;
} }
private static update(delta: number) { private static update(delta: number) {
if (!this.target.position) return; if (!this.target.position) return;
this.lookAheadTarget.copy(this.inputDirection).multiplyScalar(this.lookAheadAmount); this.lookAheadTarget.copy(this.inputDirection).multiplyScalar(this.lookAheadAmount);
this.lookAheadCurrent.lerp(this.lookAheadTarget, delta * this.lookAheadLerpSpeed); this.lookAheadCurrent.lerp(
this.lookAheadTarget,
Math.min(delta * this.lookAheadLerpSpeed, 1),
);
const offset = this.Offset; const offset = this.Offset;
@@ -55,6 +58,8 @@ export class FollowCameraC {
this.basePos.x += offset.x; this.basePos.x += offset.x;
this.basePos.z += offset.z; this.basePos.z += offset.z;
this.cameraContainer.position.y = offset.y;
this.targetPos.copy(this.basePos); this.targetPos.copy(this.basePos);
this.targetPos.x += this.lookAheadCurrent.x; this.targetPos.x += this.lookAheadCurrent.x;
this.targetPos.z += this.lookAheadCurrent.z; this.targetPos.z += this.lookAheadCurrent.z;
@@ -66,7 +71,11 @@ export class FollowCameraC {
this.cameraContainer.lookAt(this.target.position); this.cameraContainer.lookAt(this.target.position);
const lerpSpeed = 10; const lerpSpeed = 10;
this.mainContainer.position.lerpVectors(this.oldPos, this.targetPos, delta * lerpSpeed); this.mainContainer.position.lerpVectors(
this.oldPos,
this.targetPos,
Math.min(delta * lerpSpeed, 1),
);
} }
static get RotationCorrection() { static get RotationCorrection() {
+2 -11
View File
@@ -10,7 +10,7 @@ import { InteractiveZoneC } from "./InteractiveZoneC";
import { ToolZoneC } from "./ToolZoneC"; import { ToolZoneC } from "./ToolZoneC";
const MAP_PHYSICS_LAYERS = ["Colliders", "Lootable"]; const MAP_PHYSICS_LAYERS = ["Colliders", "Lootable"];
const GATHER_TRIGGER_PADDING = 0.5; const GATHER_TRIGGER_PADDING = 0.15;
export class Map { export class Map {
static init() { static init() {
@@ -48,8 +48,8 @@ export class Map {
} }
if (layerName === "Colliders") { if (layerName === "Colliders") {
// Floor-only layer (BoxCollider): hide in scene, no physics needed.
layer.visible = false; layer.visible = false;
this.addWallPhysics(layer);
continue; continue;
} }
@@ -59,15 +59,6 @@ export class Map {
} }
} }
private static addWallPhysics(root: Object3D) {
root.traverse((child) => {
if (child === root) return;
if ((child as Mesh).isMesh) {
new PhysicsBody(child, false, 0, PhysicsLayer.Wall, PhysicsLayer.Player);
}
});
}
private static setupLootableObject(lootableObject: Object3D) { private static setupLootableObject(lootableObject: Object3D) {
const propType = resolvePropType(lootableObject.name); const propType = resolvePropType(lootableObject.name);
const damageLayers = findDamageStateLayers(lootableObject); const damageLayers = findDamageStateLayers(lootableObject);
-4949
View File
File diff suppressed because one or more lines are too long