Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-12777: Fixes shadow flickering on tilt (#1938)
Browse files Browse the repository at this point in the history
Signed-off-by: Frauke Fritz <[email protected]>
  • Loading branch information
FraukeF authored Nov 2, 2020
1 parent a2a6781 commit d2d955b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion @here/harp-mapview/lib/MapViewEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ export class MapViewEnvironment {
// the height
// using basic trigonometry.
const tilt = this.m_mapView.tilt;
const cameraHeight = this.m_mapView.targetDistance * Math.cos(tilt);
const cameraHeight =
this.m_mapView.targetDistance * Math.cos(THREE.MathUtils.degToRad(tilt));
const lightPosHyp = cameraHeight / normal.dot(lightDirection);

directionalLight.target.position
Expand Down

0 comments on commit d2d955b

Please sign in to comment.