feat: add Robot Doctor and Security Guard personas with pricing and model paths
This commit is contained in:
@@ -22,7 +22,7 @@ function buildAttireGlbMap(personas: { id: string; modelPath?: string }[]): Reco
|
||||
personas.forEach((p) => {
|
||||
if (p.modelPath && p.id !== 'none') dynamic[p.id] = p.modelPath;
|
||||
});
|
||||
return { ...dynamic, ...STATIC_ATTIRE_GLB }; // static takes priority
|
||||
return { ...STATIC_ATTIRE_GLB, ...dynamic }; // uploaded GLBs override static
|
||||
}
|
||||
|
||||
function easeInOutCubic(t: number): number {
|
||||
@@ -32,6 +32,15 @@ function easeInOutCubic(t: number): number {
|
||||
}
|
||||
|
||||
function AttireModel({ glbPath, onLoaded }: { glbPath: string; onLoaded: () => void }) {
|
||||
// Clear stale useGLTF cache entries for paths that share the same base filename
|
||||
// (e.g. /models/robot-doctor.glb?v=1 replaced by ?v=2). This prevents Three.js
|
||||
// from serving the old binary when the version query string changes.
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
useGLTF.clear(glbPath);
|
||||
};
|
||||
}, [glbPath]);
|
||||
|
||||
const { scene } = useGLTF(glbPath);
|
||||
|
||||
const processedAttire = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user