Skip to content

Commit

Permalink
fix: 'Examples' camera manager implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolafis committed Jun 26, 2023
1 parent 68ce414 commit 7991c19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/src/utils/CustomCameraManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export class CustomCameraManager implements CameraManager {
const target =
state.target ??
(state.rotation
? CameraManagerHelper.calculateNewTargetFromRotation(this._camera, state.rotation, this._controls.target)
? CameraManagerHelper.calculateNewTargetFromRotation(
this._camera,
state.rotation,
this._controls.target,
position
)
: this._controls.target);

this._camera.position.copy(position);
Expand Down
1 change: 1 addition & 0 deletions viewer/packages/camera-manager/src/CameraManagerHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class CameraManagerHelper {
* @param camera Used camera instance.
* @param rotation New camera rotation in quaternion form.
* @param currentTarget Current camera target.
* @param position New camera position.
* @returns
*/
static calculateNewTargetFromRotation(
Expand Down

0 comments on commit 7991c19

Please sign in to comment.