🚀 Auto-deploy: BrainWind atualizado em 28/07/2026 11:57:50
This commit is contained in:
@@ -80,13 +80,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 (Perpendicular à largura X)
|
||||
// Angle 90: Wind blows along X axis (Paralelo à largura X)
|
||||
// Angle 0: Vento bate na Parede C (Eixo X) - Perpendicular ao comprimento
|
||||
// Angle 90: Vento bate na Parede A (Eixo Z) - Perpendicular à largura
|
||||
|
||||
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);
|
||||
|
||||
@@ -61,9 +61,9 @@ export function AirflowSystem({ windAngle, width, length, height, permeabilityCa
|
||||
if (!meshRef.current) return;
|
||||
const time = state.clock.elapsedTime;
|
||||
|
||||
// Agora 0° é paralelo à Parede A (ao longo do eixo Z)
|
||||
// E 90° é paralelo à Parede C (ao longo do eixo X)
|
||||
const isZAxis = windAngle === 0;
|
||||
// Agora 0° é paralelo à Parede A e bate na Parede C (Eixo X)
|
||||
// E 90° é paralelo à Parede C e bate na Parede A (Eixo Z)
|
||||
const isZAxis = windAngle === 90;
|
||||
const windDir = isZAxis ? new THREE.Vector3(0, 0, 1) : new THREE.Vector3(1, 0, 0);
|
||||
|
||||
const halfW = width / 2;
|
||||
@@ -98,11 +98,11 @@ export function AirflowSystem({ windAngle, width, length, height, permeabilityCa
|
||||
// Colisão: Expulsar as partículas do interior com força (Desvio realístico)
|
||||
const isAirtight = permeabilityCase !== 'four-equally-permeable';
|
||||
if (isAirtight) {
|
||||
if (windAngle === 0 && pz < -halfL + margin) {
|
||||
if (windAngle === 90 && pz < -halfL + margin) {
|
||||
deflectY = p.baseSpeed * 2.0; // Levanta pro telhado
|
||||
deflectX = px > 0 ? p.baseSpeed * 2.0 : -p.baseSpeed * 2.0; // Contorna laterais
|
||||
p.position.z -= p.baseSpeed * 1.5; // Impede de avançar
|
||||
} else if (windAngle === 90 && px < -halfW + margin) {
|
||||
} else if (windAngle === 0 && px < -halfW + margin) {
|
||||
deflectY = p.baseSpeed * 2.0; // Levanta pro telhado
|
||||
deflectZ = pz > 0 ? p.baseSpeed * 2.0 : -p.baseSpeed * 2.0; // Contorna laterais
|
||||
p.position.x -= p.baseSpeed * 1.5; // Impede de avançar
|
||||
|
||||
@@ -236,8 +236,8 @@ const GalpaoModule: React.FC = () => {
|
||||
<SelectValue placeholder="Selecione a direção" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="0">0° (Perpendicular à largura)</SelectItem>
|
||||
<SelectItem value="90">90° (Paralelo à largura)</SelectItem>
|
||||
<SelectItem value="0">0° (Perpendicular ao comprimento)</SelectItem>
|
||||
<SelectItem value="90">90° (Perpendicular à largura)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user