mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'sovareign/camera_zoom_fix' into 'master'
fix unequal zoom in distance and zoom out distance See merge request veloren/veloren!1322
This commit is contained in:
commit
57dc821f84
@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Added leaf and chimney particles
|
- Added leaf and chimney particles
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Fixed a bug where leaving the Settings menu by pressing "N" in single player kept the game paused
|
|
||||||
|
- Fixed a bug where leaving the Settings menu by pressing "N" in single player kept the game paused.
|
||||||
- The world map has been refactored to support arbitrary sizes and compute horizon maps.
|
- The world map has been refactored to support arbitrary sizes and compute horizon maps.
|
||||||
- Veloren's lighting has been completely overhauled.
|
- Veloren's lighting has been completely overhauled.
|
||||||
- The graphics options were made much more flexible and configurable.
|
- The graphics options were made much more flexible and configurable.
|
||||||
@ -23,7 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Animation and terrain math were switched to use SIMD where possible, improving performance.
|
- Animation and terrain math were switched to use SIMD where possible, improving performance.
|
||||||
- The way we cache glyphs was refactored, fixed, and optimized.
|
- The way we cache glyphs was refactored, fixed, and optimized.
|
||||||
- Colors for models and figures were adjusted to account for the saturation hack.
|
- Colors for models and figures were adjusted to account for the saturation hack.
|
||||||
- Fixed a bug where the closest item would be picked up instead of a selected item
|
- Fixed a bug where the closest item would be picked up instead of a selected item.
|
||||||
|
- Fixed a bug where camera zoom in and zoom out distance didn't match.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -344,8 +344,17 @@ impl Scene {
|
|||||||
},
|
},
|
||||||
// Zoom the camera when a zoom event occurs
|
// Zoom the camera when a zoom event occurs
|
||||||
Event::Zoom(delta) => {
|
Event::Zoom(delta) => {
|
||||||
self.camera
|
// when zooming in the distance the camera travelles should be based on the
|
||||||
.zoom_switch(delta * (0.05 + self.camera.get_distance() * 0.01));
|
// final distance. This is to make sure the camera travelles the
|
||||||
|
// same distance when zooming in and out
|
||||||
|
if delta < 0.0 {
|
||||||
|
self.camera.zoom_switch(
|
||||||
|
delta * (0.05 + self.camera.get_distance() * 0.01) / (1.0 - delta * 0.01),
|
||||||
|
); // Thank you Imbris for doing the math
|
||||||
|
} else {
|
||||||
|
self.camera
|
||||||
|
.zoom_switch(delta * (0.05 + self.camera.get_distance() * 0.01));
|
||||||
|
}
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
Event::AnalogGameInput(input) => match input {
|
Event::AnalogGameInput(input) => match input {
|
||||||
|
Loading…
Reference in New Issue
Block a user