Skip to content

Commit

Permalink
Revert "Reflect any removal of device roll to the emulator device pre…
Browse files Browse the repository at this point in the history
…view"

This is causing issues moving the preview device when roll is negated so it
will be reverted for now pending more exploration.

This reverts commit 7b15fd3.
  • Loading branch information
richtr committed Jul 7, 2015
1 parent 7b15fd3 commit b8b2292
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions emulator/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,24 @@ var APP = {

controls.update();

// Remove device roll on request
if(scope.removeDeviceRoll) {
rotZ = rotation.setFromQuaternion( controls.object.quaternion, 'YXZ' ).z;
rotQuat.set( 0, 0, Math.sin( ( - rotZ ) / 2 ), Math.cos( ( - rotZ ) / 2 ) );
controls.object.quaternion.multiply( rotQuat );
}

renderer.render( scene, camera );

// *** Calculate current "device orientation" using Full-Tilt library

// Position device to reflect real world space
camQuat.copy( controls.object.quaternion );

// Position device to reflect real world space
camQuat.inverse();
camQuat.multiply( worldQuat );
camQuat.inverse();

// Remove device roll on request
if(scope.removeDeviceRoll) {
rotZ = rotation.setFromQuaternion( controls.object.quaternion, 'YXZ' ).z;
rotQuat.set( 0, 0, Math.sin( ( - rotZ ) / 2 ), Math.cos( ( - rotZ ) / 2 ) );
camQuat.multiply( rotQuat );
}

// Derive Tait-Bryan angles from calculated orientation quaternion
fulltiltEuler.setFromQuaternion(camQuat);

Expand Down

0 comments on commit b8b2292

Please sign in to comment.