drei icon indicating copy to clipboard operation
drei copied to clipboard

Using GizmoHelper with CameraControls does not work as expected

Open vincent-azumuta opened this issue 2 years ago • 2 comments

  • three version: 0.143.0
  • @react-three/fiber version: 8.10.1
  • @react-three/drei version: 9.58.4
  • node version: 16.19.1
  • npm version: 8.19.3

Problem description:

https://user-images.githubusercontent.com/81570907/228866509-e97adaa5-69ac-40af-89d8-93d782b9b34f.mov

Relevant code:

I have made a minimal reproducible example below.

https://codesandbox.io/s/react-three-fiber-camera-controls-forked-xirtvj?file=/src/App.tsx

The GizmoHelper crashes when initialised with default properties.

I had to add the code below to make it work, but then it results in the behaviour in the video.

				onTarget={() => {
					const v = new Vector3();
					controlsRef.current?.getTarget(v);
					return v;
				}}

vincent-azumuta avatar Mar 30 '23 14:03 vincent-azumuta