Fix issue with finding some planets and bases

This commit is contained in:
Rob L 2016-08-02 08:22:40 -04:00
parent 4175e58b9b
commit 8d2788b318

View File

@ -188,7 +188,6 @@ function animate() {
function render () { function render () {
//requestAnimationFrame( render ); //requestAnimationFrame( render );
renderer.render( scene, camera ); renderer.render( scene, camera );
// find intersections
} }
@ -210,16 +209,13 @@ function listobjects(type) {
function zoomfocus(name) { function zoomfocus(name) {
var types = ['planets','stations'];
for (var type in types) { var zoomto = grabPositionByName(name)
var objects = listobjects(types[type]); if (zoomto != null) {
for ( var key in objects ) { controls.target.x = zoomto.x;
if (key == name) { controls.target.y = zoomto.y;
var object = objects[key]; controls.target.z = zoomto.z;
controls.target.x = object.x; var focus = new THREE.Vector3( zoomto.x, zoomto.y, zoomto.z );
controls.target.y = object.y;
controls.target.z = object.z;
var focus = new THREE.Vector3( object.x, object.y, object.z );
var vantage = new THREE.Vector3( 5, 60 , 150 ); var vantage = new THREE.Vector3( 5, 60 , 150 );
focus.add(vantage); focus.add(vantage);
camera.position.set(focus.x,focus.y,focus.z); camera.position.set(focus.x,focus.y,focus.z);
@ -229,9 +225,7 @@ function zoomfocus(name) {
} }
}
}
} }