🚀 Auto-deploy: melhoria no snap e medição AR em 25/05/2026 14:40:21
This commit is contained in:
+16
-10
@@ -32,7 +32,7 @@ class ModelErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBounda
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
import { Canvas, useFrame } from '@react-three/fiber';
|
import { Canvas, useFrame } from '@react-three/fiber';
|
||||||
import { OrbitControls, Text, useGLTF, Billboard, Image } from '@react-three/drei';
|
import { OrbitControls, Text, useGLTF, Billboard, Html } from '@react-three/drei';
|
||||||
import * as THREE from 'three';
|
import * as THREE from 'three';
|
||||||
import { supabase } from '@/integrations/supabase/client';
|
import { supabase } from '@/integrations/supabase/client';
|
||||||
import { useModelStore, type SceneModel } from '@/stores/useModelStore';
|
import { useModelStore, type SceneModel } from '@/stores/useModelStore';
|
||||||
@@ -179,7 +179,7 @@ function MiiAvatarBackup({
|
|||||||
|
|
||||||
const avatarUrl = useMemo(() => {
|
const avatarUrl = useMemo(() => {
|
||||||
const seed = `${username || 'user'}_${avatarId}`;
|
const seed = `${username || 'user'}_${avatarId}`;
|
||||||
return `https://api.dicebear.com/7.x/toon-head/png?seed=${encodeURIComponent(seed)}&backgroundColor=transparent`;
|
return `https://api.dicebear.com/9.x/toon-head/png?seed=${encodeURIComponent(seed)}`;
|
||||||
}, [username, avatarId]);
|
}, [username, avatarId]);
|
||||||
|
|
||||||
useFrame((state) => {
|
useFrame((state) => {
|
||||||
@@ -253,15 +253,21 @@ function MiiAvatarBackup({
|
|||||||
</mesh>
|
</mesh>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Cabeça do Avatar: Toon Head do Dicebear em Billboard com efeito de pulo ao falar */}
|
{/* Cabeça do Avatar: Toon Head do Dicebear em HTML Billboard para resiliência contra erros de CORS/Rede */}
|
||||||
<group ref={headRef} position={[0, 0.16, 0]}>
|
<group ref={headRef} position={[0, 0.16, 0]}>
|
||||||
<Billboard follow={true}>
|
<Html center distanceFactor={1.2}>
|
||||||
<Image
|
<div className="w-16 h-16 flex items-center justify-center pointer-events-none select-none">
|
||||||
url={avatarUrl}
|
<img
|
||||||
transparent
|
src={avatarUrl}
|
||||||
scale={[0.24, 0.24]}
|
alt={username}
|
||||||
/>
|
className="w-full h-full object-contain drop-shadow-md"
|
||||||
</Billboard>
|
style={{ minWidth: '64px', minHeight: '64px' }}
|
||||||
|
onError={(e) => {
|
||||||
|
(e.currentTarget as HTMLImageElement).src = `https://ui-avatars.com/api/?name=${encodeURIComponent(username || 'U')}&background=475569&color=fff&size=128&rounded=true`;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Html>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
{/* Base cônica para dar uma sustentação 3D estilizada */}
|
{/* Base cônica para dar uma sustentação 3D estilizada */}
|
||||||
|
|||||||
Reference in New Issue
Block a user