Carl 1 day ago
parent
commit
fc2b5410c6
1 changed files with 8 additions and 5 deletions
  1. 8 5
      src/components/AiorzWebARLanding.tsx

+ 8 - 5
src/components/AiorzWebARLanding.tsx

@@ -1,4 +1,4 @@
-import React, { useState, useEffect, useRef } from 'react';
+import { useState, useEffect, useRef } from 'react';
 import { Terminal, Cpu, Camera, ChevronRight, Activity, Mail } from 'lucide-react';
 
 // 脚本加载辅助函数
@@ -23,10 +23,8 @@ const AiorzWebARLanding = () => {
   const [cameraActive, setCameraActive] = useState(false);
   const [systemStatus, setSystemStatus] = useState("SYSTEM_INIT");
   const [gestureMode, setGestureMode] = useState("NEUTRAL");
-  const [handSpeed, setHandSpeed] = useState(0);
   
   // Refs for WebGL and MediaPipe
-  const containerRef = useRef<HTMLDivElement>(null);
   const videoRef = useRef<HTMLVideoElement>(null);
   const canvasRef = useRef<HTMLCanvasElement>(null);
   
@@ -433,7 +431,7 @@ const AiorzWebARLanding = () => {
   };
 
   // ==================== 3. Shape Generation ====================
-  const initShapes = (THREE: any) => {
+  const initShapes = (_THREE: any) => {
     const count = CONFIG.particleCount;
     const shapes: Record<string, Float32Array> = {};
 
@@ -501,7 +499,7 @@ const AiorzWebARLanding = () => {
         for (let i = 0; i < partCount; i++) {
             if (offset >= count) break;
             
-            let x, y, z;
+            let x: number, y: number, z: number;
             if (type === 'box') {
                 x = rand(bounds.x[0], bounds.x[1]);
                 y = rand(bounds.y[0], bounds.y[1]);
@@ -518,6 +516,11 @@ const AiorzWebARLanding = () => {
                 x = rand(bounds.x[0], bounds.x[1]) + t * 2.5; 
                 y = rand(bounds.y[0], bounds.y[1]) + t * 3.0; 
                 z = rand(bounds.z[0], bounds.z[1]);
+            } else {
+                // 默认值,确保所有路径都有值
+                x = rand(bounds.x[0], bounds.x[1]);
+                y = rand(bounds.y[0], bounds.y[1]);
+                z = rand(bounds.z[0], bounds.z[1]);
             }
 
             const isLeft = Math.random() > 0.5;