mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: stop autorotate on pose
This commit is contained in:
1 parent
03ee0828fe
commit
e0e0624010
1 file changed
+5
-3
@@ -164,14 +164,16 @@ export function Controls() {
|
||||
}, [camera, protagonist.tank.id, antagonist.tank.id]);
|
||||
|
||||
useEffect(() => {
|
||||
function handlePointerDown() {
|
||||
function handleDisturbance() {
|
||||
setAutoRotate(false);
|
||||
}
|
||||
|
||||
canvas.addEventListener('pointerdown', handlePointerDown);
|
||||
poseEvent.on(handleDisturbance);
|
||||
canvas.addEventListener('pointerdown', handleDisturbance);
|
||||
|
||||
return () => {
|
||||
canvas.removeEventListener('pointerdown', handlePointerDown);
|
||||
canvas.removeEventListener('pointerdown', handleDisturbance);
|
||||
poseEvent.off(handleDisturbance);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in new issue
Block a user