Skip to content

Commit

Permalink
fix: pivot, enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
drcmda committed Jun 30, 2024
1 parent ba527ae commit 5953965
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions src/web/pivotControls/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,28 +259,36 @@ export const PivotControls: ForwardRefComponent<PivotControlsProps, THREE.Group>
<context.Provider value={config}>
<group ref={parentRef}>
<group ref={ref} matrix={matrix} matrixAutoUpdate={false} {...props}>
{enabled && (
<group visible={visible} ref={gizmoRef} position={offset} rotation={rotation}>
{!disableAxes && activeAxes[0] && <AxisArrow axis={0} direction={xDir} />}
{!disableAxes && activeAxes[1] && <AxisArrow axis={1} direction={yDir} />}
{!disableAxes && activeAxes[2] && <AxisArrow axis={2} direction={zDir} />}
{!disableSliders && activeAxes[0] && activeAxes[1] && <PlaneSlider axis={2} dir1={xDir} dir2={yDir} />}
{!disableSliders && activeAxes[0] && activeAxes[2] && <PlaneSlider axis={1} dir1={zDir} dir2={xDir} />}
{!disableSliders && activeAxes[2] && activeAxes[1] && <PlaneSlider axis={0} dir1={yDir} dir2={zDir} />}
{!disableRotations && activeAxes[0] && activeAxes[1] && (
<AxisRotator axis={2} dir1={xDir} dir2={yDir} />
)}
{!disableRotations && activeAxes[0] && activeAxes[2] && (
<AxisRotator axis={1} dir1={zDir} dir2={xDir} />
)}
{!disableRotations && activeAxes[2] && activeAxes[1] && (
<AxisRotator axis={0} dir1={yDir} dir2={zDir} />
)}
{!disableScaling && activeAxes[0] && <ScalingSphere axis={0} direction={xDir} />}
{!disableScaling && activeAxes[1] && <ScalingSphere axis={1} direction={yDir} />}
{!disableScaling && activeAxes[2] && <ScalingSphere axis={2} direction={zDir} />}
</group>
)}
<group visible={visible} ref={gizmoRef} position={offset} rotation={rotation}>
{enabled && (
<>
{!disableAxes && activeAxes[0] && <AxisArrow axis={0} direction={xDir} />}
{!disableAxes && activeAxes[1] && <AxisArrow axis={1} direction={yDir} />}
{!disableAxes && activeAxes[2] && <AxisArrow axis={2} direction={zDir} />}
{!disableSliders && activeAxes[0] && activeAxes[1] && (
<PlaneSlider axis={2} dir1={xDir} dir2={yDir} />
)}
{!disableSliders && activeAxes[0] && activeAxes[2] && (
<PlaneSlider axis={1} dir1={zDir} dir2={xDir} />
)}
{!disableSliders && activeAxes[2] && activeAxes[1] && (
<PlaneSlider axis={0} dir1={yDir} dir2={zDir} />
)}
{!disableRotations && activeAxes[0] && activeAxes[1] && (
<AxisRotator axis={2} dir1={xDir} dir2={yDir} />
)}
{!disableRotations && activeAxes[0] && activeAxes[2] && (
<AxisRotator axis={1} dir1={zDir} dir2={xDir} />
)}
{!disableRotations && activeAxes[2] && activeAxes[1] && (
<AxisRotator axis={0} dir1={yDir} dir2={zDir} />
)}
{!disableScaling && activeAxes[0] && <ScalingSphere axis={0} direction={xDir} />}
{!disableScaling && activeAxes[1] && <ScalingSphere axis={1} direction={yDir} />}
{!disableScaling && activeAxes[2] && <ScalingSphere axis={2} direction={zDir} />}
</>
)}
</group>
<group ref={childrenRef}>{children}</group>
</group>
</group>
Expand Down

1 comment on commit 5953965

@MiguelG97
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks much!
I was using an outdated version and this option was not included

Please sign in to comment.