let BaseNode=require("../Utils/BaseNode").BaseNode,APJS=require("../../../amazingpro");class CGLookAtTarget extends BaseNode{constructor(){super()}execute(t){if(null!=this.inputs[1]&&null!=this.inputs[2]&&null!=this.inputs[3]&&null!=this.inputs[4]&&null!=this.inputs[5]){var o=this.inputs[1](),s=this.inputs[2](),n=this.inputs[3](),i=this.inputs[4](),r=new APJS.Vector3f(0,1,0),a=this.inputs[5]();let t;t=a?o.localPosition:o.getWorldPosition();var l=s.subtract(t).normalize(),u=l.clone().cross(r).normalize(),c=r.cross(l).normalize(),A=u.clone().cross(l).normalize();let e;switch(!0){case n===i:return new APJS.Vector3f(0,0,0);case"X"===n&&"Y"===i:e=APJS.Quaternionf.lookAt(A,u);break;case"X"===n&&"Z"===i:e=APJS.Quaternionf.lookAt(A,c);break;case"Y"===n&&"X"===i:e=APJS.Quaternionf.lookAt(c,l);break;case"Y"===n&&"Z"===i:e=APJS.Quaternionf.lookAt(A,l);break;case"Z"===n&&"X"===i:e=APJS.Quaternionf.lookAt(l,u);break;case"Z"===n&&"Y"===i:e=APJS.Quaternionf.lookAt(l,A)}a?o.locRotation=e:o.setWorldRotation(e),this.outputs[1]=e.toEulerAngles(),this.nexts[0]&&this.nexts[0]()}}}exports.CGLookAtTarget=CGLookAtTarget;