From e4a9c8623ada2dab99fb0fd461c77c49778902eb Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Sat, 30 May 2026 12:24:45 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Auto-deploy:=20melhoria=20no=20s?= =?UTF-8?q?nap=20e=20medi=C3=A7=C3=A3o=20AR=20em=2030/05/2026=2012:24:45?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MeetingRoom.tsx | 62 ++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/src/pages/MeetingRoom.tsx b/src/pages/MeetingRoom.tsx index 4a3f15d..3fae51f 100644 --- a/src/pages/MeetingRoom.tsx +++ b/src/pages/MeetingRoom.tsx @@ -32,7 +32,7 @@ class ModelErrorBoundary extends React.Component) => void }) { const { scene } = useGLTF(model.url); const clone = useMemo(() => scene.clone(), [scene]); const presentationGroupRef = useRef(null); const baseScaleRef = useRef(1); const centerRef = useRef(new THREE.Vector3()); + const [isDragging, setIsDragging] = useState(false); // Calcula escala de aproximadamente 1 metro para caber na mesa (apenas UMA vez no carregamento) useEffect(() => { @@ -589,12 +590,10 @@ function HologramModel({ model, presentationState }: { model: SceneModel; presen // Aplica transformações de Rotação e Escala compartilhadas no grupo externo de apresentação useFrame(() => { - if (presentationGroupRef.current && presentationState) { + if (presentationGroupRef.current && presentationState && !isDragging) { const { rotation, scale } = presentationState; if (rotation) { - presentationGroupRef.current.rotation.x = rotation[0]; - presentationGroupRef.current.rotation.y = rotation[1]; - presentationGroupRef.current.rotation.z = rotation[2]; + presentationGroupRef.current.rotation.set(rotation[0], rotation[1], rotation[2]); } if (scale) { presentationGroupRef.current.scale.setScalar(baseScaleRef.current * scale); @@ -666,27 +665,48 @@ function HologramModel({ model, presentationState }: { model: SceneModel; presen }, [calQuatArr]); return ( - // Grupo Externo de Apresentação Compartilhada - - {/* Grupo de Translação Fina */} - - {/* Grupo de Rotação Fina e Escala Fina */} - - {/* Grupo de Calibração */} - - {/* Grupo de Centralização do Bounding Box (para girar em torno do seu centro geométrico) */} - - + <> + {isPresenter && ( + setIsDragging(!!e?.value)} + onChange={() => { + if (isDragging && presentationGroupRef.current) { + onPresentationChange({ + rotation: [ + presentationGroupRef.current.rotation.x, + presentationGroupRef.current.rotation.y, + presentationGroupRef.current.rotation.z + ] + }); + } + }} + /> + )} + {/* Grupo Externo de Apresentação Compartilhada */} + + {/* Ignoramos fineTuning.posX/Y/Z para ancorar perfeitamente à mesa */} + + {/* Grupo de Rotação Fina e Escala Fina */} + + {/* Grupo de Calibração */} + + {/* Grupo de Centralização do Bounding Box */} + + + - + ); } // Cenário da Sala de Reunião Clara -function ThreeMeetingRoomScene({ currentActiveModel, presentationState, isFocusMode }: { currentActiveModel: SceneModel | null; presentationState: PresentationState; isFocusMode: boolean }) { +function ThreeMeetingRoomScene({ currentActiveModel, presentationState, isFocusMode, isPresenter, onPresentationChange }: { currentActiveModel: SceneModel | null; presentationState: PresentationState; isFocusMode: boolean; isPresenter: boolean; onPresentationChange: (state: Partial) => void }) { const tableGeom = useMemo(() => { // Geometria da mesa em U / Retangular de cantos arredondados const shape = new THREE.Shape(); @@ -793,7 +813,7 @@ function ThreeMeetingRoomScene({ currentActiveModel, presentationState, isFocusM }> {currentActiveModel ? ( - + ) : ( // Holograma Padrão Geométrico se não houver maquete carregada @@ -1717,7 +1737,7 @@ export default function MeetingRoom() {
{isWebGLSupported ? ( - + {/* Renderizar avatares de TODOS na sala - Ocultados se modo foco */} {!isFocusMode && Object.keys(mergedPeers).map((chairKey) => {