Improve snapping

This commit is contained in:
Lukas Rieger (Blue) 2022-11-09 18:15:16 +01:00
parent 4ebb90f7d1
commit 5bfb775473
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
2 changed files with 6 additions and 3 deletions

View File

@ -177,9 +177,12 @@ export class MapControls {
this.keyRotate.update(delta, map);
this.touchRotate.update(delta, map);
const rotating = this.mouseRotate.moving || this.touchRotate.moving ||
this.keyRotate.left || this.keyRotate.right
// snap rotation to north on orthographic view
if (this.manager.ortho !== 0 && Math.abs(this.manager.rotation) < 0.3) {
this.manager.rotation = softClamp(this.manager.rotation, 0, 0, 0.05);
if (this.manager.ortho !== 0 && Math.abs(this.manager.rotation) < (rotating ? 0.05 : 0.3)) {
this.manager.rotation = softClamp(this.manager.rotation, 0, 0, 0.1);
}
// tilt

View File

@ -94,7 +94,7 @@ void main() {
float aoStrength = 0.0;
if(lod == 1.0) {
aoStrength = smoothstep(PI - 0.8, PI - 0.2, acos(-clamp(viewMatrix[1][2], 0.0, 1.0)));
aoStrength *= 1.0 - smoothstep(200.0, 500.0, vDistance);
aoStrength *= 1.0 - smoothstep(300.0, 500.0, vDistance);
if (aoStrength > 0.0) {
const float r = 3.0;