diff --git a/app/src/components/Warehouse3D.tsx b/app/src/components/Warehouse3D.tsx index d3e707d..22ea0d2 100644 --- a/app/src/components/Warehouse3D.tsx +++ b/app/src/components/Warehouse3D.tsx @@ -78,13 +78,13 @@ function WindDirectionIndicator({ angle, width, length, height }: { angle: numbe const isDark = useCanvasTheme() === 'dark'; const color = isDark ? "#38bdf8" : "#0284c7"; // Light blue / dark blue - // Angle 0: Wind blows along Z axis, from negative Z towards origin (hitting Wall A at Z=-length/2) - // Angle 90: Wind blows along X axis, from negative X towards origin (hitting Wall C at X=-width/2) + // Angle 0: Wind blows along X axis, from negative X towards origin (hitting Wall C at X=-width/2) + // Angle 90: Wind blows along Z axis, from negative Z towards origin (hitting Wall A at Z=-length/2) - const dir = angle === 0 ? new THREE.Vector3(0, 0, 1) : new THREE.Vector3(1, 0, 0); + const dir = angle === 90 ? new THREE.Vector3(0, 0, 1) : new THREE.Vector3(1, 0, 0); const distance = Math.max(width, length) * 0.6 + 5; - const startPos = angle === 0 ? new THREE.Vector3(0, height / 2, -distance) : new THREE.Vector3(-distance, height / 2, 0); + const startPos = angle === 90 ? new THREE.Vector3(0, height / 2, -distance) : new THREE.Vector3(-distance, height / 2, 0); const quat = new THREE.Quaternion(); quat.setFromUnitVectors(new THREE.Vector3(0, 1, 0), dir); @@ -116,13 +116,13 @@ function hasOpening(wall: 'A' | 'B' | 'C' | 'D', permCase: string, windAngle: nu if (permCase === 'four-equally-permeable') return true; if (permCase === 'two-opposite-permeable') return wall === 'A' || wall === 'B'; if (permCase === 'dominant-windward') { - return windAngle === 0 ? wall === 'A' : wall === 'C'; + return windAngle === 0 ? wall === 'C' : wall === 'A'; } if (permCase === 'dominant-leeward') { - return windAngle === 0 ? wall === 'B' : wall === 'D'; + return windAngle === 0 ? wall === 'D' : wall === 'B'; } if (permCase === 'dominant-lateral') { - return windAngle === 0 ? wall === 'C' : wall === 'A'; + return windAngle === 0 ? (wall === 'A' || wall === 'B') : (wall === 'C' || wall === 'D'); } return false; } @@ -187,15 +187,15 @@ export function WarehouseModel() { - + - + - + - + {hasOpening('C', permeabilityCase, windAngle) && ( @@ -209,15 +209,15 @@ export function WarehouseModel() { - + - + - + - + {hasOpening('D', permeabilityCase, windAngle) && ( @@ -231,15 +231,15 @@ export function WarehouseModel() { - + - + - + - + {hasOpening('A', permeabilityCase, windAngle) && ( @@ -253,15 +253,15 @@ export function WarehouseModel() { - + - + - + - + {hasOpening('B', permeabilityCase, windAngle) && ( @@ -643,7 +643,7 @@ export function WarehouseModel() { anchorX="center" anchorY="middle" > - {isParallel ? 'Parede B (Sotavento)' : 'Parede C (Barlavento)'} + {isParallel ? 'Parede B (Sotavento)' : 'Parede B (Lateral)'} {/* Rótulo Parede Traseira */} @@ -658,7 +658,7 @@ export function WarehouseModel() { anchorX="center" anchorY="middle" > - {isParallel ? 'Parede A (Barlavento)' : 'Parede D (Sotavento)'} + {isParallel ? 'Parede A (Barlavento)' : 'Parede A (Lateral)'} {/* Rótulo Parede Esquerda */} @@ -673,7 +673,7 @@ export function WarehouseModel() { anchorX="center" anchorY="middle" > - {isParallel ? 'Parede C (Lateral)' : 'Parede A (Lateral)'} + {isParallel ? 'Parede C (Lateral)' : 'Parede C (Barlavento)'} {/* Rótulo Parede Direita */} @@ -688,7 +688,7 @@ export function WarehouseModel() { anchorX="center" anchorY="middle" > - {isParallel ? 'Parede D (Lateral)' : 'Parede B (Lateral)'} + {isParallel ? 'Parede D (Lateral)' : 'Parede D (Sotavento)'} )}