UNPKG

awayjs-display

Version:
2 lines 397 kB
require=function t(e,i,r){function s(a,o){if(!i[a]){if(!e[a]){var l=typeof require=="function"&&require;if(!o&&l)return l(a,!0);if(n)return n(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var p=i[a]={exports:{}};e[a][0].call(p.exports,function(t){var i=e[a][1][t];return s(i?i:t)},p,p.exports,t,e,i,r)}return i[a].exports}var n=typeof require=="function"&&require;for(var a=0;a<r.length;a++)s(r[a]);return s}({1:[function(t,e,i){"use strict";var r=t("./lib/adapters");i.adapters=r;var s=t("./lib/animators");i.animators=s;var n=t("./lib/base");i.base=n;var a=t("./lib/bounds");i.bounds=a;var o=t("./lib/controllers");i.controllers=o;var l=t("./lib/display");i.display=l;var h=t("./lib/draw");i.draw=h;var p=t("./lib/errors");i.errors=p;var u=t("./lib/events");i.events=u;var c=t("./lib/factories");i.factories=c;var f=t("./lib/graphics");i.graphics=f;var d=t("./lib/managers");i.managers=d;var _=t("./lib/materials");i.materials=_;var y=t("./lib/partition");i.partition=y;var v=t("./lib/pick");i.pick=v;var m=t("./lib/prefabs");i.prefabs=m;var b=t("./lib/text");i.text=b;var g=t("./lib/textures");i.textures=g;var w=t("./lib/utils");i.utils=w;var P=t("./lib/View");i.View=P.View;y.PartitionBase.registerAbstraction(y.CameraNode,l.Camera);y.PartitionBase.registerAbstraction(y.DirectionalLightNode,l.DirectionalLight);y.PartitionBase.registerAbstraction(y.EntityNode,l.Sprite);y.PartitionBase.registerAbstraction(y.EntityNode,l.Shape);y.PartitionBase.registerAbstraction(y.EntityNode,l.MovieClip);y.PartitionBase.registerAbstraction(y.EntityNode,l.Billboard);y.PartitionBase.registerAbstraction(y.EntityNode,l.LineSegment);y.PartitionBase.registerAbstraction(y.EntityNode,l.TextField);y.PartitionBase.registerAbstraction(y.EntityNode,l.TextFieldMultiRender);y.PartitionBase.registerAbstraction(y.LightProbeNode,l.LightProbe);y.PartitionBase.registerAbstraction(y.PointLightNode,l.PointLight);y.PartitionBase.registerAbstraction(y.SkyboxNode,l.Skybox)},{"./lib/View":"awayjs-display/lib/View","./lib/adapters":"awayjs-display/lib/adapters","./lib/animators":"awayjs-display/lib/animators","./lib/base":"awayjs-display/lib/base","./lib/bounds":"awayjs-display/lib/bounds","./lib/controllers":"awayjs-display/lib/controllers","./lib/display":"awayjs-display/lib/display","./lib/draw":"awayjs-display/lib/draw","./lib/errors":"awayjs-display/lib/errors","./lib/events":"awayjs-display/lib/events","./lib/factories":"awayjs-display/lib/factories","./lib/graphics":"awayjs-display/lib/graphics","./lib/managers":"awayjs-display/lib/managers","./lib/materials":"awayjs-display/lib/materials","./lib/partition":"awayjs-display/lib/partition","./lib/pick":"awayjs-display/lib/pick","./lib/prefabs":"awayjs-display/lib/prefabs","./lib/text":"awayjs-display/lib/text","./lib/textures":"awayjs-display/lib/textures","./lib/utils":"awayjs-display/lib/utils"}],"awayjs-display/lib/IRenderer":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/ITraverser":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/View":[function(t,e,i){"use strict";var r=t("awayjs-core/lib/utils/getTimer");var s=t("./base/TouchPoint");var n=t("./display/Scene");var a=t("./pick/RaycastPicker");var o=t("./display/Camera");var l=t("./events/CameraEvent");var h=t("./events/DisplayObjectEvent");var p=t("./events/RendererEvent");var u=t("./managers/MouseManager");var c=function(){function t(t,e,i){var r=this;if(e===void 0){e=null}if(i===void 0){i=null}this._width=0;this._height=0;this._time=0;this._deltaTime=0;this._backgroundColor=0;this._backgroundAlpha=1;this._viewportDirty=true;this._scissorDirty=true;this._mousePicker=new a.RaycastPicker;this._pTouchPoints=new Array;this._onPartitionChangedDelegate=function(t){return r._onPartitionChanged(t)};this._onProjectionChangedDelegate=function(t){return r._onProjectionChanged(t)};this._onViewportUpdatedDelegate=function(t){return r._onViewportUpdated(t)};this._onScissorUpdatedDelegate=function(t){return r._onScissorUpdated(t)};this.scene=e||new n.Scene;this.camera=i||new o.Camera;this.renderer=t;if(document){document.body.style.margin="0px";this._htmlElement=document.createElement("div");this._htmlElement.style.position="absolute";document.body.appendChild(this._htmlElement)}this._mouseManager=u.MouseManager.getInstance();this._mouseManager.registerView(this)}Object.defineProperty(t.prototype,"mouseX",{get:function(){return this._pMouseX},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"mouseY",{get:function(){return this._pMouseY},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"touchPoints",{get:function(){return this._pTouchPoints},enumerable:true,configurable:true});t.prototype.getLocalMouseX=function(t){return t.inverseSceneTransform.transformVector(this.unproject(this._pMouseX,this._pMouseY,1e3)).x};t.prototype.getLocalMouseY=function(t){return t.inverseSceneTransform.transformVector(this.unproject(this._pMouseX,this._pMouseY,1e3)).y};t.prototype.getLocalTouchPoints=function(t){var e;var i=new Array;var r=this._pTouchPoints.length;for(var n=0;n<r;n++){e=t.inverseSceneTransform.transformVector(this.unproject(this._pTouchPoints[n].x,this._pTouchPoints[n].y,1e3));i.push(new s.TouchPoint(e.x,e.y,this._pTouchPoints[n].id))}return i};Object.defineProperty(t.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"renderer",{get:function(){return this._pRenderer},set:function(t){if(this._pRenderer==t)return;if(this._pRenderer){this._pRenderer.dispose();this._pRenderer.removeEventListener(p.RendererEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate);this._pRenderer.removeEventListener(p.RendererEvent.SCISSOR_UPDATED,this._onScissorUpdatedDelegate)}this._pRenderer=t;this._pRenderer.addEventListener(p.RendererEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate);this._pRenderer.addEventListener(p.RendererEvent.SCISSOR_UPDATED,this._onScissorUpdatedDelegate);this._pRenderer._iBackgroundR=(this._backgroundColor>>16&255)/255;this._pRenderer._iBackgroundG=(this._backgroundColor>>8&255)/255;this._pRenderer._iBackgroundB=(this._backgroundColor&255)/255;this._pRenderer._iBackgroundAlpha=this._backgroundAlpha;this._pRenderer.width=this._width;this._pRenderer.height=this._height;this._pRenderer.shareContext=this._shareContext},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"shareContext",{get:function(){return this._shareContext},set:function(t){if(this._shareContext==t)return;this._shareContext=t;if(this._pRenderer)this._pRenderer.shareContext=this._shareContext},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){if(this._backgroundColor==t)return;this._backgroundColor=t;this._pRenderer._iBackgroundR=(t>>16&255)/255;this._pRenderer._iBackgroundG=(t>>8&255)/255;this._pRenderer._iBackgroundB=(t&255)/255},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundAlpha},set:function(t){if(t>1)t=1;else if(t<0)t=0;if(this._backgroundAlpha==t)return;this._pRenderer._iBackgroundAlpha=this._backgroundAlpha=t},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"camera",{get:function(){return this._pCamera},set:function(t){if(this._pCamera==t)return;if(this._pCamera)this._pCamera.removeEventListener(l.CameraEvent.PROJECTION_CHANGED,this._onProjectionChangedDelegate);this._pCamera=t;if(this._pScene)this._pScene.partition._iRegisterEntity(this._pCamera);this._pCamera.addEventListener(l.CameraEvent.PROJECTION_CHANGED,this._onProjectionChangedDelegate);this._scissorDirty=true;this._viewportDirty=true},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"scene",{get:function(){return this._pScene},set:function(t){if(this._pScene==t)return;if(this._pScene)this._pScene.removeEventListener(h.DisplayObjectEvent.PARTITION_CHANGED,this._onPartitionChangedDelegate);this._pScene=t;this._pScene.addEventListener(h.DisplayObjectEvent.PARTITION_CHANGED,this._onPartitionChangedDelegate);if(this._pCamera)this._pScene.partition._iRegisterEntity(this._pCamera)},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"deltaTime",{get:function(){return this._deltaTime},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){if(this._width==t)return;this._width=t;this._aspectRatio=this._width/this._height;this._pCamera.projection._iAspectRatio=this._aspectRatio;this._pRenderer.width=t;if(this._htmlElement){this._htmlElement.style.width=t+"px"}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){if(this._height==t)return;this._height=t;this._aspectRatio=this._width/this._height;this._pCamera.projection._iAspectRatio=this._aspectRatio;this._pRenderer.height=t;if(this._htmlElement){this._htmlElement.style.height=t+"px"}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"mousePicker",{get:function(){return this._mousePicker},set:function(t){if(this._mousePicker==t)return;if(t==null)this._mousePicker=new a.RaycastPicker;else this._mousePicker=t},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"x",{get:function(){return this._pRenderer.x},set:function(t){if(this._pRenderer.x==t)return;this._pRenderer.x==t;if(this._htmlElement){this._htmlElement.style.left=t+"px"}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"y",{get:function(){return this._pRenderer.y},set:function(t){if(this._pRenderer.y==t)return;this._pRenderer.y==t;if(this._htmlElement){this._htmlElement.style.top=t+"px"}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"visible",{get:function(){return this._htmlElement&&this._htmlElement.style.visibility=="visible"},set:function(t){if(this._htmlElement){this._htmlElement.style.visibility=t?"visible":"hidden"}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"renderedFacesCount",{get:function(){return 0},enumerable:true,configurable:true});t.prototype.render=function(){this.pUpdateTime();this._pCamera.projection._iAspectRatio=this._aspectRatio;if(this._scissorDirty){this._scissorDirty=false;this._pCamera.projection._iUpdateScissorRect(this._pRenderer.scissorRect.x,this._pRenderer.scissorRect.y,this._pRenderer.scissorRect.width,this._pRenderer.scissorRect.height)}if(this._viewportDirty){this._viewportDirty=false;this._pCamera.projection._iUpdateViewport(this._pRenderer.viewPort.x,this._pRenderer.viewPort.y,this._pRenderer.viewPort.width,this._pRenderer.viewPort.height)}if(!this._shareContext){if(this.forceMouseMove&&this._htmlElement==this._mouseManager._iActiveDiv&&!this._mouseManager._iUpdateDirty)this._mouseManager._iCollision=this.mousePicker.getViewCollision(this._pMouseX,this._pMouseY,this);this._mouseManager.fireMouseEvents(this.forceMouseMove)}this._pRenderer.render(this._pCamera,this._pScene)};t.prototype.pUpdateTime=function(){var t=r.getTimer();if(this._time==0)this._time=t;this._deltaTime=t-this._time;this._time=t};t.prototype.dispose=function(){this._pRenderer.dispose();this._mouseManager.unregisterView(this);this._mouseManager=null;this._pRenderer=null};t.prototype._onPartitionChanged=function(t){if(this._pCamera)this._pScene.partition._iRegisterEntity(this._pCamera)};t.prototype._onProjectionChanged=function(t){this._scissorDirty=true;this._viewportDirty=true};t.prototype._onViewportUpdated=function(t){this._viewportDirty=true};t.prototype._onScissorUpdated=function(t){this._scissorDirty=true};t.prototype.project=function(t){var e=this._pCamera.project(t);e.x=e.x*this._pRenderer.viewPort.width/2+this._width*this._pCamera.projection.originX;e.y=e.y*this._pRenderer.viewPort.height/2+this._height*this._pCamera.projection.originY;return e};t.prototype.unproject=function(t,e,i){return this._pCamera.unproject(2*(t-this._width*this._pCamera.projection.originX)/this._pRenderer.viewPort.width,2*(e-this._height*this._pCamera.projection.originY)/this._pRenderer.viewPort.height,i)};t.prototype.getRay=function(t,e,i){return this._pCamera.getRay((t*2-this._width)/this._width,(e*2-this._height)/this._height,i)};t.prototype.updateCollider=function(){if(!this._shareContext){if(this._htmlElement==this._mouseManager._iActiveDiv)this._mouseManager._iCollision=this.mousePicker.getViewCollision(this._pMouseX,this._pMouseY,this)}else{var t=this.mousePicker.getViewCollision(this._pMouseX,this._pMouseY,this);if(this.layeredView||this._mouseManager._iCollision==null||t.rayEntryDistance<this._mouseManager._iCollision.rayEntryDistance)this._mouseManager._iCollision=t}};return t}();i.View=c},{"./base/TouchPoint":"awayjs-display/lib/base/TouchPoint","./display/Camera":"awayjs-display/lib/display/Camera","./display/Scene":"awayjs-display/lib/display/Scene","./events/CameraEvent":"awayjs-display/lib/events/CameraEvent","./events/DisplayObjectEvent":"awayjs-display/lib/events/DisplayObjectEvent","./events/RendererEvent":"awayjs-display/lib/events/RendererEvent","./managers/MouseManager":"awayjs-display/lib/managers/MouseManager","./pick/RaycastPicker":"awayjs-display/lib/pick/RaycastPicker","awayjs-core/lib/utils/getTimer":undefined}],"awayjs-display/lib/adapters/IDisplayObjectAdapter":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/adapters/IMovieClipAdapter":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/adapters":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/animators/IAnimationSet":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/animators/IAnimator":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/animators/data/ParticleData":[function(t,e,i){"use strict";var r=function(){function t(){}return t}();i.ParticleData=r;Object.defineProperty(i,"__esModule",{value:true});i.default=r},{}],"awayjs-display/lib/animators/nodes/AnimationNodeBase":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/library/AssetBase");var n=function(t){r(e,t);function e(){t.call(this)}Object.defineProperty(e.prototype,"stateClass",{get:function(){return this._pStateClass},enumerable:true,configurable:true});e.prototype.dispose=function(){};Object.defineProperty(e.prototype,"assetType",{get:function(){return e.assetType},enumerable:true,configurable:true});e.assetType="[asset AnimationNodeBase]";return e}(s.AssetBase);i.AnimationNodeBase=n},{"awayjs-core/lib/library/AssetBase":undefined}],"awayjs-display/lib/animators":[function(t,e,i){"use strict";var r=t("./animators/data/ParticleData");i.ParticleData=r.ParticleData;var s=t("./animators/nodes/AnimationNodeBase");i.AnimationNodeBase=s.AnimationNodeBase},{"./animators/data/ParticleData":"awayjs-display/lib/animators/data/ParticleData","./animators/nodes/AnimationNodeBase":"awayjs-display/lib/animators/nodes/AnimationNodeBase"}],"awayjs-display/lib/base/AlignmentMode":[function(t,e,i){"use strict";var r=function(){function t(){}t.REGISTRATION_POINT="registrationPoint";t.PIVOT_POINT="pivot";return t}();i.AlignmentMode=r},{}],"awayjs-display/lib/base/HierarchicalProperties":[function(t,e,i){"use strict";var r=function(){function t(){}t.MOUSE_ENABLED=1;t.VISIBLE=2;t.MASK_ID=4;t.MASKS=8;t.COLOR_TRANSFORM=16;t.SCENE_TRANSFORM=32;t.ALL=63;return t}();i.HierarchicalProperties=r},{}],"awayjs-display/lib/base/IBitmapDrawable":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/base/IRenderable":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/base/ISurface":[function(t,e,i){"use strict"},{}],"awayjs-display/lib/base/OrientationMode":[function(t,e,i){"use strict";var r=function(){function t(){}t.DEFAULT="default";t.CAMERA_PLANE="cameraPlane";t.CAMERA_POSITION="cameraPosition";return t}();i.OrientationMode=r},{}],"awayjs-display/lib/base/Style":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/events/EventDispatcher");var n=t("../events/StyleEvent");var a=function(t){r(e,t);function e(){t.call(this);this._samplers=new Object;this._images=new Object;this._color=16777215}Object.defineProperty(e.prototype,"sampler",{get:function(){return this._sampler},set:function(t){if(this._sampler==t)return;this._sampler=t;this._invalidateProperties()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"image",{get:function(){return this._image},set:function(t){if(this._image==t)return;this._image=t;this._invalidateProperties()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"uvMatrix",{get:function(){return this._uvMatrix},set:function(t){if(this._uvMatrix==t)return;this._uvMatrix=t;this._invalidateProperties()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){if(this._color==t)return;this._color=t;this._invalidateProperties()},enumerable:true,configurable:true});e.prototype.getImageAt=function(t,e){if(e===void 0){e=0}return(this._images[t.id]?this._images[t.id][e]:null)||this._image};e.prototype.getSamplerAt=function(t,e){if(e===void 0){e=0}return(this._samplers[t.id]?this._samplers[t.id][e]:null)||this._sampler};e.prototype.addImageAt=function(t,e,i){if(i===void 0){i=0}if(!this._images[e.id])this._images[e.id]=new Array;this._images[e.id][i]=t};e.prototype.addSamplerAt=function(t,e,i){if(i===void 0){i=0}if(!this._samplers[e.id])this._samplers[e.id]=new Array;this._samplers[e.id][i]=t;this._invalidateProperties()};e.prototype.removeImageAt=function(t,e){if(e===void 0){e=0}if(!this._images[t.id])return;this._images[t.id][e]=null;this._invalidateProperties()};e.prototype.removeSamplerAt=function(t,e){if(e===void 0){e=0}if(!this._samplers[t.id])return;this._samplers[t.id][e]=null;this._invalidateProperties()};e.prototype._invalidateProperties=function(){this.dispatchEvent(new n.StyleEvent(n.StyleEvent.INVALIDATE_PROPERTIES,this))};return e}(s.EventDispatcher);i.Style=a},{"../events/StyleEvent":"awayjs-display/lib/events/StyleEvent","awayjs-core/lib/events/EventDispatcher":undefined}],"awayjs-display/lib/base/Timeline":[function(t,e,i){"use strict";var r=t("../base/HierarchicalProperties");var s=t("awayjs-core/lib/geom/ColorTransform");var n=t("../managers/FrameScriptManager");var a=function(){function t(){this._functions=[];this._update_indices=[];this.numKeyFrames=0;this.keyframe_indices=[];this._potentialPrototypes=[];this._labels={};this._framescripts={};this._framescripts_translated={};this._functions[1]=this.update_mtx_all;this._functions[2]=this.update_colortransform;this._functions[3]=this.update_masks;this._functions[4]=this.update_name;this._functions[5]=this.update_button_name;this._functions[6]=this.update_visibility;this._functions[7]=this.update_blendmode;this._functions[8]=this.update_rendermode;this._functions[11]=this.update_mtx_scale_rot;this._functions[12]=this.update_mtx_pos;this._functions[200]=this.enable_maskmode;this._functions[201]=this.remove_masks}t.prototype.init=function(){if(this.frame_command_indices==null||this.frame_recipe==null||this.keyframe_durations==null)return;this.keyframe_firstframes=[];this.keyframe_constructframes=[];var t=0;var e=0;var i=0;var r=0;var s=0;for(e=0;e<this.numKeyFrames;e++){var n=this.keyframe_durations[e];if(this.frame_recipe[e]&1)s=r;this.keyframe_firstframes[r]=t;this.keyframe_constructframes[r++]=s;for(i=0;i<n;i++)this.keyframe_indices[t++]=e}};t.prototype.get_framescript=function(t){if(this._framescripts[t]==null)return"";if(typeof this._framescripts[t]=="string")return this._framescripts[t];else{throw new Error("Framescript is already translated to Function!!!")}};t.prototype.add_framescript=function(t,e){if(n.FrameScriptManager.frameScriptDebug){var i=t.split(/[\r\n]+/g)[0].split("//")[1];if(n.FrameScriptManager.frameScriptDebug[i]){this._framescripts[e]=n.FrameScriptManager.frameScriptDebug[i];this._framescripts_translated[e]=true;return}else{throw new Error("Framescript could not be found on FrameScriptManager.frameScriptDebug.\n the Object set as FrameScriptmanager.frameScriptDebug should contain a function with the name '"+i+"' !!!")}}this._framescripts[e]=t};t.prototype.regexIndexOf=function(t,e,i){var r=t.substring(i||0).search(e);return r>=0?r+(i||0):r};t.prototype.add_script_for_postcontruct=function(t,e,i){if(i===void 0){i=false}if(this._framescripts[e]!=null){if(this._framescripts_translated[e]==null){this._framescripts[e]=t.adapter.evalScript(this._framescripts[e]);this._framescripts_translated[e]=true}if(i)n.FrameScriptManager.add_script_to_queue(t,this._framescripts[e]);else n.FrameScriptManager.add_script_to_queue_pass2(t,this._framescripts[e])}};Object.defineProperty(t.prototype,"numFrames",{get:function(){return this.keyframe_indices.length},enumerable:true,configurable:true});t.prototype.getPotentialChildPrototype=function(t){return this._potentialPrototypes[t]};t.prototype.getKeyframeIndexForFrameIndex=function(t){return this.keyframe_indices[t]};t.prototype.getPotentialChildInstance=function(t){var e=this._potentialPrototypes[t].clone();e.name="";return e};t.prototype.registerPotentialChild=function(t){var e=this._potentialPrototypes.length;this._potentialPrototypes[e]=t};t.prototype.jumpToLabel=function(t,e){var i=this._labels[e];if(i>=0)t.currentFrameIndex=this.keyframe_firstframes[i]};t.prototype.gotoFrame=function(t,e,i){if(i===void 0){i=false}var r=t.constructedKeyFrameIndex;var s=this.keyframe_indices[e];if(r==s)return;if(r+1==s){this.constructNextFrame(t,!i,true);return}var n=this.keyframe_constructframes[s];var a=s>r;var o=n>r;var l=a&&!o?r+1:n;var h;var p;if(o)for(h=t.numChildren-1;h>=0;h--)if(t._children[h]._depthID<0)t.removeChildAt(h);if(!a)t.resetSessionIDs();var u=t.getSessionIDDepths();this.pass1(l,s,u);var c;for(h=t.numChildren-1;h>=0;h--){c=t._children[h];if(c._depthID<0){if(u[c._depthID]!=c._sessionID){t.removeChildAt(h)}else if(!a){if(c.adapter){if(!c.adapter.isBlockedByScript()){c.transform.clearMatrix3D();c.transform.clearColorTransform();c.masks=null;c.maskMode=false}if(!c.adapter.isVisibilityByScript()){c.visible=true}}}}}for(var f in u){c=t.getPotentialChildInstance(this.add_child_stream[u[f]*2]);if(c._sessionID==-1)t._addTimelineChildAt(c,Number(f),u[f])}if(!i&&this.keyframe_firstframes[s]==e)this.add_script_for_postcontruct(t,s,true);this.pass2(t);t.constructedKeyFrameIndex=s};t.prototype.pass1=function(t,e,i){var r;var s;this._update_indices.length=0;var n=0;var a;var o;for(s=t;s<=e;s++){var l=this.frame_command_indices[s];var h=this.frame_recipe[s];if(h&2){a=this.command_index_stream[l];o=a+this.command_length_stream[l++];for(r=a;r<o;r++)delete i[this.remove_child_stream[r]-16383]}if(h&4){a=this.command_index_stream[l];o=a+this.command_length_stream[l++];for(r=o-1;r>=a;r--)i[this.add_child_stream[r*2+1]-16383]=r}if(h&8)this._update_indices[n++]=l}};t.prototype.pass2=function(t){var e;var i=this._update_indices.length;for(e=0;e<i;e++)this.update_childs(t,this._update_indices[e])};t.prototype.constructNextFrame=function(t,e,i){if(e===void 0){e=true}if(i===void 0){i=false}var r=t.currentFrameIndex;var s=this.keyframe_indices[r];if(e&&this.keyframe_firstframes[s]==r)this.add_script_for_postcontruct(t,s,i);if(t.constructedKeyFrameIndex!=s){t.constructedKeyFrameIndex=s;var n=this.frame_command_indices[s];var a=this.frame_recipe[s];if(a&1){for(var o=t.numChildren-1;o>=0;o--)if(t._children[o]._depthID<0)t.removeChildAt(o)}else if(a&2){this.remove_childs_continous(t,n++)}if(a&4)this.add_childs_continous(t,n++);if(a&8)this.update_childs(t,n++)}};t.prototype.remove_childs_continous=function(t,e){var i=this.command_index_stream[e];var r=i+this.command_length_stream[e];for(var s=i;s<r;s++)t.removeChildAt(t.getDepthIndexInternal(this.remove_child_stream[s]-16383))};t.prototype.add_childs_continous=function(t,e){var i;var r=this.command_index_stream[e];var s=r+this.command_length_stream[e];for(var n=s-1;n>=r;n--){i=n*2;t._addTimelineChildAt(t.getPotentialChildInstance(this.add_child_stream[i]),this.add_child_stream[i+1]-16383,n)}};t.prototype.update_childs=function(t,e){var i;var r;var s;var n=this.command_index_stream[e];var a=n+this.command_length_stream[e];var o;for(var l=n;l<a;l++){o=t.getChildAtSessionID(this.update_child_stream[l]);if(o){this._blocked=Boolean(o.adapter&&o.adapter.isBlockedByScript());r=this.update_child_props_indices_stream[l];s=r+this.update_child_props_length_stream[l];for(i=r;i<s;i++)this._functions[this.property_type_stream[i]].call(this,o,t,this.property_index_stream[i])}}};t.prototype.update_mtx_all=function(t,e,i){if(this._blocked)return;i*=6;var r=t.transform.matrix3D;r.rawData[0]=this.properties_stream_f32_mtx_all[i++];r.rawData[1]=this.properties_stream_f32_mtx_all[i++];r.rawData[4]=this.properties_stream_f32_mtx_all[i++];r.rawData[5]=this.properties_stream_f32_mtx_all[i++];r.rawData[12]=this.properties_stream_f32_mtx_all[i++];r.rawData[13]=this.properties_stream_f32_mtx_all[i];t.transform.invalidateComponents()};t.prototype.update_colortransform=function(t,e,i){if(this._blocked)return;i*=8;var r=t.transform.colorTransform||(t.transform.colorTransform=new s.ColorTransform);r.rawData[0]=this.properties_stream_f32_ct[i++];r.rawData[1]=this.properties_stream_f32_ct[i++];r.rawData[2]=this.properties_stream_f32_ct[i++];r.rawData[3]=this.properties_stream_f32_ct[i++];r.rawData[4]=this.properties_stream_f32_ct[i++];r.rawData[5]=this.properties_stream_f32_ct[i++];r.rawData[6]=this.properties_stream_f32_ct[i++];r.rawData[7]=this.properties_stream_f32_ct[i];t.transform.invalidateColorTransform()};t.prototype.update_masks=function(t,e,i){var r;var s=new Array;var n=this.properties_stream_int[i++];for(var a=0;a<n;a++)if(r=e.getChildAtSessionID(this.properties_stream_int[i++]))s.push(r);t.masks=s};t.prototype.update_name=function(t,e,i){t.name=this.properties_stream_strings[i];e.adapter.registerScriptObject(t)};t.prototype.update_button_name=function(t,e,i){t.name=this.properties_stream_strings[i];t.addButtonListeners();e.adapter.registerScriptObject(t)};t.prototype.update_visibility=function(t,e,i){if(!t.adapter||!t.adapter.isVisibilityByScript())t.visible=Boolean(i)};t.prototype.update_mtx_scale_rot=function(t,e,i){if(this._blocked)return;i*=4;var s=t.transform.matrix3D;s.rawData[0]=this.properties_stream_f32_mtx_scale_rot[i++];s.rawData[1]=this.properties_stream_f32_mtx_scale_rot[i++];s.rawData[4]=this.properties_stream_f32_mtx_scale_rot[i++];s.rawData[5]=this.properties_stream_f32_mtx_scale_rot[i];t.transform.invalidateComponents();t.pInvalidateHierarchicalProperties(r.HierarchicalProperties.SCENE_TRANSFORM)};t.prototype.update_mtx_pos=function(t,e,i){if(this._blocked)return;i*=2;var r=t.transform.matrix3D;r.rawData[12]=this.properties_stream_f32_mtx_pos[i++];r.rawData[13]=this.properties_stream_f32_mtx_pos[i];t.transform.invalidatePosition()};t.prototype.enable_maskmode=function(t,e,i){t.maskMode=true};t.prototype.remove_masks=function(t,e,i){t.masks=null};t.prototype.update_blendmode=function(t,e,i){console.log("update blendmode "+i)};t.prototype.update_rendermode=function(t,e,i){console.log("update rendermode "+i)};return t}();i.Timeline=a},{"../base/HierarchicalProperties":"awayjs-display/lib/base/HierarchicalProperties","../managers/FrameScriptManager":"awayjs-display/lib/managers/FrameScriptManager","awayjs-core/lib/geom/ColorTransform":undefined}],"awayjs-display/lib/base/TouchPoint":[function(t,e,i){"use strict";var r=function(){function t(t,e,i){this.x=t;this.y=e;this.id=i}return t}();i.TouchPoint=r},{}],"awayjs-display/lib/base/Transform":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/events/EventDispatcher");var n=t("awayjs-core/lib/geom/Matrix3D");var a=t("awayjs-core/lib/geom/Matrix3DUtils");var o=t("awayjs-core/lib/geom/Vector3D");var l=t("../events/TransformEvent");var h=function(t){r(e,t);function e(){t.call(this);this._matrix3D=new n.Matrix3D;this._rotation=new o.Vector3D;this._skew=new o.Vector3D;this._scale=new o.Vector3D(1,1,1);this._components=new Array(4);this._components[1]=this._rotation;this._components[2]=this._skew;this._components[3]=this._scale}Object.defineProperty(e.prototype,"backVector",{get:function(){var t=a.Matrix3DUtils.getForward(this._matrix3D);t.negate();return t},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"colorTransform",{get:function(){return this._colorTransform},set:function(t){if(this._colorTransform==t)return;this._colorTransform=t;this.invalidateColorTransform()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"concatenatedColorTransform",{get:function(){return this._concatenatedColorTransform},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"concatenatedMatrix",{get:function(){return this._concatenatedMatrix},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"downVector",{get:function(){var t=a.Matrix3DUtils.getUp(this._matrix3D);t.negate();return t},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"forwardVector",{get:function(){return a.Matrix3DUtils.getForward(this._matrix3D)},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"leftVector",{get:function(){var t=a.Matrix3DUtils.getRight(this._matrix3D);t.negate();return t},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"matrix3D",{get:function(){if(this._matrix3DDirty)this._updateMatrix3D();return this._matrix3D},set:function(t){for(var e=0;e<15;e++)this._matrix3D.rawData[e]=t.rawData[e];this.invalidateComponents()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"pixelBounds",{get:function(){return this._pixelBounds},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"position",{get:function(){return this._matrix3D.position},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"rightVector",{get:function(){return a.Matrix3DUtils.getRight(this.matrix3D)},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"rotation",{get:function(){if(this._componentsDirty)this._updateComponents();return this._rotation},enumerable:true,configurable:true});e.prototype.rotateTo=function(t,e,i){if(this._componentsDirty)this._updateComponents();this._rotation.x=t;this._rotation.y=e;this._rotation.z=i;this.invalidateMatrix3D()};Object.defineProperty(e.prototype,"scale",{get:function(){if(this._componentsDirty)this._updateComponents();return this._scale},enumerable:true,configurable:true});e.prototype.scaleTo=function(t,e,i){if(this._componentsDirty)this._updateComponents();this._scale.x=t;this._scale.y=e;this._scale.z=i;this.invalidateMatrix3D()};Object.defineProperty(e.prototype,"skew",{get:function(){if(this._componentsDirty)this._updateComponents();return this._skew},enumerable:true,configurable:true});e.prototype.skewTo=function(t,e,i){if(this._componentsDirty)this._updateComponents();this._skew.x=t;this._skew.y=e;this._skew.z=i;this.invalidateMatrix3D()};Object.defineProperty(e.prototype,"upVector",{get:function(){return a.Matrix3DUtils.getUp(this.matrix3D)},enumerable:true,configurable:true});e.prototype.dispose=function(){};e.prototype.getRelativeMatrix3D=function(t){return new n.Matrix3D};e.prototype.moveForward=function(t){this.translateLocal(o.Vector3D.Z_AXIS,t)};e.prototype.moveBackward=function(t){this.translateLocal(o.Vector3D.Z_AXIS,-t)};e.prototype.moveLeft=function(t){this.translateLocal(o.Vector3D.X_AXIS,-t)};e.prototype.moveRight=function(t){ this.translateLocal(o.Vector3D.X_AXIS,t)};e.prototype.moveUp=function(t){this.translateLocal(o.Vector3D.Y_AXIS,t)};e.prototype.moveDown=function(t){this.translateLocal(o.Vector3D.Y_AXIS,-t)};e.prototype.moveTo=function(t,e,i){this._matrix3D.rawData[12]=t;this._matrix3D.rawData[13]=e;this._matrix3D.rawData[14]=i;this.invalidatePosition()};e.prototype.pitch=function(t){this.rotate(o.Vector3D.X_AXIS,t)};e.prototype.roll=function(t){this.rotate(o.Vector3D.Z_AXIS,t)};e.prototype.yaw=function(t){this.rotate(o.Vector3D.Y_AXIS,t)};e.prototype.rotate=function(t,e){this.matrix3D.prependRotation(e,t);this.invalidateComponents()};e.prototype.translate=function(t,e){var i=t.x,r=t.y,s=t.z;var n=e/Math.sqrt(i*i+r*r+s*s);this.matrix3D.appendTranslation(i*n,r*n,s*n);this.invalidatePosition()};e.prototype.translateLocal=function(t,e){var i=t.x,r=t.y,s=t.z;var n=e/Math.sqrt(i*i+r*r+s*s);this.matrix3D.prependTranslation(i*n,r*n,s*n);this.invalidatePosition()};e.prototype.clearMatrix3D=function(){this._matrix3D.identity();this.invalidateComponents()};e.prototype.clearColorTransform=function(){if(!this._colorTransform)return;this._colorTransform.clear();this.invalidateColorTransform()};e.prototype.invalidateMatrix3D=function(){this._matrix3DDirty=true;this.dispatchEvent(new l.TransformEvent(l.TransformEvent.INVALIDATE_MATRIX3D,this))};e.prototype.invalidateComponents=function(){this.invalidatePosition();this._componentsDirty=true};e.prototype.invalidatePosition=function(){this._matrix3D.invalidatePosition();this.dispatchEvent(new l.TransformEvent(l.TransformEvent.INVALIDATE_MATRIX3D,this))};e.prototype.invalidateColorTransform=function(){this.dispatchEvent(new l.TransformEvent(l.TransformEvent.INVALIDATE_COLOR_TRANSFORM,this))};e.prototype._updateMatrix3D=function(){this._matrix3D.recompose(this._components);this._matrix3DDirty=false};e.prototype._updateComponents=function(){var t=this._matrix3D.decompose();var e;e=t[1];this._rotation.x=e.x;this._rotation.y=e.y;this._rotation.z=e.z;e=t[2];this._skew.x=e.x;this._skew.y=e.y;this._skew.z=e.z;e=t[3];this._scale.x=e.x;this._scale.y=e.y;this._scale.z=e.z;this._componentsDirty=false};return e}(s.EventDispatcher);i.Transform=h},{"../events/TransformEvent":"awayjs-display/lib/events/TransformEvent","awayjs-core/lib/events/EventDispatcher":undefined,"awayjs-core/lib/geom/Matrix3D":undefined,"awayjs-core/lib/geom/Matrix3DUtils":undefined,"awayjs-core/lib/geom/Vector3D":undefined}],"awayjs-display/lib/base":[function(t,e,i){"use strict";var r=t("./base/AlignmentMode");i.AlignmentMode=r.AlignmentMode;var s=t("./base/HierarchicalProperties");i.HierarchicalProperties=s.HierarchicalProperties;var n=t("./base/OrientationMode");i.OrientationMode=n.OrientationMode;var a=t("./base/Style");i.Style=a.Style;var o=t("./base/Timeline");i.Timeline=o.Timeline;var l=t("./base/TouchPoint");i.TouchPoint=l.TouchPoint;var h=t("./base/Transform");i.Transform=h.Transform},{"./base/AlignmentMode":"awayjs-display/lib/base/AlignmentMode","./base/HierarchicalProperties":"awayjs-display/lib/base/HierarchicalProperties","./base/OrientationMode":"awayjs-display/lib/base/OrientationMode","./base/Style":"awayjs-display/lib/base/Style","./base/Timeline":"awayjs-display/lib/base/Timeline","./base/TouchPoint":"awayjs-display/lib/base/TouchPoint","./base/Transform":"awayjs-display/lib/base/Transform"}],"awayjs-display/lib/bounds/AxisAlignedBoundingBox":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/geom/PlaneClassification");var n=t("../graphics/ElementsType");var a=t("../bounds/BoundingVolumeBase");var o=t("../prefabs/PrimitiveCubePrefab");var l=function(t){r(e,t);function e(e){t.call(this,e);this._x=0;this._y=0;this._z=0;this._width=0;this._height=0;this._depth=0;this._centerX=0;this._centerY=0;this._centerZ=0;this._halfExtentsX=0;this._halfExtentsY=0;this._halfExtentsZ=0}e.prototype.nullify=function(){this._x=this._y=this._z=0;this._width=this._height=this._depth=0;this._centerX=this._centerY=this._centerZ=0;this._halfExtentsX=this._halfExtentsY=this._halfExtentsZ=0};e.prototype.isInFrustum=function(t,e){if(this._pInvalidated)this._pUpdate();for(var i=0;i<e;++i){var r=t[i];var s=r.a;var n=r.b;var a=r.c;var o=s<0?-this._halfExtentsX:this._halfExtentsX;var l=n<0?-this._halfExtentsY:this._halfExtentsY;var h=a<0?-this._halfExtentsZ:this._halfExtentsZ;var p=s*(this._centerX+o)+n*(this._centerY+l)+a*(this._centerZ+h)-r.d;if(p<0)return false}return true};e.prototype.rayIntersection=function(t,e,i){if(this._pInvalidated)this._pUpdate();return this._box.rayIntersection(t,e,i)};e.prototype.classifyToPlane=function(t){var e=t.a;var i=t.b;var r=t.c;var n=e*this._centerX+i*this._centerY+r*this._centerZ-t.d;if(e<0)e=-e;if(i<0)i=-i;if(r<0)r=-r;var a=e*this._halfExtentsX+i*this._halfExtentsY+r*this._halfExtentsZ;return n>a?s.PlaneClassification.FRONT:n<-a?s.PlaneClassification.BACK:s.PlaneClassification.INTERSECT};e.prototype._pUpdate=function(){t.prototype._pUpdate.call(this);this._box=this._pEntity.getBox();var e=this._pEntity.sceneTransform;var i=this._box.width/2;var r=this._box.height/2;var s=this._box.depth/2;var n=this._box.x+i;var a=this._box.y+r;var o=this._box.z+s;var l=e.rawData;var h=l[0],p=l[4],u=l[8],c=l[12];var f=l[1],d=l[5],_=l[9],y=l[13];var v=l[2],m=l[6],b=l[10],g=l[14];this._centerX=n*h+a*p+o*u+c;this._centerY=n*f+a*d+o*_+y;this._centerZ=n*v+a*m+o*b+g;this._halfExtentsX=Math.abs(i*h+r*p+s*u);this._halfExtentsY=Math.abs(i*f+r*d+s*_);this._halfExtentsZ=Math.abs(i*v+r*m+s*b);if(this._prefab){this._prefab.width=this._box.width;this._prefab.height=this._box.height;this._prefab.depth=this._box.depth;this._pBoundsPrimitive.transform.matrix3D=e}this._width=this._halfExtentsX*2;this._height=this._halfExtentsY*2;this._depth=this._halfExtentsZ*2;this._x=this._centerX-this._halfExtentsX;this._y=this._centerY-this._halfExtentsY;this._z=this._centerZ-this._halfExtentsZ};e.prototype._pCreateBoundsPrimitive=function(){this._prefab=new o.PrimitiveCubePrefab(null,n.ElementsType.LINE);return this._prefab.getNewObject()};return e}(a.BoundingVolumeBase);i.AxisAlignedBoundingBox=l},{"../bounds/BoundingVolumeBase":"awayjs-display/lib/bounds/BoundingVolumeBase","../graphics/ElementsType":"awayjs-display/lib/graphics/ElementsType","../prefabs/PrimitiveCubePrefab":"awayjs-display/lib/prefabs/PrimitiveCubePrefab","awayjs-core/lib/geom/PlaneClassification":undefined}],"awayjs-display/lib/bounds/BoundingSphere":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/geom/PlaneClassification");var n=t("../graphics/ElementsType");var a=t("../bounds/BoundingVolumeBase");var o=t("../prefabs/PrimitiveSpherePrefab");var l=function(t){r(e,t);function e(e){t.call(this,e);this._radius=0;this._centerX=0;this._centerY=0;this._centerZ=0}e.prototype.nullify=function(){this._centerX=this._centerY=this._centerZ=0;this._radius=0};e.prototype.isInFrustum=function(t,e){if(this._pInvalidated)this._pUpdate();for(var i=0;i<e;++i){var r=t[i];var s=r.a<0?-this._radius:this._radius;var n=r.b<0?-this._radius:this._radius;var a=r.c<0?-this._radius:this._radius;var o=r.a*(this._centerX+s)+r.b*(this._centerY+n)+r.c*(this._centerZ+a)-r.d;if(o<0){return false}}return true};e.prototype.rayIntersection=function(t,e,i){if(this._pInvalidated)this._pUpdate();return this._sphere.rayIntersection(t,e,i)};e.prototype.classifyToPlane=function(t){var e=t.a;var i=t.b;var r=t.c;var n=e*this._centerX+i*this._centerY+r*this._centerZ-t.d;if(e<0)e=-e;if(i<0)i=-i;if(r<0)r=-r;var a=(e+i+r)*this._radius;return n>a?s.PlaneClassification.FRONT:n<-a?s.PlaneClassification.BACK:s.PlaneClassification.INTERSECT};e.prototype._pUpdate=function(){t.prototype._pUpdate.call(this);this._sphere=this._pEntity.getSphere();var e=this._pEntity.sceneTransform;var i=this._sphere.x;var r=this._sphere.y;var s=this._sphere.z;var n=this._sphere.radius;var a=e.rawData;var o=a[0],l=a[4],h=a[8],p=a[12];var u=a[1],c=a[5],f=a[9],d=a[13];var _=a[2],y=a[6],v=a[10],m=a[14];this._centerX=i*o+r*l+s*h+p;this._centerY=i*u+r*c+s*f+d;this._centerZ=i*_+r*y+s*v+m;var b=o+l+h;var g=u+c+f;var w=_+y+v;this._radius=n*Math.sqrt((b*b+g*g+w*w)/3);if(this._prefab){this._prefab.radius=n;this._pBoundsPrimitive.x=i;this._pBoundsPrimitive.y=r;this._pBoundsPrimitive.z=s;this._pBoundsPrimitive.transform.matrix3D=e}};e.prototype._pCreateBoundsPrimitive=function(){this._prefab=new o.PrimitiveSpherePrefab(null,n.ElementsType.LINE);return this._prefab.getNewObject()};return e}(a.BoundingVolumeBase);i.BoundingSphere=l},{"../bounds/BoundingVolumeBase":"awayjs-display/lib/bounds/BoundingVolumeBase","../graphics/ElementsType":"awayjs-display/lib/graphics/ElementsType","../prefabs/PrimitiveSpherePrefab":"awayjs-display/lib/prefabs/PrimitiveSpherePrefab","awayjs-core/lib/geom/PlaneClassification":undefined}],"awayjs-display/lib/bounds/BoundingVolumeBase":[function(t,e,i){"use strict";var r=t("awayjs-core/lib/errors/AbstractMethodError");var s=function(){function t(t){this._pInvalidated=true;this._pEntity=t}t.prototype.dispose=function(){this._pEntity=null;this._pBoundsPrimitive=null};Object.defineProperty(t.prototype,"boundsPrimitive",{get:function(){if(this._pBoundsPrimitive==null){this._pBoundsPrimitive=this._pCreateBoundsPrimitive();this._pInvalidated=true}if(this._pInvalidated)this._pUpdate();return this._pBoundsPrimitive},enumerable:true,configurable:true});t.prototype.nullify=function(){throw new r.AbstractMethodError};t.prototype.isInFrustum=function(t,e){throw new r.AbstractMethodError};t.prototype.clone=function(){throw new r.AbstractMethodError};t.prototype.rayIntersection=function(t,e,i){return-1};t.prototype.classifyToPlane=function(t){throw new r.AbstractMethodError};t.prototype._pUpdate=function(){this._pInvalidated=false};t.prototype.invalidate=function(){this._pInvalidated=true};t.prototype._pCreateBoundsPrimitive=function(){throw new r.AbstractMethodError};return t}();i.BoundingVolumeBase=s},{"awayjs-core/lib/errors/AbstractMethodError":undefined}],"awayjs-display/lib/bounds/BoundsType":[function(t,e,i){"use strict";var r=function(){function t(){}t.SPHERE="sphere";t.AXIS_ALIGNED_BOX="axisAlignedBox";t.NULL="null";return t}();i.BoundsType=r},{}],"awayjs-display/lib/bounds/NullBounds":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/geom/PlaneClassification");var n=t("../bounds/BoundingVolumeBase");var a=function(t){r(e,t);function e(e){if(e===void 0){e=true}t.call(this,null);this._alwaysIn=e}e.prototype.clone=function(){return new e(this._alwaysIn)};e.prototype.isInFrustum=function(t,e){return this._alwaysIn};e.prototype.classifyToPlane=function(t){return s.PlaneClassification.INTERSECT};return e}(n.BoundingVolumeBase);i.NullBounds=a},{"../bounds/BoundingVolumeBase":"awayjs-display/lib/bounds/BoundingVolumeBase","awayjs-core/lib/geom/PlaneClassification":undefined}],"awayjs-display/lib/bounds":[function(t,e,i){"use strict";var r=t("./bounds/AxisAlignedBoundingBox");i.AxisAlignedBoundingBox=r.AxisAlignedBoundingBox;var s=t("./bounds/BoundingSphere");i.BoundingSphere=s.BoundingSphere;var n=t("./bounds/BoundingVolumeBase");i.BoundingVolumeBase=n.BoundingVolumeBase;var a=t("./bounds/BoundsType");i.BoundsType=a.BoundsType;var o=t("./bounds/NullBounds");i.NullBounds=o.NullBounds},{"./bounds/AxisAlignedBoundingBox":"awayjs-display/lib/bounds/AxisAlignedBoundingBox","./bounds/BoundingSphere":"awayjs-display/lib/bounds/BoundingSphere","./bounds/BoundingVolumeBase":"awayjs-display/lib/bounds/BoundingVolumeBase","./bounds/BoundsType":"awayjs-display/lib/bounds/BoundsType","./bounds/NullBounds":"awayjs-display/lib/bounds/NullBounds"}],"awayjs-display/lib/controllers/ControllerBase":[function(t,e,i){"use strict";var r=t("awayjs-core/lib/errors/AbstractMethodError");var s=function(){function t(t){if(t===void 0){t=null}this._pAutoUpdate=true;this.targetObject=t}t.prototype.pNotifyUpdate=function(){if(this._pTargetObject)this._pTargetObject.invalidatePartitionBounds()};Object.defineProperty(t.prototype,"targetObject",{get:function(){return this._pTargetObject},set:function(t){if(this._pTargetObject==t)return;if(this._pTargetObject&&this._pAutoUpdate)this._pTargetObject._iController=null;this._pTargetObject=t;if(this._pTargetObject&&this._pAutoUpdate)this._pTargetObject._iController=this;this.pNotifyUpdate()},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._pAutoUpdate},set:function(t){if(this._pAutoUpdate==t)return;this._pAutoUpdate=t;if(this._pTargetObject){if(this._pAutoUpdate)this._pTargetObject._iController=this;else this._pTargetObject._iController=null}},enumerable:true,configurable:true});t.prototype.update=function(t){if(t===void 0){t=true}throw new r.AbstractMethodError};t.prototype.updateController=function(){if(this._pControllerDirty&&this._pAutoUpdate){this._pControllerDirty=false;this.pNotifyUpdate()}};return t}();i.ControllerBase=s},{"awayjs-core/lib/errors/AbstractMethodError":undefined}],"awayjs-display/lib/controllers/FirstPersonController":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)};var s=t("awayjs-core/lib/geom/MathConsts");var n=t("../controllers/ControllerBase");var a=function(t){r(e,t);function e(e,i,r,s,n,a,o){if(e===void 0){e=null}if(i===void 0){i=0}if(r===void 0){r=90}if(s===void 0){s=-90}if(n===void 0){n=90}if(a===void 0){a=8}if(o===void 0){o=false}t.call(this,e);this._iCurrentPanAngle=0;this._iCurrentTiltAngle=90;this._panAngle=0;this._tiltAngle=90;this._minTiltAngle=-90;this._maxTiltAngle=90;this._steps=8;this._walkIncrement=0;this._strafeIncrement=0;this._wrapPanAngle=false;this.fly=false;this.panAngle=i;this.tiltAngle=r;this.minTiltAngle=s;this.maxTiltAngle=n;this.steps=a;this.wrapPanAngle=o;this._iCurrentPanAngle=this._panAngle;this._iCurrentTiltAngle=this._tiltAngle}Object.defineProperty(e.prototype,"steps",{get:function(){return this._steps},set:function(t){t=t<1?1:t;if(this._steps==t)return;this._steps=t;this.pNotifyUpdate()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"panAngle",{get:function(){return this._panAngle},set:function(t){if(this._panAngle==t)return;this._panAngle=t;this.pNotifyUpdate()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"tiltAngle",{get:function(){return this._tiltAngle},set:function(t){t=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,t));if(this._tiltAngle==t)return;this._tiltAngle=t;this.pNotifyUpdate()},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"minTiltAngle",{get:function(){return this._minTiltAngle},set:function(t){if(this._minTiltAngle==t)return;this._minTiltAngle=t;this.tiltAngle=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,this._tiltAngle))},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"maxTiltAngle",{get:function(){return this._maxTiltAngle},set:function(t){if(this._maxTiltAngle==t)return;this._maxTiltAngle=t;this.tiltAngle=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,this._tiltAngle))},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"wrapPanAngle",{get:function(){return this._wrapPanAngle},set:function(t){if(this._wrapPanAngle==t)return;this._wrapPanAngle=t;this.pNotifyUpdate()},enumerable:true,configurable:true});e.prototype.update=function(t){if(t===void 0){t=true}if(this._tiltAngle!=this._iCurrentTiltAngle||this._panAngle!=this._iCurrentPanAngle){this._pControllerDirty=true;if(this._wrapPanAngle){if(this._panAngle<0){this._iCurrentPanAngle+=this._panAngle%360+360-this._panAngle;this._panAngle=this._panAngle%360+360}else{this._iCurrentPanAngle+=this._panAngle%360-this._panAngle;this._panAngle=this._panAngle%360}while(this._panAngle-this._iCurrentPanAngle<-180)this._iCurrentPanAngle-=360;while(this._panAngle-this._iCurrentPanAngle>180)this._iCurrentPanAngle+=360}if(t){this._iCurrentTiltAngle+=(this._tiltAngle-this._iCurrentTiltAngle)/(this.steps+1);this._iCurrentPanAngle+=(this._panAngle-this._iCurrentPanAngle)/(this.steps+1)}else{this._iCurrentTiltAngle=this._tiltAngle;this._iCurrentPanAngle=this._panAngle}if(Math.abs(this.tiltAngle-this._iCurrentTiltAngle)<.01&&Math.abs(this._panAngle-this._iCurrentPanAngle)<.01){this._iCurrentTiltAngle=this._tiltAngle;this._iCurrentPanAngle=this._panAngle}}this.targetObject.rotationX=this._iCurrentTiltAngle;this.targetObject.rotationY=this._iCurrentPanAngle;if(this._walkIncrement){if(this.fly){this.targetObject.transform.moveForward(this._walkIncrement)}else{this.targetObject.x+=this._walkIncrement*Math.sin(this._panAngle*s.MathConsts.DEGREES_TO_RADIANS);this.targetObject.z+=this._walkIncrement*Math.cos(this._panAngle*s.MathConsts.DEGREES_TO_RADIANS)}this._walkIncrement=0}if(this._strafeIncrement){this.targetObject.transform.moveRight(this._strafeIncrement);this._strafeIncrement=0}};e.prototype.incrementWalk=function(t){if(t==0)return;this._walkIncrement+=t;this.pNotifyUpdate()};e.prototype.incrementStrafe=function(t){if(t==0)return;this._strafeIncrement+=t;this.pNotifyUpdate()};return e}(n.ControllerBase);i.FirstPersonController=a},{"../controllers/ControllerBase":"awayjs-display/lib/controllers/ControllerBase","awayjs-core/lib/geom/MathConsts":undefined}],"awayjs-display/lib/controllers/FollowController":[function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i];