mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
Camera fly precision fix
This commit is contained in:
parent
14a92fda91
commit
b83802c5f7
@ -452,17 +452,23 @@ class PlanetCamera extends Camera {
|
||||
fly: (progress: number) => {
|
||||
let t = ease(progress);
|
||||
let d = 1 - t;
|
||||
// camera path and orientations calculation
|
||||
let g_i = ground_a.smerp(ground_b, d).normalize();
|
||||
let ground_i = this.planet.getRayIntersectionEllipsoid(new Ray(zero, g_i));
|
||||
let eye_i: Vec3;
|
||||
|
||||
if (t >= 1) {
|
||||
eye_i = cartesian.clone();
|
||||
} else {
|
||||
// camera path calculation
|
||||
let g_i = ground_a.smerp(ground_b, d).normalize();
|
||||
let ground_i = this.planet.getRayIntersectionEllipsoid(new Ray(zero, g_i));
|
||||
let height_i =
|
||||
this._lonLat.height * d * d * d +
|
||||
max_h * 3 * d * d * t +
|
||||
max_h * 3 * d * t * t +
|
||||
lonlat_b.height * t * t * t;
|
||||
|
||||
let height_i =
|
||||
this._lonLat.height * d * d * d +
|
||||
max_h * 3 * d * d * t +
|
||||
max_h * 3 * d * t * t +
|
||||
lonlat_b.height * t * t * t;
|
||||
|
||||
let eye_i = ground_i!.addA(g_i.scale(height_i));
|
||||
eye_i = ground_i!.addA(g_i.scale(height_i));
|
||||
}
|
||||
// camera orientation calculation
|
||||
let up_i = v_a.smerp(v_b, d);
|
||||
let look_i = Vec3.add(eye_i, n_a.smerp(n_b, d).negateTo());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user