Skip to content

Commit

Permalink
Fixed camroll when krpanoJS is used inside an iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
fieldOfView committed Apr 13, 2011
1 parent 6ae75ff commit af6a701
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gyro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gyro/examples/gyro.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<krpano version="1.0.8">
<view hlookat="-45" vlookat="0" fov="65" fovmax="100" />
<view hlookat="-45" vlookat="0" fov="80" fovmax="100" />

<plugin name="gyro" url="../../gyro.js" enabled="true" camroll="true" friction="0.5" velastic="0.2" devices="html5" keep="true" />

Expand Down
6 changes: 3 additions & 3 deletions gyro/source/gyro.source.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var krpanoplugin = function()
krpano.control.layer.addEventListener("touchcancel", handleTouchEnd, true);
isEnabled = true;

hOffset = -window.orientation;
hOffset = -top.orientation;
vOffset = 0;
hLookAt = 0;
vLookAt = 0;
Expand Down Expand Up @@ -170,15 +170,15 @@ var krpanoplugin = function()
vSpeed = vLookAtNow - vLookAt;

if(isCamRoll) {
camRoll = wrapAngle( 180 + Number(window.orientation) - orientation.roll / degRad );
camRoll = wrapAngle( 180 + Number(top.orientation) - orientation.roll / degRad );
}

// fix gimbal lock
if( Math.abs(pitch) > 70 )
{
altYaw = event.alpha;

switch(window.orientation)
switch(top.orientation)
{
case 0:
if ( pitch>0 )
Expand Down

0 comments on commit af6a701

Please sign in to comment.