Browse Source

Fix jumping while panning around +180/-180 degrees (fixes #62).

pull/63/head
Matthew Petroff 9 years ago
parent
commit
5cc12a0048
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/js/pannellum.js

+ 2
- 2
src/js/pannellum.js View File

@@ -485,7 +485,7 @@ function onDocumentMouseMove(event) {
latestInteraction = Date.now();
//TODO: This still isn't quite right
var yaw = ((Math.atan(onPointerDownPointerX / renderer.canvas.width * 2 - 1) - Math.atan(event.clientX / renderer.canvas.width * 2 - 1)) * 180 / Math.PI * config.hfov / 90) + onPointerDownYaw;
yawSpeed = (yaw - config.yaw) * 0.2;
yawSpeed = (yaw - config.yaw) % 360 * 0.2;
config.yaw = yaw;
var vfov = 2 * Math.atan(Math.tan(config.hfov/360*Math.PI) * renderer.canvas.height / renderer.canvas.width) * 180 / Math.PI;
@@ -557,7 +557,7 @@ function onDocumentTouchMove(event) {
}
var yaw = (onPointerDownPointerX - clientX) * 0.1 + onPointerDownYaw;
yawSpeed = (yaw - config.yaw) * 0.2;
yawSpeed = (yaw - config.yaw) % 360 * 0.2;
config.yaw = yaw;
var pitch = (clientY - onPointerDownPointerY) * 0.1 + onPointerDownPitch;


Loading…
Cancel
Save