feat(core): Add bearing/rotation and pitch support to GlobeView and GlobeController#4
feat(core): Add bearing/rotation and pitch support to GlobeView and GlobeController#4
Conversation
…ller - Add bearing property to GlobeViewport (camera rotation around view axis) - Add bearing to GlobeViewState type - Implement rotate(), rotateStart(), rotateEnd(), rotateLeft(), rotateRight() methods in GlobeState - Enable dragRotate and touchRotate in GlobeController (previously disabled) - Add bearing to transition interpolator - Add shortestPathFrom() method for smooth bearing transitions - Update documentation for GlobeView and GlobeController - Update tests to reflect new rotation capability
Status: Draft - Not Working YetTested integrating this branch with New Heat but rotation gestures aren't triggering properly. What was done:
What's not working:
Next steps needed:
Leaving as draft until I have more time to investigate the gesture handling layer. |
|
@copilot be highly intelligent with the intention of this PR - see a functional prototype of the MapController update with the new option type visgl#9938 as inspiration. We were focusing on a GlobeController that was able to give the user freedom of interaction like Google Earth Studio - namely - zooming in where the mouse is rather then the center of the screen as it currently works on GlobeController, also adding pitch and bearing support, add the updated viewstate interactions wihtout mistakes. |
- Fix rotate() method to properly handle deltaAngleX from pinch gestures - Fix zoom() to follow cursor position (Google Earth-like behavior) - Add pitch support (0-85 degrees) to GlobeViewport and GlobeController - Add rotateUp/rotateDown methods for keyboard pitch control - Export DEFAULT_MIN_PITCH/DEFAULT_MAX_PITCH constants - Update documentation to reflect new capabilities - Add pitch tests
I've implemented the Google Earth-like interactions for GlobeController in commit e242d1d: Fixed:
Added:
Usage: initialViewState: {
longitude: 0,
latitude: 20,
zoom: 0,
bearing: 0,
pitch: 30 // NEW
}Ready for testing with New Heat.
Fixed in e242d1d. The bug was in The fix ensures rotation works via:
Also added full pitch support and fixed zoom to follow cursor position. |
Background
GlobeController explicitly disabled rotation (
dragRotate = false,touchRotate = false) and GlobeViewport lacked bearing and pitch support in its view matrix. This prevented Google Maps/Earth-like navigation on the globe.Addresses the "Support rotation (bearing) in GlobeController" item in the GlobeView graduation tracker (visgl#9199).
Change List
GlobeViewport
bearingoption and instance propertypitchoption and instance property (0-85 degrees)DEFAULT_MIN_PITCHandDEFAULT_MAX_PITCHconstantsGlobeState
rotate(),rotateStart(),rotateEnd()for drag/touch rotation (bearing and pitch)rotateLeft(),rotateRight()for keyboard bearing rotationrotateUp(),rotateDown()for keyboard pitch rotationshortestPathFrom()for smooth bearing transitionsapplyConstraints()applyConstraints()rotate()to handledeltaAngleXfrom pinch gestures without requiringrotateStart()firstzoom()to follow cursor position (Google Earth-like zoom behavior)GlobeController
dragRotate = falseandtouchRotate = falseoverridesbearingandpitchto transition interpolatorGlobeViewState
pitch,minPitch,maxPitchto view state typeUsage
Interactions
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.