#
luxiaotao1123
2024-04-23 dd1602c1a8722206bf9df0c1b78c34926bd121df
#
2个文件已修改
30 ■■■■ 已修改文件
src/assets/data/agv.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/agv.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/data/agv.js
@@ -40,7 +40,7 @@
            no: 1,
            position: [100, 0, 200],
            theta: 90,
            height: 100,
            height: 200,
            loaderTheta: 180,
            forkLength: 0,
            trayList: [],
@@ -52,7 +52,7 @@
            no: 1,
            position: [100, 0, 300],
            theta: 90,
            height: 100,
            height: 300,
            loaderTheta: 180,
            forkLength: 0,
            trayList: [],
@@ -62,9 +62,9 @@
    [
        {
            no: 1,
            position: [100, 0, 300],
            position: [100, 0, 400],
            theta: 90,
            height: 100,
            height: 400,
            loaderTheta: 180,
            forkLength: 0,
            trayList: [],
src/components/agv.jsx
@@ -12,6 +12,7 @@
    const [groupPos, setGroupPos] = useState({ x: 0, y: 0, z: 0 });
    const [groupTheta, setGroupTheta] = useState(0);
    const [loaderHeight, setLoaderHeight] = useState(0);
    useEffect(() => {
        if (!props || Object.keys(props).length === 0) {
@@ -52,7 +53,18 @@
                }).start();
        }
        // loader height
        if (loaderHeight !== height) {
            new TWEEN.Tween({ value: loaderHeight })
                .to({ value: height }, INTERVAL_TIME)
                .easing(TWEEN.Easing.Linear.None)
                .onUpdate((e) => {
                    setLoaderHeight(e.value)
                })
                .onComplete((e) => {
                    setLoaderHeight(e.value)
                }).start();
        }
    }, [props]);
@@ -92,10 +104,14 @@
                position={[groupPos.x, groupPos.y, groupPos.z]}
            >
                <primitive object={bodyModel} castShadow />
                <primitive object={loaderModel} castShadow position={[0, 100, 0]} />
                <primitive object={forkModel} castShadow position={[0, 120, 0]} />
                <group
                    position-y={loaderHeight}
                >
                    <primitive object={loaderModel} castShadow position={[0, 50, 0]} />
                    <primitive object={forkModel} castShadow position={[0, 61, 0]} />
                <Box position={[100, 100, 300]} />
            </group>
            </group>
        </>
    )
}