function geCamera(){
var _1;
this.ER=6371010;
var _2="lon lat alt";
var _3=new mathUtility();
this.setCampos=function(_4){
_2=_4;
};
this.getCampos=function(){
return _2;
};
this.createLookAt=function(_5){
b=parseFloat(this.ER)+parseFloat(_5.getAltitude());
c=parseFloat(this.ER)+parseFloat(_2.getAltitude());
alpha=_3.distCosineLaw(_5,_2);
alpha=alpha/parseFloat(this.ER);
dist=alpha*b;
hoehe=Math.sin(alpha)*b;
powHoehe=Math.pow(hoehe,2);
cOne=Math.sqrt(Math.pow(b,2)-powHoehe);
cTwo=c-cOne;
a=Math.sqrt(Math.pow(cTwo,2)+powHoehe);
myTilt=toDeg(Math.asin(hoehe/a));
heading=_3.kurswinkel(_2,_5);
la=_1.createLookAt("");
la.set(_5.getLatitude(),parseFloat(_5.getLongitude()),parseFloat(_5.getAltitude()),_1.ALTITUDE_RELATIVE_TO_GROUND,parseFloat(heading),parseFloat(myTilt),parseFloat(a));
return la;
};
this.computeCampos=function(_6){
aktAlt=parseFloat(_6.getAltitude());
var b=this.ER+parseFloat(aktAlt);
var b2=Math.pow(b,2);
var a2=Math.pow(parseFloat(_6.getRange()),2);
var _a=a2+b2;
var _b=_a-2*parseFloat(_6.getRange())*b*(Math.cos(Math.PI-toRad(parseFloat(_6.getTilt()))));
_b=Math.sqrt(_b);
var _c=(Math.sin((Math.PI-toRad(parseFloat(_6.getTilt()))))*(parseFloat(_6.getRange())))/_b;
var _d=(parseFloat(_6.getHeading())+180)%360;
outPoint=this.moveCamTo(_6,_d,(_c*this.ER));
aktAlt=parseFloat(_b)-parseFloat(this.ER);
outPoint.setAltitude(aktAlt);
return outPoint;
};
this.moveCamTo=function(_e,_f,_10){
var _11=toRad(parseFloat(_e.getLatitude()));
var _12=toRad(parseFloat(_e.getLongitude()));
brng=toRad(_f);
var d=_10/this.ER;
var _14=Math.asin(Math.sin(_11)*Math.cos(d)+Math.cos(_11)*Math.sin(d)*Math.cos(brng));
var _15=parseFloat(_12)+Math.atan2(Math.sin(brng)*Math.sin(d)*Math.cos(_11),Math.cos(d)-Math.sin(_11)*Math.sin(_14));
var _16=_1.createPoint("");
_16.setLatitude(toDeg(_14));
_16.setLongitude(toDeg(_15%(2*Math.PI)));
_16.setAltitude(_e.getAltitude());
return _16;
};
if(geController instanceof SnoovelManager){
_1=geController.getApiFacede().getGeInstance();
}
};
geCamera.__instance=null;
geCamera.getInstance=function(){
return new geCamera();
};
function flyTo(){
type="flyTo";
this.beginTimer;
this.endTimePlusPause;
this.endTime;
this.stepWidth;
this.firstTime=true;
var _17;
var _18;
var _19;
var _1a;
var _1b;
var _1c;
var _1d;
var _1e;
var _1f;
var _20=0;
var _21=false;
var _22=false;
this.getType=function(){
return "flyTo";
};
this.getNextPoint=function(){
var _23=new Date();
var _24=_23.getTime();
if(_22==false){
var _25=_24-this.beginTime;
}else{
var _25=_24-_22;
}
_22=_24;
if(_24<this.endTime){
_20++;
var _26=_1f.kurswinkel(_19,_18);
var _27=_1f.kurswinkel(_1e.getCampos(),_17);
var _28=distanceFPPerSecond*(_25/1000);
_19=_1e.moveCamTo(_19,_26,_28);
var _29=distanceCPPerSecond*(_25/1000);
newCampoint=_1e.moveCamTo(_1e.getCampos(),_27,_29);
aktAlt=newCampoint.getAltitude();
newCampoint.setAltitude(aktAlt+(altitudeCPperSecond*(_25/1000)));
aktAlt=_19.getAltitude();
_19.setAltitude(aktAlt+(altitudeFPperSecond*(_25/1000)));
_1e.setCampos(newCampoint);
la=_1e.createLookAt(_19);
return la;
}else{
if(!_21){
_21=true;
return _18;
}else{
if(_24<this.endTimePlusPause){
return true;
}else{
return false;
}
}
}
};
this.setTiming=function(_2a,_2b){
_21=false;
_22=false;
_20=0;
_1f=new mathUtility();
_1e=geCamera.getInstance();
tCampos=geController.getApiFacede().getLookAt();
var _2c=_1e.computeCampos(tCampos);
_1e.setCampos(_2c);
now=new Date();
this.beginTime=now.getTime();
this.endTimePlusPause=this.beginTime+(parseInt(this.bean.duration)*1000);
tDuration=(parseInt(this.bean.duration)*500);
if(this.bean.transitionparam!=null){
transPause=parseFloat(this.bean.transitionparam);
if(transPause!=NaN){
tDurationTemp=parseInt(this.bean.duration)-transPause;
if(transPause==0){
tDuration=parseInt(this.bean.duration)*1000;
}
if(tDurationTemp>0&&tDurationTemp<parseInt(this.bean.duration)){
tDuration=1000*tDurationTemp;
}
}
}
this.endTime=this.beginTime+tDuration;
this.camSpeed=5;
geController.getApiFacede().setFlyToSpeed(this.camSpeed);
tLookAt=geController.getApiFacede().getLookAt();
tLookAt.setLatitude(parseFloat(this.bean.lalat));
tLookAt.setLongitude(parseFloat(this.bean.lalon));
tLookAt.setAltitude(parseFloat(this.bean.laalt));
tLookAt.setAltitudeMode(parseFloat(1));
tLookAt.setHeading(parseFloat(this.bean.laheading));
tLookAt.setTilt(parseFloat(this.bean.latilt));
tLookAt.setRange(parseFloat(this.bean.larange));
_18=tLookAt;
_17=_1e.computeCampos(tLookAt);
_1c=_1f.distCosineLaw(_17,_2c);
distanceCPPerSecond=parseFloat(_1c)/parseFloat(tDuration)*1000;
_1a=_1f.distCosineLaw(tLookAt,tCampos);
distanceFPPerSecond=parseFloat(_1a)/parseFloat(tDuration)*1000;
altitudeCPperSecond=(_17.getAltitude()-_2c.getAltitude())/parseFloat(tDuration)*1000;
altitudeFPperSecond=(tLookAt.getAltitude()-tCampos.getAltitude())/parseFloat(tDuration)*1000;
_19=tCampos;
focusEndPoint=tLookAt;
};
};
flyTo.prototype=new geTransitionIface();


