🚀 Auto-deploy: melhoria no snap e medição AR em 25/05/2026 14:40:21
This commit is contained in:
@@ -32,7 +32,7 @@ class ModelErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBounda
|
||||
}
|
||||
}
|
||||
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 { supabase } from '@/integrations/supabase/client';
|
||||
import { useModelStore, type SceneModel } from '@/stores/useModelStore';
|
||||
@@ -179,7 +179,7 @@ function MiiAvatarBackup({
|
||||
|
||||
const avatarUrl = useMemo(() => {
|
||||
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]);
|
||||
|
||||
useFrame((state) => {
|
||||
@@ -253,15 +253,21 @@ function MiiAvatarBackup({
|
||||
</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]}>
|
||||
<Billboard follow={true}>
|
||||
<Image
|
||||
url={avatarUrl}
|
||||
transparent
|
||||
scale={[0.24, 0.24]}
|
||||
<Html center distanceFactor={1.2}>
|
||||
<div className="w-16 h-16 flex items-center justify-center pointer-events-none select-none">
|
||||
<img
|
||||
src={avatarUrl}
|
||||
alt={username}
|
||||
className="w-full h-full object-contain drop-shadow-md"
|
||||
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`;
|
||||
}}
|
||||
/>
|
||||
</Billboard>
|
||||
</div>
|
||||
</Html>
|
||||
</group>
|
||||
|
||||
{/* Base cônica para dar uma sustentação 3D estilizada */}
|
||||
|
||||
Reference in New Issue
Block a user