drei
drei copied to clipboard
Using GizmoHelper with CameraControls does not work as expected
threeversion: 0.143.0@react-three/fiberversion: 8.10.1@react-three/dreiversion: 9.58.4nodeversion: 16.19.1npmversion: 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;
}}