mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-15 20:12:00 +01:00
Fix camera issues with worlds that have their general height below 0
This commit is contained in:
parent
be705dad58
commit
3853055cf8
@ -145,7 +145,7 @@ export class MapControls {
|
|||||||
* @param map {Map}
|
* @param map {Map}
|
||||||
*/
|
*/
|
||||||
update(delta, map) {
|
update(delta, map) {
|
||||||
this.manager.position.y = 0; // reset target y position
|
this.manager.position.y = -10000; // reset target y position
|
||||||
|
|
||||||
// move
|
// move
|
||||||
MapControls._beforeMoveTemp.copy(this.manager.position);
|
MapControls._beforeMoveTemp.copy(this.manager.position);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {MathUtils, Vector2} from "three";
|
import {MathUtils, Vector2} from "three";
|
||||||
|
import {distance} from "three/addons/nodes/shadernode/ShaderNodeBaseElements";
|
||||||
|
|
||||||
export class MapHeightControls {
|
export class MapHeightControls {
|
||||||
|
|
||||||
@ -93,7 +94,7 @@ export class MapHeightControls {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// adjust targetHeight by distance
|
// adjust targetHeight by distance
|
||||||
this.distanceTagretHeight = Math.max(MathUtils.lerp(this.targetHeight, 0, this.manager.distance / 500), 0);
|
this.distanceTagretHeight = MathUtils.lerp(this.targetHeight, 0, Math.min(this.manager.distance / 500, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
getSuggestedHeight() {
|
getSuggestedHeight() {
|
||||||
|
Loading…
Reference in New Issue
Block a user