-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions to calculate between Geo- and GPU coordinates #51
Comments
a bevy system for changing the speed depending on the height: fn update_camera_speed(
mut movement_settings: ResMut<MovementSettings>,
fly_cam: Query<&Transform, (With<FlyCam>, Without<TileMap>)>,
tilemap: Query<&Transform, (With<TileMap>, Without<FlyCam>)>,
) {
movement_settings.speed =
3.5 * (fly_cam.single().translation.distance(tilemap.single().translation) - EARTH_RADIUS) + 100.0
} You can change the
in
In order for the thing to actually show up in the right place, it needs to be made a child of the |
update_camera_speed works great. The direction the camera I get is a "space direction", relative to the GPU coordinates. But for a compass, We need a code to get it relative to the ... see above. To handle things on Earth, the user should not need to think in GPU coordinates but relative ... see above. In the placing case, the user has lat/lon and elevation on the surface (already relative to ... ground) and needs to transform to get the Translation in the GPU coordinates. Again a function should be provided. You somewhere mentioned, if the camera/player moves to far form the GPU zero point, we may need to move the map, to avoid fuzzy GPU calculations. When you startet with the Earth, I assumed, you place the Earth "below" the player and instead of shifting the map we would rotate the Earth. In this case, the user scene nearby would have the same coordinates for programming as the GPU coordinates. |
If and as we now use an Earth sphere, we can't just use the GPU coordinates or the camera Transform to for orientation relative to the map.
For our development and for future users we should add some helper functions.
Examples:
We may have functions like
camera.get_local_transform / .get_earth_rotation / .get_map_position (names to be discussed)
The position in meter relativ to the start position of the scene or the center of the first loaded tile.
(Terrain rendering is to be considered if implemented)
The functions may get added to our existing "classes" like GeoPos.
The text was updated successfully, but these errors were encountered: