Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into globe-control-events
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 16, 2024
2 parents e538562 + ba4da54 commit c632a3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.3.24] - Unreleased
### Added
- Support for dispatched events to TilesRenderer and equivelent events for existing `.on*` callbacks

## [0.3.23] - 2024-01-09
### Fixed
- Case where Google tiles did not load to a further depth when a tile has no content and no children.
Expand Down
17 changes: 9 additions & 8 deletions example/src/controls/TileControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ export class TileControls {
update() {

const {
raycaster,
camera,
cameraRadius,
dragPoint,
Expand Down Expand Up @@ -486,16 +485,18 @@ export class TileControls {
camera.position.add( _delta );
dragPoint.copy( startDragPoint );

// adjust the height
hit.distance -= _delta.length();

}

// cast down from the camera
if ( hit ) {

const dist = hit.distance;
if ( dist < cameraRadius ) {

const delta = cameraRadius - dist;
camera.position.copy( hit.point ).addScaledVector( raycaster.ray.direction, - cameraRadius );
camera.position.addScaledVector( up, delta );
dragPoint.addScaledVector( up, delta );

}
Expand Down Expand Up @@ -814,17 +815,17 @@ export class TileControls {

if ( pivot ) {

// perform a simple realignment by rotating the camera and adjusting the height
const dist = pivot.distanceTo( camera.position );
camera.position.copy( pivot ).addScaledVector( newUp, dist );
camera.quaternion.premultiply( _quaternion );
camera.updateMatrixWorld();
// perform a simple realignment by rotating the camera around the pivot
makeRotateAroundPoint( pivot, _quaternion, _rotMatrix );
camera.matrixWorld.premultiply( _rotMatrix );
camera.matrixWorld.decompose( camera.position, camera.quaternion, _vec );

}

}

up.copy( newUp );
camera.updateMatrixWorld();

}

Expand Down

0 comments on commit c632a3a

Please sign in to comment.