Transitioning between Three.js FirstPerson controls and Orbit controls can be seamless, but there seems to be an issue when switching from First Person to Orbit where the display gets stuck in a 'mousedown' mode.
Is there a way to easily go back and forth between First Person and Orbit controls without encountering this problem?
To see a demo of the issue, check out the jsBin example:
http://jsbin.com/jekebo/2/edit?html,js,output
The following are the two functions used for setting up the different controls:
function setControlsFirstPerson() {
camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.set( -150, 20, 0 );
controls = new THREE.FirstPersonControls( camera, renderer.domElement );
controls.lookSpeed = 0.05;
controls.movementSpeed = 50;
}
function setControlsOrbit() {
camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.set( 100, 100, 100 );
controls = new THREE.OrbitControls( camera, renderer.domElement );
}
Any suggestions or help on resolving this issue would be greatly appreciated.