function flyToCam(){
type="flyToCam";
this.beginTimer;
this.endTimePlusPause;
this.endTime;
this.stepWidth;
this.firstTime=true;
var _1;
var _2;
var _3;
var _4;
var _5;
var _6;
var _7;
var _8;
var _9;
var _a;
var _b;
var _c=0;
var _d=false;
var _e=false;
this.getType=function(){
return "flyToCam";
};
this.getNextPoint=function(){
var _f=new Date();
var _10=_f.getTime();
if(_e==false){
var _11=_10-this.beginTime;
}else{
var _11=_10-_e;
}
_e=_10;
_c++;
if(_10<this.endTime){
var _12=_b.kurswinkel(_a.getCampos(),_1);
if(_2==0){
_2=geController.getApiFacede().getGroundAltitude(_1.getLatitude(),_1.getLongitude());
_2=_2+CameraEndpointAltRel;
_5=(_2-_a.getCampos().getAltitude())/parseFloat(this.endTime-_10)*1000;
}
var _13=distanceCPPerSecond*(_11/1000);
compCampoint=_a.moveCamTo(_a.getCampos(),_12,_13);
newCampoint=_a.getCampos();
newCampoint.setLatitude(compCampoint.getLatitude());
newCampoint.setLongitude(compCampoint.getLongitude());
aktAlt=newCampoint.getAltitude();
newCampoint.setAltitude(aktAlt+(parseFloat(_5)*(_11/1000)));
newCampoint.setTilt(newCampoint.getTilt()+(_6*(_11/1000)));
newCampoint.setHeading(newCampoint.getHeading()+(_7*(_11/1000)));
return newCampoint;
}else{
if(!_d){
_d=true;
ep=geController.getApiFacede().getLookAt();
ep.setLatitude(_1.getLatitude());
ep.setLongitude(_1.getLongitude());
ep.setAltitude(0);
return true;
}else{
if(_10<this.endTimePlusPause){
return true;
}else{
return false;
}
}
}
};
this.setTiming=function(_14,_15){
_2=0;
_d=false;
_e=false;
_c=0;
_b=new mathUtility();
_a=geCamera.getInstance();
campos=geController.getApiFacede().getCamera();
relAlt=campos.getAltitude();
campos=geController.getApiFacede().getCameraAbs();
_a.setCampos(campos);
now=new Date();
this.beginTime=now.getTime();
this.endTimePlusPause=this.beginTime+(parseInt(this.getBeanProperty("duration"))*1000);
tDuration=parseInt(this.getBeanProperty("duration")*500);
if(this.getBeanProperty("transitionparam")!=null){
transPause=parseFloat(this.getBeanProperty("transitionparam"));
if(transPause!=NaN){
tDurationTemp=parseInt(this.getBeanProperty("duration"))-transPause;
if(transPause==0){
tDuration=parseInt(this.getBeanProperty("duration"))*1000;
}
if(tDurationTemp>0&&tDurationTemp<parseInt(this.getBeanProperty("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.getBeanProperty("lalat")));
tLookAt.setLongitude(parseFloat(this.getBeanProperty("lalon")));
tLookAt.setAltitude(parseFloat(this.getBeanProperty("laalt")));
tLookAt.setAltitudeMode(parseFloat(1));
tLookAt.setHeading(parseFloat(this.getBeanProperty("laheading")));
tLookAt.setTilt(parseFloat(this.getBeanProperty("latilt")));
tLookAt.setRange(parseFloat(this.getBeanProperty("larange")));
_1=_a.computeCampos(tLookAt);
CameraEndpointAltRel=_1.getAltitude();
_8=_b.distCosineLaw(_1,campos);
distanceCPPerSecond=parseFloat(_8)/parseFloat(tDuration)*1000;
_5=(_1.getAltitude()+relAlt-campos.getAltitude())/parseFloat(tDuration)*1000;
_6=(tLookAt.getTilt()-campos.getTilt())/parseFloat(tDuration)*1000;
var _16=this.normalizedAngle(tLookAt.getHeading()-campos.getHeading());
if(_16<0){
var vz=(1);
}else{
var vz=(-1);
}
var _18=360-this.normalizedAngle(_16);
if(Math.abs(_16)<Math.abs(_18)){
_7=(_16)/parseFloat(tDuration)*1000;
}else{
_7=(_18)/parseFloat(tDuration)*1000*vz;
}
};
this.normalizedAngle=function(_19){
posAngle=parseFloat(_19);
if(posAngle<0){
while(posAngle<0){
posAngle=posAngle+360;
}
}else{
if(posAngle>360){
while(posAngle>360){
posAngle=posAngle-360;
}
}
}
return posAngle;
};
};
flyToCam.prototype=new geTransitionIface();


