Skip to content

Commit

Permalink
Fix transition
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Dec 13, 2024
1 parent 8670936 commit 1a6fcf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/r3f/components/CameraTransition.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ export const CameraTransition = forwardRef( function CameraTransition( props, re

const callback = () => invalidate();
manager.addEventListener( 'transition-start', callback );
manager.addEventListener( 'transition-change', callback );
manager.addEventListener( 'change', callback );
manager.addEventListener( 'transition-end', callback );

return () => {

manager.removeEventListener( 'transition-start', callback );
manager.removeEventListener( 'transition-change', callback );
manager.removeEventListener( 'change', callback );
manager.removeEventListener( 'transition-end', callback );

};
Expand Down
2 changes: 2 additions & 0 deletions src/three/controls/CameraTransitionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export class CameraTransitionManager extends EventDispatcher {

toggle() {

// reset the clock for cases where we're not calling "update" every frame
this._target = this._target === 1 ? 0 : 1;
this._clock.getDelta();

}

Expand Down

0 comments on commit 1a6fcf6

Please sign in to comment.