Skip to content

Commit

Permalink
allow controlling of pan/zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Jul 11, 2022
1 parent b30dc27 commit 59842cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ThreeDimensionalControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,26 @@ export type ThreeDimensionalControlsProps = {
* @default true
*/
enableZoom?: boolean;
/**
* control the pan
* @default true
*/
enablePan?: boolean;
};

export function ThreeDimensionalControls({
enabled = true,
zoomSpeed = 1,
enableZoom = true,
enablePan = true,
}: ThreeDimensionalControlsProps) {
/* disable rotation so that it doesn't clash with selection */
return (
<OrbitControls
enabled={enabled}
zoomSpeed={zoomSpeed}
enableZoom={enableZoom}
enablePan={enablePan}
/>
);
}

0 comments on commit 59842cd

Please sign in to comment.