Commit 725c5f17 authored by Chunchi Che's avatar Chunchi Che

add edge render in hand

parent 0e476ba3
...@@ -42,6 +42,8 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => { ...@@ -42,6 +42,8 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => {
const rotation = CONFIG.HandRotation(); const rotation = CONFIG.HandRotation();
const hoverScale = CONFIG.HandHoverScaling(); const hoverScale = CONFIG.HandHoverScaling();
const defaultScale = new BABYLON.Vector3(1, 1, 1); const defaultScale = new BABYLON.Vector3(1, 1, 1);
const edgesWidth = 2.0;
const edgesColor = BABYLON.Color4.FromColor3(BABYLON.Color3.Yellow());
const planeRef = useRef(null); const planeRef = useRef(null);
const [state, idx] = [props.state, props.idx]; const [state, idx] = [props.state, props.idx];
const [hovered, setHovered] = useState(false); const [hovered, setHovered] = useState(false);
...@@ -127,6 +129,9 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => { ...@@ -127,6 +129,9 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => {
scaling={hovered ? hoverScale : defaultScale} scaling={hovered ? hoverScale : defaultScale}
position={spring.position} position={spring.position}
rotation={rotation} rotation={rotation}
enableEdgesRendering
edgesWidth={state.interactivities.length == 0 ? 0 : edgesWidth}
edgesColor={edgesColor}
> >
<animated.standardMaterial <animated.standardMaterial
name={`hand-mat-${idx}`} name={`hand-mat-${idx}`}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment