text: /*!
   * SAP UI development toolkit for HTML5 (SAPUI5)
  
          (c) Copyright 2009-2015 SAP SE. All rights reserved
      
   */
  sap.ui.define(["./thirdparty/three","../View","../AnimationPlayback","../AnimationTrackType","../AnimationTrackValueType","../AnimationTrackValueTypeSize","../AnimationRotateType","../AnimationMath"],function(t,V,A,a,b,c,d,e){"use strict";var f=function(){};f.prototype._getChildNodesWithMaterial=function(p,g){for(var h=0;p.children&&h<p.children.length;h++){var i=p.children[h];if(i&&i.material&&i.material.color){g.push(i);}this._getChildNodesWithMaterial(i,g);}};f.prototype._getVkTrackType=function(g){switch(g.type){case"TRANSLATE":return a.Translate;case"ROTATE":return a.Rotate;case"SCALE":return a.Scale;case"OPACITY":return a.Opacity;case"COLOR":return a.Color;default:}};f.prototype._getVkTrackValueType=function(g,r){switch(g.type){case"TRANSLATE":return b.Vector3;case"ROTATE":if(r===d.Quaternion){return b.Quaternion;}else if(r===d.AngleAxis){return b.AngleAxis;}else if(r===d.Euler){return b.Euler;}break;case"SCALE":return b.Vector3;case"OPACITY":return b.Scalar;case"COLOR":return b.Vector3;default:}};f.prototype.insertTracks=function(g,h,n,s){g.forEach(function(i){var k=h.get(i.id);var v=s.findTrack(i.id.toString());if(Array.isArray(k)&&k.length){if(!v){var l=this._getVkTrackValueType(k[0],i.rotateType);var m=c.get(l);v=s.createTrack(i.id.toString(),{trackValueType:l,cycleForward:i.cyclicInfo.cyclicEnd,cycleBackward:i.cyclicInfo.cyclicStart,infinite:i.infinite});i.times.forEach(function(o,p){var q;if(l===b.Scalar){q=i.values[p];}else{q=[];for(var j=0;j<m;j++){q.push(i.values[p*m+j]);}}v.insertKey(o,q);});}k.forEach(function(j){var o=s.findSequence(j.sequenceId);var p=n.get(j.targetId);if(o&&p){o.setNodeAnimation(p,this._getVkTrackType(j),v);}},this);}},this);return this;};f.prototype.setInitialNodePositionsFromSubsequentViews=function(v,s,o){if(!v||!v.length){return;}var g;var n;var h;var i=new Map();for(var j=v.length-1;j>0;j--){var k=v[j];var l;if(k){l=k.getPlaybacks();}if(l){for(var p=l.length-1;p>=0;p--){var m=l[p];if(m){g=s.findSequence(m.getSequence().getId());if(g){if(o&&!g.hasHighlight()){continue;}if(!m.getReversed()){n=g.getNodesBoundaryValues(true).entries();}else{n=g.getNodesBoundaryValues(false).entries();}h=n.next();while(!h.done){i.set(h.value[0],h.value[1]);h=n.next();}}}}}var q=v[j-1];if(q){if(!q.userData){q.userData={};}if(!q.userData.nodeStartDataByAnimation){q.userData.nodeStartDataByAnimation=new Map();}n=i.entries();h=n.next();while(!h.done){q.userData.nodeStartDataByAnimation.set(h.value[0],h.value[1]);h=n.next();}}}};f.prototype.setInitialNodePositionsFromPreviousViews=function(v,s,o){if(!v||!v.length){return;}var g;var n;var h;var i=new Map();for(var j=0;j<v.length-1;j++){var p=v[j];var k;if(p){k=p.getPlaybacks();}if(k){for(var l=0;l<k.length;l++){var m=k[l];if(m){g=s.findSequence(m.getSequence().getId());if(g){if(o&&!g.hasHighlight()){continue;}if(!m.getReversed()){n=g.getNodesBoundaryValues(false).entries();}else{n=g.getNodesBoundaryValues(true).entries();}h=n.next();while(!h.done){i.set(h.value[0],h.value[1]);h=n.next();}}}}}var q=v[j+1];if(q){if(!q.userData){q.userData={};}if(!q.userData.nodeStartDataByAnimation){q.userData.nodeStartDataByAnimation=new Map();}n=i.entries();h=n.next();while(!h.done){q.userData.nodeStartDataByAnimation.set(h.value[0],h.value[1]);h=n.next();}}}};f.prototype.setInitialNodePositionsOnView=function(v,s,o){if(!v){return;}var n;var g;var h=0;var i=null;i=v.getPlaybacks();if(!i||!i.length){return;}if(!v.userData){v.userData={};}if(!v.userData.nodeStartDataByAnimation){v.userData.nodeStartDataByAnimation=new Map();}for(var j=i.length-1;j>=h;j--){var p=i[j];var k=s.findSequence(p.getSequence().getId());if(k){if(o&&!k.hasHighlight()){continue;}if(p.getReversed()){n=k.getNodesBoundaryValues(false).entries();}else{n=k.getNodesBoundaryValues(true).entries();}g=n.next();while(!g.done){v.userData.nodeStartDataByAnimation.set(g.value[0],g.value[1]);g=n.next();}}}};f.prototype.setInitialNodePositionsFromCurrenetViews=function(v,s,o){if(!v||!v.length){return;}for(var g=0;g<v.length;g++){var h=v[g];if(!h){continue;}this.setInitialNodePositionsOnView(h,s,o);}};f.prototype.setPlaybackStartTimes=function(v,s){if(!v||!v.length){return;}for(var g=0;g<v.length;g++){var h=v[g];if(!h){continue;}var i=null;if(h){i=h.getPlaybacks();}if(!i||!i.length){continue;}var j=0;for(var k=0;k<i.length;k++){var p=i[k];var l=p.getSequence();if(l){l.resetDuration();}p.setStartTime(j);j+=p.getDuration();}}};f.prototype.prepareViewForAnimation=function(v){var n=v.getNodeInfos();if(!n){return;}if(!v.userData){v.userData={};}if(!v.userData.nodesDataByView){v.userData.nodesDataByView=new Map();}else{return;}function g(l){return new THREE.Matrix4().set(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],0,0,0,1);}for(var h=0;h<n.length;h++){var i=n[h];if(!i||!i.target){continue;}var j={};if(i.transform){j.position=new THREE.Vector3();j.scale=new THREE.Vector3();j.quaternion=new THREE.Quaternion();var k=g(i.transform);k.decompose(j.position,j.quaternion,j.scale);v.userData.nodesDataByView.set(i.target,j);}}};f.prototype.getNodePositionByView=function(v,n){var g;if(!v){return g;}if(!v.userData||!v.userData.nodesDataByView){this.prepareViewForAnimation(v);}if(v.userData&&v.userData.nodesDataByView){g=v.userData.nodesDataByView.get(n);}return g;};f.prototype.getNodePositionFromNearestPlayback=function(s,v,g,n){var h;if(!v||!s){return h;}var p=v.getPlaybacks();if(!p){return h;}var i;var j;var k=0;for(i=0;i<p.length;i++){j=p[i];if(g==j.getSequenceId()){k=j.getStartTime();break;}}var m=0;for(i=0;i<p.length;i++){j=p[i];var l=j.getStartTime();if(k<=l){continue;}if(g==j.getSequenceId()){continue;}var o=s.findSequence(j.getSequenceId());if(o){var q;if(j.getReversed()){q=o.getNodesStartValues();}else{q=o.getNodesEndValues();}var r=q.get(n);if(r&&l>=m){h=r;m=l;}}}return h;};f.prototype._buildViewInitialState=function(v,g,s){var h=g.indexOf(v);if(h<0){return undefined;}var i;var j;var p;var k=new Map();var l=function(n,o,q){var r=k.get(n);if(!r){r={target:n};k.set(n,r);}r[o]=q;};var m=function(n,u){if(!n){return;}var o=n.getNodeAnimation();if(o){o.forEach(function(q){var r=q.nodeRef;for(var w in a){var x=a[w];var y=q[x];if(y&&y.getKeysCount()){var z=u?0:y.getKeysCount()-1;var B=y.getKey(z);var C=e.interpolate(y.getKeysType(),B,B,0,y);l(r,x,C);}}});}};for(i=g.length-1;i>=h;i--){p=g[i].getPlaybacks();if(Array.isArray(p)){for(j=p.length-1;j>=0;j--){m(p[j].getSequence(),true);}}}for(i=0;i<h;i++){p=g[i].getPlaybacks();if(Array.isArray(p)){for(j=0;j<p.length;j++){m(p[j].getSequence(),false);}}}return k;};f.prototype.buildViewsInitialState=function(v,s){if(!Array.isArray(v)){return;}var g=function(n){var r=[];n.forEach(function(h,i){r.push(h);});return r;};v.forEach(function(h){var n=this._buildViewInitialState(h,v,s);if(n){h.updateNodeInfos(g(n));}},this);};return f;});
  