shadow-function
Version:
ioing lib - shadow Function, worker Function
1 lines • 857 kB
JavaScript
!function(c,e,x){x.un,x.uns;var u=x.static,m=x.class,g=x.getset,M=x.__newvec,i=(laya.ani.AnimationContent,laya.ani.AnimationPlayer),r=(laya.ani.AnimationState,laya.ani.AnimationTemplet),p=laya.maths.Arith,o=laya.webgl.atlas.AtlasResourceManager,n=laya.webgl.shader.BaseShader,C=laya.utils.Browser,s=laya.webgl.utils.Buffer,S=laya.utils.Byte,l=(laya.ani.bone.canvasmesh.CacheAbleSkinMesh,laya.utils.ClassUtils),h=x.Config,a=(laya.events.Event,laya.events.EventDispatcher),I=laya.utils.Handler,Ae=laya.net.Loader,t=laya.net.LoaderManager,H=laya.maths.MathUtil,_=laya.display.Node,d=laya.renders.Render,f=(laya.renders.RenderContext,laya.renders.RenderSprite,laya.webgl.utils.RenderState2D),v=laya.resource.Resource,E=laya.utils.RunDriver,D=(laya.webgl.shader.Shader,laya.webgl.utils.ShaderCompile),T=laya.display.Sprite,R=laya.utils.Stat,A=laya.utils.StringKey,N=(laya.display.css.Style,laya.resource.Texture,laya.net.URL),y=laya.utils.Utils,w=laya.webgl.WebGL,O=laya.webgl.WebGLContext;laya.webgl.canvas.WebGLContext2D;x.interface("laya.d3.core.IClone"),x.interface("laya.d3.graphics.IVertex"),x.interface("laya.d3.core.render.IUpdate"),x.interface("laya.d3.core.scene.ITreeNode"),x.interface("laya.d3.core.render.IRenderable");var V=function(){function P(){}return m(P,"laya.d3.animation.AnimationClipParser01"),P.READ_DATA=function(){P._DATA.offset=P._reader.getUint32(),P._DATA.size=P._reader.getUint32()},P.READ_BLOCK=function(){for(var e=P._BLOCK.count=P._reader.getUint16(),t=P._BLOCK.blockStarts=[],n=P._BLOCK.blockLengths=[],i=0;i<e;i++)t.push(P._reader.getUint32()),n.push(P._reader.getUint32())},P.READ_STRINGS=function(){var e=P._reader.getUint32(),t=P._reader.getUint16(),n=P._reader.pos;P._reader.pos=e+P._DATA.offset;for(var i=0;i<t;i++)P._strings[i]=P._reader.readUTFString();P._reader.pos=n},P.parse=function(e,t){P._animationClip=e;(P._reader=t).__getBuffer();P.READ_DATA(),P.READ_BLOCK(),P.READ_STRINGS();for(var n=0,i=P._BLOCK.count;n<i;n++){var r=t.getUint16(),a=P._strings[r],o=P["READ_"+a];if(null==o)throw new Error("model file err,no this function:"+r+" "+a);o.call()}},P.READ_ANIMATIONS=function(){var e,t=0,n=0,i=P._reader,r=i.__getBuffer(),a=[],o=i.getUint8();for(a.length=o,t=0;t<o;t++)a[t]=i.getUint16();var s=[],l=i.getUint16();for(s.length=l,t=0;t<l;t++)s[t]=i.getFloat32();var h=P._animationClip;h.name=P._strings[i.getUint16()];var _=h._duration=i.getFloat32();h.islooping=!!i.getByte(),h._frameRate=i.getInt16();var u=i.getInt16(),c=h._nodes=new Array;c.length=u,(h._publicClipDatas=[]).length=u;var d=h._nodesMap={},f=0,m=0;for(t=0;t<u;t++){e=c[t]=new k;var p=i.getUint16(),v=e.path=[];for(v.length=p,n=0;n<p;n++)v[n]=P._strings[i.getUint16()];var g=v.join("/"),E=d[g];E||(d[g]=E=[]),E.push(e);var S=i.getInt16();-1!==S&&(e.componentType=P._strings[S]);var D=G._propertyIndexDic[P._strings[i.getUint16()]];if(null==D)throw new Error("AnimationClipParser01:unknown property name.");var T=D<4,x=!T||T&&""===v[0];(e._cacheProperty=x)?f++:m++,e.propertyNameID=D;var M=a[i.getUint8()];e.keyFrameWidth=M/4;var R=e.keyFrames=[],A=R.length=i.getUint16(),I=null,y=NaN;for(n=0;n<A;n++){var C=R[n]=new z;y=C.startTime=s[i.getUint16()];var N=i.pos;C.inTangent=new Float32Array(r.slice(N,N+M)),i.pos+=M,N=i.pos,C.outTangent=new Float32Array(r.slice(N,N+M)),i.pos+=M,N=i.pos,C.data=new Float32Array(r.slice(N,N+M)),i.pos+=M,I&&(I.next=C,I.duration=y-I.startTime),I=C}C.next=null,C.duration=_-y}var w=h._nodeToCachePropertyMap=new Int32Array(u),O=h._cachePropertyMap=new Int32Array(f),V=h._unCachePropertyMap=new Int32Array(m);for(f=m=0,t=0;t<u;t++)(e=c[t])._cacheProperty?(w[t]=f,O[f++]=t):V[m++]=t},P._animationClip=null,P._reader=null,P._strings=[],u(P,["_BLOCK",function(){return this._BLOCK={count:0}},"_DATA",function(){return this._DATA={offset:0,size:0}}]),P}(),P=function(){function B(){}return m(B,"laya.d3.animation.AnimationClipParser02"),B.READ_DATA=function(){B._DATA.offset=B._reader.getUint32(),B._DATA.size=B._reader.getUint32()},B.READ_BLOCK=function(){for(var e=B._BLOCK.count=B._reader.getUint16(),t=B._BLOCK.blockStarts=[],n=B._BLOCK.blockLengths=[],i=0;i<e;i++)t.push(B._reader.getUint32()),n.push(B._reader.getUint32())},B.READ_STRINGS=function(){var e=B._reader.getUint32(),t=B._reader.getUint16(),n=B._reader.pos;B._reader.pos=e+B._DATA.offset;for(var i=0;i<t;i++)B._strings[i]=B._reader.readUTFString();B._reader.pos=n},B.parse=function(e,t){B._animationClip=e;(B._reader=t).__getBuffer();B.READ_DATA(),B.READ_BLOCK(),B.READ_STRINGS();for(var n=0,i=B._BLOCK.count;n<i;n++){var r=t.getUint16(),a=B._strings[r],o=B["READ_"+a];if(null==o)throw new Error("model file err,no this function:"+r+" "+a);o.call()}},B.READ_ANIMATIONS=function(){var e,t=0,n=0,i=B._reader,r=i.__getBuffer(),a=[],o=i.getUint8();for(a.length=o,t=0;t<o;t++)a[t]=i.getUint16();var s=[],l=i.getUint16();for(s.length=l,t=0;t<l;t++)s[t]=i.getFloat32();var h=B._animationClip;h.name=B._strings[i.getUint16()];var _=h._duration=i.getFloat32();h.islooping=!!i.getByte(),h._frameRate=i.getInt16();var u=i.getInt16(),c=h._nodes=new Array;c.length=u,(h._publicClipDatas=[]).length=u;var d=h._nodesMap={},f=0,m=0;for(t=0;t<u;t++){e=c[t]=new k;var p=i.getUint16(),v=e.path=[];for(v.length=p,n=0;n<p;n++)v[n]=B._strings[i.getUint16()];var g=v.join("/"),E=d[g];E||(d[g]=E=[]),E.push(e);var S=i.getInt16();-1!==S&&(e.componentType=B._strings[S]);var D=G._propertyIndexDic[B._strings[i.getUint16()]];if(null==D)throw new Error("AnimationClipParser02:unknown property name.");var T=D<4,x=!T||T&&""===v[0];(e._cacheProperty=x)?f++:m++,e.propertyNameID=D;var M=a[i.getUint8()];e.keyFrameWidth=M/4;var R=e.keyFrames=[],A=R.length=i.getUint16(),I=null,y=NaN;for(n=0;n<A;n++){var C=R[n]=new z;y=C.startTime=s[i.getUint16()];var N=i.pos;C.inTangent=new Float32Array(r.slice(N,N+M)),i.pos+=M,N=i.pos,C.outTangent=new Float32Array(r.slice(N,N+M)),i.pos+=M,N=i.pos,C.data=new Float32Array(r.slice(N,N+M)),i.pos+=M,I&&(I.next=C,I.duration=y-I.startTime),I=C}C.next=null,C.duration=_-y}var w=i.getUint16();for(t=0;t<w;t++){var O,V=new U;V.time=i.getFloat32(),V.eventName=B._strings[i.getUint16()];var P=i.getUint16();for(0<P&&(V.params=O=[]),n=0;n<P;n++){switch(i.getByte()){case 0:O.push(!!i.getByte());break;case 1:O.push(i.getInt32());break;case 2:O.push(i.getFloat32());break;case 3:O.push(B._strings[i.getUint16()]);break;default:throw new Error("unknown type.")}}h.addEvent(V)}var L=h._nodeToCachePropertyMap=new Int32Array(u),b=h._cachePropertyMap=new Int32Array(f),F=h._unCachePropertyMap=new Int32Array(m);for(f=m=0,t=0;t<u;t++)(e=c[t])._cacheProperty?(L[t]=f,b[f++]=t):F[m++]=t},B._animationClip=null,B._reader=null,B._strings=[],u(B,["_BLOCK",function(){return this._BLOCK={count:0}},"_DATA",function(){return this._DATA={offset:0,size:0}}]),B}(),U=function(){function e(){this.time=NaN,this.eventName=null,this.params=null}return m(e,"laya.d3.animation.AnimationEvent"),e}(),G=function(){function i(){this._childs=[],this.transform=new $t(this)}m(i,"laya.d3.animation.AnimationNode");var e=i.prototype;return x.imps(e,{"laya.d3.core.IClone":!0}),e.addChild=function(e){e._parent=this,e.transform.setParent(this.transform),this._childs.push(e)},e.removeChild=function(e){var t=this._childs.indexOf(e);-1!==t&&this._childs.splice(t,1)},e.getChildByName=function(e){for(var t=0,n=this._childs.length;t<n;t++){var i=this._childs[t];if(i.name===e)return i}return null},e.getChildByIndex=function(e){return this._childs[e]},e.getChildCount=function(){return this._childs.length},e.cloneTo=function(e){var t=e;t.name=this.name;for(var n=0,i=this._childs.length;n<i;n++){var r=this._childs[n],a=r.clone();t.addChild(a);var o=r.transform,s=a.transform;s.setLocalPosition(o.getLocalPosition()),s.setLocalRotation(o.getLocalRotation()),s.setLocalScale(o.getLocalScale()),s._localRotationEuler=o._localRotationEuler,s._setWorldMatrixIgnoreUpdate(o.getWorldMatrix())}},e.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},i.__init__=function(){i.registerAnimationNodeProperty("localPosition",i._getLocalPosition,i._setLocalPosition),i.registerAnimationNodeProperty("localRotation",i._getLocalRotation,i._setLocalRotation),i.registerAnimationNodeProperty("localScale",i._getLocalScale,i._setLocalScale),i.registerAnimationNodeProperty("localRotationEuler",i._getLocalRotationEuler,i._setLocalRotationEuler),i.registerAnimationNodeProperty("particleRender.sharedMaterial.tintColor",i._getParticleRenderSharedMaterialTintColor,i._setParticleRenderSharedMaterialTintColor),i.registerAnimationNodeProperty("meshRender.sharedMaterial.tilingOffset",i._getMeshRenderSharedMaterialTilingOffset,i._setMeshRenderSharedMaterialTilingOffset),i.registerAnimationNodeProperty("meshRender.sharedMaterial.albedoColor",i._getMeshRenderSharedMaterialAlbedo,i._setMeshRenderSharedMaterialAlbedo),i.registerAnimationNodeProperty("skinnedMeshRender.sharedMaterial.tilingOffset",i._getSkinnedMeshRenderSharedMaterialTilingOffset,i._setSkinnedMeshRenderSharedMaterialTilingOffset),i.registerAnimationNodeProperty("skinnedMeshRender.sharedMaterial.albedoColor",i._getSkinnedMeshRenderSharedMaterialAlbedo,i._setSkinnedMeshRenderSharedMaterialAlbedo),i.registerAnimationNodeProperty("meshRender.sharedMaterial.albedo",i._getMeshRenderSharedMaterialAlbedo,i._setMeshRenderSharedMaterialAlbedo),i.registerAnimationNodeProperty("skinnedMeshRender.sharedMaterial.albedo",i._getSkinnedMeshRenderSharedMaterialAlbedo,i._setSkinnedMeshRenderSharedMaterialAlbedo),i.registerAnimationNodeProperty("meshRender.sharedMaterial.intensity",i._getMeshRenderSharedMaterialIntensity,i._setMeshRenderSharedMaterialIntensity),i.registerAnimationNodeProperty("meshRender.sharedMaterial.alpha",i._getMeshRenderSharedMaterialAlpha,i._setMeshRenderSharedMaterialAlpha),i.registerAnimationNodeProperty("meshRender.sharedMaterial.alphaColor",i._getMeshRenderSharedMaterialAlphaColor,i._setMeshRenderSharedMaterialAlphaColor),i.registerAnimationNodeProperty("meshRender.sharedMaterial.baseColor",i._getMeshRenderSharedMaterialBaseColor,i._setMeshRenderSharedMaterialBaseColor),i.registerAnimationNodeProperty("meshRender.sharedMaterial.dissolve",i._getMeshRenderSharedMaterialDissolve,i._setMeshRenderSharedMaterialDissolve),i.registerAnimationNodeProperty("meshRender.sharedMaterial.dissolveSpeed",i._getMeshRenderSharedMaterialDissolveSpeed,i._setMeshRenderSharedMaterialDissolveSpeed),i.registerAnimationNodeProperty("meshRender.sharedMaterial.mMultiplier",i._getMeshRenderSharedMaterialMMultiplier,i._setMeshRenderSharedMaterialMMultiplier),i.registerAnimationNodeProperty("meshRender.sharedMaterial.baseScrollSpeedX",i._getMeshRenderSharedMaterialBaseScrollSpeedX,i._setMeshRenderSharedMaterialBaseScrollSpeedX),i.registerAnimationNodeProperty("meshRender.sharedMaterial.baseScrollSpeedY",i._getMeshRenderSharedMaterialBaseScrollSpeedY,i._setMeshRenderSharedMaterialBaseScrollSpeedY),i.registerAnimationNodeProperty("meshRender.sharedMaterial.secondScrollSpeedX",i._getMeshRenderSharedMaterialSecondScrollSpeedX,i._setMeshRenderSharedMaterialSecondScrollSpeedX),i.registerAnimationNodeProperty("meshRender.sharedMaterial.secondScrollSpeedY",i._getMeshRenderSharedMaterialSecondScrollSpeedY,i._setMeshRenderSharedMaterialSecondScrollSpeedY),i.registerAnimationNodeProperty("meshRender.sharedMaterial.detailTilingOffset",i._getMeshRenderSharedMaterialDetailTilingOffset,i._setMeshRenderSharedMaterialDetailTilingOffset),i.registerAnimationNodeProperty("meshRender.sharedMaterial.dissolveTilingOffset",i._getMeshRenderSharedMaterialDissolveTilingOffset,i._setMeshRenderSharedMaterialDissolveTilingOffset),i.registerAnimationNodeProperty("meshRender.sharedMaterial.maskTilingOffset",i._getMeshRenderSharedMaterialMaskTilingOffset,i._setMeshRenderSharedMaterialMaskTilingOffset)},i.registerAnimationNodeProperty=function(e,t,n){if(i._propertyIndexDic[e])throw new Error("AnimationNode: this propertyName has registered.");i._propertyIndexDic[e]=i._propertyIDCounter,i._propertyGetFuncs[i._propertyIDCounter]=t,i._propertySetFuncs[i._propertyIDCounter]=n,i._propertyIDCounter++},i._getLocalPosition=function(e,t){return e?e.transform.getLocalPosition():t._transform.localPosition.elements},i._setLocalPosition=function(e,t,n){if(e)e.transform.setLocalPosition(n);else{var i=t._transform,r=i.localPosition;r.elements=n,i.localPosition=r}},i._getLocalRotation=function(e,t){return e?e.transform.getLocalRotation():t._transform.localRotation.elements},i._setLocalRotation=function(e,t,n){if(e)e.transform.setLocalRotation(n);else{var i=t._transform,r=i.localRotation;r.elements=n,i.localRotation=r}},i._getLocalScale=function(e,t){return e?e.transform.getLocalScale():t._transform.localScale.elements},i._setLocalScale=function(e,t,n){if(e)e.transform.setLocalScale(n);else{var i=t._transform,r=i.localScale;r.elements=n,i.localScale=r}},i._getLocalRotationEuler=function(e,t){return e?e.transform.getLocalRotationEuler():t._transform.localRotationEuler.elements},i._setLocalRotationEuler=function(e,t,n){if(e)e.transform.setLocalRotationEuler(n);else{var i=t._transform,r=i.localRotationEuler;r.elements=n,i.localRotationEuler=r}},i._getMeshRenderSharedMaterialTilingOffset=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.tilingOffset.elements:null}return t.meshRender.sharedMaterial.tilingOffset.elements},i._setMeshRenderSharedMaterialTilingOffset=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).tilingOffset).elements=n,i.tilingOffset=r)}else(r=(i=t.meshRender.material).tilingOffset).elements=n,i.tilingOffset=r},i._getMeshRenderSharedMaterialAlbedo=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.albedoColor.elements:null}return t.meshRender.sharedMaterial.albedoColor.elements},i._setMeshRenderSharedMaterialAlbedo=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).albedoColor).elements=n,i.albedoColor=r)}else(r=(i=t.meshRender.material).albedoColor).elements=n,i.albedoColor=r},i._getSkinnedMeshRenderSharedMaterialTilingOffset=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.skinnedMeshRender.sharedMaterial.tilingOffset.elements:null}return t.skinnedMeshRender.sharedMaterial.tilingOffset.elements},i._setSkinnedMeshRenderSharedMaterialTilingOffset=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.skinnedMeshRender.material).tilingOffset).elements=n,i.tilingOffset=r)}else(r=(i=t.skinnedMeshRender.material).tilingOffset).elements=n,i.tilingOffset=r},i._getSkinnedMeshRenderSharedMaterialAlbedo=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.skinnedMeshRender.sharedMaterial.albedoColor.elements:null}return t.skinnedMeshRender.sharedMaterial.albedoColor.elements},i._setSkinnedMeshRenderSharedMaterialAlbedo=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.skinnedMeshRender.material).albedoColor).elements=n,i.albedoColor=r)}else(r=(i=t.skinnedMeshRender.material).albedoColor).elements=n,i.albedoColor=r},i._getParticleRenderSharedMaterialTintColor=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.particleRender.sharedMaterial.tintColor.elements:null}return t.particleRender.sharedMaterial.tintColor.elements},i._setParticleRenderSharedMaterialTintColor=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.particleRender.material).tintColor).elements=n,i.tintColor=r)}else(r=(i=t.particleRender.material).tintColor).elements=n,i.tintColor=r},i._getMeshRenderSharedMaterialAlphaColor=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.alphaColor.elements:null}return t.meshRender.sharedMaterial.alphaColor.elements},i._setMeshRenderSharedMaterialAlphaColor=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).alphaColor).elements=n,i.alphaColor=r)}else(r=(i=t.meshRender.material).alphaColor).elements=n,i.alphaColor=r},i._getMeshRenderSharedMaterialBaseColor=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.baseColor.elements:null}return t.meshRender.sharedMaterial.baseColor.elements},i._setMeshRenderSharedMaterialBaseColor=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).baseColor).elements=n,i.baseColor=r)}else(r=(i=t.meshRender.material).baseColor).elements=n,i.baseColor=r},i._getMeshRenderSharedMaterialDissolve=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.dissolve:0}return t.meshRender.sharedMaterial.dissolve},i._setMeshRenderSharedMaterialDissolve=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.dissolve=n[0])}else t.meshRender.material.dissolve=n[0]},i._getMeshRenderSharedMaterialDissolveSpeed=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.dissolveSpeed:0}return t.meshRender.sharedMaterial.dissolveSpeed},i._setMeshRenderSharedMaterialDissolveSpeed=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.dissolveSpeed=n[0])}else t.meshRender.material.dissolveSpeed=n[0]},i._getMeshRenderSharedMaterialMMultiplier=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.mMultiplier:0}return t.meshRender.sharedMaterial.mMultiplier},i._setMeshRenderSharedMaterialMMultiplier=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.mMultiplier=n[0])}else t.meshRender.material.mMultiplier=n[0]},i._getMeshRenderSharedMaterialBaseScrollSpeedX=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.baseScrollSpeedX:0}return t.meshRender.sharedMaterial.baseScrollSpeedX},i._setMeshRenderSharedMaterialBaseScrollSpeedX=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.baseScrollSpeedX=n[0])}else t.meshRender.material.baseScrollSpeedX=n[0]},i._getMeshRenderSharedMaterialBaseScrollSpeedY=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.baseScrollSpeedY:0}return t.meshRender.sharedMaterial.baseScrollSpeedY},i._setMeshRenderSharedMaterialBaseScrollSpeedY=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.baseScrollSpeedY=n[0])}else t.meshRender.material.baseScrollSpeedY=n[0]},i._getMeshRenderSharedMaterialSecondScrollSpeedX=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.secondScrollSpeedX:0}return t.meshRender.sharedMaterial.secondScrollSpeedX},i._setMeshRenderSharedMaterialSecondScrollSpeedX=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.secondScrollSpeedX=n[0])}else t.meshRender.material.secondScrollSpeedX=n[0]},i._getMeshRenderSharedMaterialSecondScrollSpeedY=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.secondScrollSpeedY:0}return t.meshRender.sharedMaterial.secondScrollSpeedY},i._setMeshRenderSharedMaterialSecondScrollSpeedY=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.secondScrollSpeedY=n[0])}else t.meshRender.material.secondScrollSpeedY=n[0]},i._getMeshRenderSharedMaterialAlpha=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.alpha:0}return t.meshRender.sharedMaterial.alpha},i._setMeshRenderSharedMaterialAlpha=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.alpha=n[0])}else t.meshRender.material.alpha=n[0]},i._getMeshRenderSharedMaterialIntensity=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.intensity:0}return t.meshRender.sharedMaterial.intensity},i._setMeshRenderSharedMaterialIntensity=function(e,t,n){if(e){var i=e.transform._entity;i&&(i.owner.meshRender.material.intensity=n[0])}else t.meshRender.material.intensity=n[0]},i._getMeshRenderSharedMaterialDetailTilingOffset=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.detailTilingOffset.elements:null}return t.meshRender.sharedMaterial.detailTilingOffset.elements},i._setMeshRenderSharedMaterialDetailTilingOffset=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).detailTilingOffset).elements=n,i.detailTilingOffset=r)}else(r=(i=t.meshRender.material).detailTilingOffset).elements=n,i.detailTilingOffset=r},i._getMeshRenderSharedMaterialDissolveTilingOffset=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.dissolveTilingOffset.elements:null}return t.meshRender.sharedMaterial.dissolveTilingOffset.elements},i._setMeshRenderSharedMaterialDissolveTilingOffset=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).dissolveTilingOffset).elements=n,i.dissolveTilingOffset=r)}else(r=(i=t.meshRender.material).dissolveTilingOffset).elements=n,i.dissolveTilingOffset=r},i._getMeshRenderSharedMaterialMaskTilingOffset=function(e,t){if(e){var n=e.transform._entity;return n?n.owner.meshRender.sharedMaterial.maskTilingOffset.elements:null}return t.meshRender.sharedMaterial.maskTilingOffset.elements},i._setMeshRenderSharedMaterialMaskTilingOffset=function(e,t,n){var i,r;if(e){var a=e.transform._entity;a&&((r=(i=a.owner.meshRender.material).maskTilingOffset).elements=n,i.maskTilingOffset=r)}else(r=(i=t.meshRender.material).maskTilingOffset).elements=n,i.maskTilingOffset=r},i._propertyIDCounter=0,i._propertyIndexDic={},i._propertySetFuncs=[],i._propertyGetFuncs=[],i}(),z=function(){function e(){this.startTime=NaN,this.inTangent=null,this.outTangent=null,this.data=null,this.duration=NaN,this.next=null}return m(e,"laya.d3.animation.Keyframe"),e}(),k=function(){function e(){this._cacheProperty=!1,this.path=null,this.componentType=null,this.propertyNameID=0,this.keyFrameWidth=0,this.defaultData=null,this.keyFrames=null}return m(e,"laya.d3.animation.KeyframeNode"),e}(),L=function(){function e(){this._tempVector30=new Vt,this._tempVector31=new Vt,this._tempVector32=new Vt,this._a=new Vt,this._b=new Vt,this._c=new Vt,this._d=new Vt}m(e,"laya.d3.core.glitter.SplineCurvePositionVelocity");var t=e.prototype;return t.Init=function(e,t,n,i){e.cloneTo(this._d),t.cloneTo(this._c),Vt.scale(e,2,this._a),Vt.scale(n,2,this._tempVector30),Vt.subtract(this._a,this._tempVector30,this._a),Vt.add(this._a,t,this._a),Vt.add(this._a,i,this._a),Vt.scale(n,3,this._b),Vt.scale(e,3,this._tempVector30),Vt.subtract(this._b,this._tempVector30,this._b),Vt.subtract(this._b,i,this._b),Vt.scale(t,2,this._tempVector30),Vt.subtract(this._b,this._tempVector30,this._b)},t.Slerp=function(e,t){Vt.scale(this._a,e*e*e,this._tempVector30),Vt.scale(this._b,e*e,this._tempVector31),Vt.scale(this._c,e,this._tempVector32),Vt.add(this._tempVector30,this._tempVector31,t),Vt.add(t,this._tempVector32,t),Vt.add(t,this._d,t)},e}(),b=function(){function b(e,t,n,i){this._datas=null,this._w=0,this._h=0,this._minHeight=NaN,this._maxHeight=NaN,this._datas=[],this._w=e,this._h=t,this._minHeight=n,this._maxHeight=i}m(b,"laya.d3.core.HeightMap");var e=b.prototype;return e._inBounds=function(e,t){return 0<=e&&e<this._h&&0<=t&&t<this._w},e.getHeight=function(e,t){return this._inBounds(e,t)?this._datas[e][t]:NaN},g(0,e,"width",function(){return this._w}),g(0,e,"height",function(){return this._h}),g(0,e,"maxHeight",function(){return this._maxHeight}),g(0,e,"minHeight",function(){return this._minHeight}),b.creatFromMesh=function(e,t,n,i){for(var r=[],a=[],o=e.getSubMeshCount(),s=0;s<o;s++){for(var l=e.getSubMesh(s),h=l._getVertexBuffer(),_=h.getData(),u=[],c=0;c<_.length;c+=h.vertexDeclaration.vertexStride/4){var d=new Vt(_[c+0],_[c+1],_[c+2]);u.push(d)}r.push(u);var f=l._getIndexBuffer();a.push(f.getData())}var m=e.boundingBox,p=m.min.x,v=m.min.z,g=m.max.x,E=m.max.z,S=m.min.y,D=m.max.y,T=g-p,x=E-v,M=i.elements[0]=T/(t-1),R=i.elements[1]=x/(n-1),A=new b(t,n,S,D),I=b._tempRay,y=I.direction.elements;y[0]=0,y[1]=-1,y[2]=0;var C=D+.1;I.origin.elements[1]=C;for(var N=0;N<n;N++){var w=v+N*R;A._datas[N]=[];for(var O=0;O<t;O++){var V=p+O*M,P=I.origin.elements;P[0]=V,P[2]=w;var L=b._getPosition(I,r,a);A._datas[N][O]=L===Number.MAX_VALUE?NaN:C-L}}return A},b.createFromImage=function(e,t,n){for(var i=e.width,r=e.height,a=new b(i,r,t,n),o=(n-t)/254,s=e.getPixels(),l=0,h=0;h<r;h++)for(var _=a._datas[h]=[],u=0;u<i;u++){var c=s[l++],d=s[l++],f=s[l++],m=s[l++];_[u]=255==c&&255==d&&255==f&&255==m?NaN:(c+d+f)/3*o+t}return a},b._getPosition=function(e,t,n){for(var i=Number.MAX_VALUE,r=0;r<t.length;r++)for(var a=t[r],o=n[r],s=0;s<o.length;s+=3){var l=a[o[s+0]],h=a[o[s+1]],_=a[o[s+2]],u=Yt.rayIntersectsTriangle(e,l,h,_);!isNaN(u)&&u<i&&(i=u)}return i},u(b,["_tempRay",function(){return this._tempRay=new wt(new Vt,new Vt)}]),b}(),F=function(){function r(){this._visible=!0,this._nonRigidbodyOffset=0,this._colliders=[]}m(r,"laya.d3.core.Layer");var e=r.prototype;return e._binarySearchIndex=function(){for(var e=0,t=r._collsionTestList.length-1,n=0;e<=t;){n=Math.floor((e+t)/2);var i=r._collsionTestList[n];if(i==this._number)return n;i>this._number?t=n-1:e=n+1}return e},e._addCollider=function(e){0===this._colliders.length&&r._collsionTestList.splice(this._binarySearchIndex(),0,this._number),e._isRigidbody?(this._colliders.unshift(e),this._nonRigidbodyOffset++):this._colliders.push(e)},e._removeCollider=function(e){var t=this._colliders.indexOf(e);t<this._nonRigidbodyOffset&&this._nonRigidbodyOffset--,this._colliders.splice(t,1),0===this._colliders.length&&r._collsionTestList.splice(r._collsionTestList.indexOf(this._number),1)},g(0,e,"number",function(){return this._number}),g(0,e,"visible",function(){return this._visible},function(e){this._visible=e,r._visibleLayers=e?r._visibleLayers|this.mask:r._visibleLayers&~this.mask}),g(0,e,"mask",function(){return this._mask}),g(1,r,"visibleLayers",function(){return r._visibleLayers},function(e){r._visibleLayers=e;for(var t=0,n=r._layerList.length;t<n;t++){var i=r._layerList[t];i._visible=0!=(i._mask&r._visibleLayers)}}),r.__init__=function(){r._layerList.length=31;for(var e=0;e<31;e++){var t=new r;(r._layerList[e]=t).visible=0===e?(t.name="Default Layer",!0):(t.name="Layer-"+e,!1),t._number=e,t._mask=Math.pow(2,e)}r.currentCreationLayer=r._layerList[0]},r.getLayerByNumber=function(e){if(e<0||30<e)throw new Error("无法返回指定Layer,该number超出范围!");return r._layerList[e]},r.getLayerByName=function(e){for(var t=0;t<31;t++)if(r._layerList[t].name===e)return r._layerList[t];throw new Error("无法返回指定Layer,该name不存在")},r.isVisible=function(e){return 0!=(e&r._currentCameraCullingMask&r._visibleLayers)},r._layerList=[],r._visibleLayers=2147483647,r._collsionTestList=[],r._currentCameraCullingMask=2147483647,r.maxCount=31,r.currentCreationLayer=null,r}(),Ie=function(){function e(e,t,n){this._time=NaN,this._minCount=0,this._maxCount=0,this._time=e,this._minCount=t,this._maxCount=n}m(e,"laya.d3.core.particleShuriKen.module.Burst");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0}),t.cloneTo=function(e){var t=e;t._time=this._time,t._minCount=this._minCount,t._maxCount=this._maxCount},t.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,t,"time",function(){return this._time}),g(0,t,"minCount",function(){return this._minCount}),g(0,t,"maxCount",function(){return this._maxCount}),e}(),ye=function(){function e(e){this._color=null,this.enbale=!1,this._color=e}m(e,"laya.d3.core.particleShuriKen.module.ColorOverLifetime");var t=e.prototype;return t.cloneTo=function(e){var t=e;this._color.cloneTo(t._color),t.enbale=this.enbale},t.clone=function(){var e;switch(this._color.type){case 0:e=we.createByConstant(this._color.constant.clone());break;case 1:e=we.createByGradient(this._color.gradient.clone());break;case 2:e=we.createByRandomTwoConstant(this._color.constantMin.clone(),this._color.constantMax.clone());break;case 3:e=we.createByRandomTwoGradient(this._color.gradientMin.clone(),this._color.gradientMax.clone())}var t=new this.constructor(e);return t.enbale=this.enbale,t},g(0,t,"color",function(){return this._color}),e}(),B=function(){function e(){this._destroyed=!1,this._emissionRate=0,this._bursts=null,this.enbale=!1,this._destroyed=!1,this.emissionRate=10,this._bursts=[]}m(e,"laya.d3.core.particleShuriKen.module.Emission");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0,"laya.resource.IDestroy":!0}),t._destroy=function(){this._bursts=null,this._destroyed=!0},t.getBurstsCount=function(){return this._bursts.length},t.getBurstByIndex=function(e){return this._bursts[e]},t.addBurst=function(e){var t=this._bursts.length;if(0<t)for(var n=0;n<t;n++)this._bursts[n].time>e.time&&this._bursts.splice(n,0,e);this._bursts.push(e)},t.removeBurst=function(e){var t=this._bursts.indexOf(e);-1!==t&&this._bursts.splice(t,1)},t.removeBurstByIndex=function(e){this._bursts.splice(e,1)},t.clearBurst=function(){this._bursts.length=0},t.cloneTo=function(e){var t=e,n=t._bursts;n.length=this._bursts.length;for(var i=0,r=this._bursts.length;i<r;i++){var a=n[i];a?this._bursts[i].cloneTo(a):n[i]=this._bursts[i].clone()}t._emissionRate=this._emissionRate,t.enbale=this.enbale},t.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,t,"destroyed",function(){return this._destroyed}),g(0,t,"emissionRate",function(){return this._emissionRate},function(e){if(e<0)throw new Error("ParticleBaseShape:emissionRate value must large or equal than 0.");this._emissionRate=e}),e}(),Ce=function(){function i(){this._type=0,this._constant=0,this._overTime=null,this._constantMin=0,this._constantMax=0,this._overTimeMin=null,this._overTimeMax=null}m(i,"laya.d3.core.particleShuriKen.module.FrameOverTime");var e=i.prototype;return x.imps(e,{"laya.d3.core.IClone":!0}),e.cloneTo=function(e){var t=e;t._type=this._type,t._constant=this._constant,this._overTime.cloneTo(t._overTime),t._constantMin=this._constantMin,t._constantMax=this._constantMax,this._overTimeMin.cloneTo(t._overTimeMin),this._overTimeMax.cloneTo(t._overTimeMax)},e.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,e,"frameOverTimeData",function(){return this._overTime}),g(0,e,"constant",function(){return this._constant}),g(0,e,"type",function(){return this._type}),g(0,e,"frameOverTimeDataMin",function(){return this._overTimeMin}),g(0,e,"constantMin",function(){return this._constantMin}),g(0,e,"frameOverTimeDataMax",function(){return this._overTimeMax}),g(0,e,"constantMax",function(){return this._constantMax}),i.createByConstant=function(e){var t=new i;return t._type=0,t._constant=e,t},i.createByOverTime=function(e){var t=new i;return t._type=1,t._overTime=e,t},i.createByRandomTwoConstant=function(e,t){var n=new i;return n._type=2,n._constantMin=e,n._constantMax=t,n},i.createByRandomTwoOverTime=function(e,t){var n=new i;return n._type=3,n._overTimeMin=e,n._overTimeMax=t,n},i}(),Ne=function(){function h(){this._type=0,this._separateAxes=!1,this._constant=NaN,this._constantSeparate=null,this._gradient=null,this._gradientX=null,this._gradientY=null,this._gradientZ=null,this._gradientW=null,this._constantMin=NaN,this._constantMax=NaN,this._constantMinSeparate=null,this._constantMaxSeparate=null,this._gradientMin=null,this._gradientMax=null,this._gradientXMin=null,this._gradientXMax=null,this._gradientYMin=null,this._gradientYMax=null,this._gradientZMin=null,this._gradientZMax=null,this._gradientWMin=null,this._gradientWMax=null}m(h,"laya.d3.core.particleShuriKen.module.GradientAngularVelocity");var e=h.prototype;return x.imps(e,{"laya.d3.core.IClone":!0}),e.cloneTo=function(e){var t=e;t._type=this._type,t._separateAxes=this._separateAxes,t._constant=this._constant,this._constantSeparate.cloneTo(t._constantSeparate),this._gradient.cloneTo(t._gradient),this._gradientX.cloneTo(t._gradientX),this._gradientY.cloneTo(t._gradientY),this._gradientZ.cloneTo(t._gradientZ),t._constantMin=this._constantMin,t._constantMax=this._constantMax,this._constantMinSeparate.cloneTo(t._constantMinSeparate),this._constantMaxSeparate.cloneTo(t._constantMaxSeparate),this._gradientMin.cloneTo(t._gradientMin),this._gradientMax.cloneTo(t._gradientMax),this._gradientXMin.cloneTo(t._gradientXMin),this._gradientXMax.cloneTo(t._gradientXMax),this._gradientYMin.cloneTo(t._gradientYMin),this._gradientYMax.cloneTo(t._gradientYMax),this._gradientZMin.cloneTo(t._gradientZMin),this._gradientZMax.cloneTo(t._gradientZMax)},e.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,e,"gradientZ",function(){return this._gradientZ}),g(0,e,"constant",function(){return this._constant}),g(0,e,"gradient",function(){return this._gradient}),g(0,e,"separateAxes",function(){return this._separateAxes}),g(0,e,"type",function(){return this._type}),g(0,e,"constantSeparate",function(){return this._constantSeparate}),g(0,e,"gradientX",function(){return this._gradientX}),g(0,e,"gradientY",function(){return this._gradientY}),g(0,e,"gradientW",function(){return this._gradientW}),g(0,e,"gradientMin",function(){return this._gradientMin}),g(0,e,"constantMin",function(){return this._constantMin}),g(0,e,"gradientMax",function(){return this._gradientMax}),g(0,e,"constantMax",function(){return this._constantMax}),g(0,e,"gradientWMin",function(){return this._gradientWMin}),g(0,e,"constantMinSeparate",function(){return this._constantMinSeparate}),g(0,e,"constantMaxSeparate",function(){return this._constantMaxSeparate}),g(0,e,"gradientXMin",function(){return this._gradientXMin}),g(0,e,"gradientXMax",function(){return this._gradientXMax}),g(0,e,"gradientWMax",function(){return this._gradientWMax}),g(0,e,"gradientYMin",function(){return this._gradientYMin}),g(0,e,"gradientYMax",function(){return this._gradientYMax}),g(0,e,"gradientZMin",function(){return this._gradientZMin}),g(0,e,"gradientZMax",function(){return this._gradientZMax}),h.createByConstant=function(e){var t=new h;return t._type=0,t._separateAxes=!1,t._constant=e,t},h.createByConstantSeparate=function(e){var t=new h;return t._type=0,t._separateAxes=!0,t._constantSeparate=e,t},h.createByGradient=function(e){var t=new h;return t._type=1,t._separateAxes=!1,t._gradient=e,t},h.createByGradientSeparate=function(e,t,n,i){var r=new h;return r._type=1,r._separateAxes=!0,r._gradientX=e,r._gradientY=t,r._gradientZ=n,r._gradientW=i,r},h.createByRandomTwoConstant=function(e,t){var n=new h;return n._type=2,n._separateAxes=!1,n._constantMin=e,n._constantMax=t,n},h.createByRandomTwoConstantSeparate=function(e,t){var n=new h;return n._type=2,n._separateAxes=!0,n._constantMinSeparate=e,n._constantMaxSeparate=t,n},h.createByRandomTwoGradient=function(e,t){var n=new h;return n._type=3,n._separateAxes=!1,n._gradientMin=e,n._gradientMax=t,n},h.createByRandomTwoGradientSeparate=function(e,t,n,i,r,a,o,s){var l=new h;return l._type=3,l._separateAxes=!0,l._gradientXMin=e,l._gradientXMax=t,l._gradientYMin=n,l._gradientYMax=i,l._gradientZMin=r,l._gradientZMax=a,l._gradientWMin=o,l._gradientWMax=s,l},h}(),we=function(){function i(){this._type=0,this._constant=null,this._constantMin=null,this._constantMax=null,this._gradient=null,this._gradientMin=null,this._gradientMax=null}m(i,"laya.d3.core.particleShuriKen.module.GradientColor");var e=i.prototype;return x.imps(e,{"laya.d3.core.IClone":!0}),e.cloneTo=function(e){var t=e;t._type=this._type,this._constant.cloneTo(t._constant),this._constantMin.cloneTo(t._constantMin),this._constantMax.cloneTo(t._constantMax),this._gradient.cloneTo(t._gradient),this._gradientMin.cloneTo(t._gradientMin),this._gradientMax.cloneTo(t._gradientMax)},e.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,e,"gradient",function(){return this._gradient}),g(0,e,"constant",function(){return this._constant}),g(0,e,"type",function(){return this._type}),g(0,e,"gradientMin",function(){return this._gradientMin}),g(0,e,"constantMin",function(){return this._constantMin}),g(0,e,"gradientMax",function(){return this._gradientMax}),g(0,e,"constantMax",function(){return this._constantMax}),i.createByConstant=function(e){var t=new i;return t._type=0,t._constant=e,t},i.createByGradient=function(e){var t=new i;return t._type=1,t._gradient=e,t},i.createByRandomTwoConstant=function(e,t){var n=new i;return n._type=2,n._constantMin=e,n._constantMax=t,n},i.createByRandomTwoGradient=function(e,t){var n=new i;return n._type=3,n._gradientMin=e,n._gradientMax=t,n},i}(),W=function(){function e(){this._alphaCurrentLength=0,this._rgbCurrentLength=0,this._alphaElements=null,this._rgbElements=null,this._alphaElements=new Float32Array(8),this._rgbElements=new Float32Array(16)}m(e,"laya.d3.core.particleShuriKen.module.GradientDataColor");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0}),t.addAlpha=function(e,t){this._alphaCurrentLength<8?(6===this._alphaCurrentLength&&1!==e&&(e=1,console.log("GradientDataColor warning:the forth key is be force set to 1.")),this._alphaElements[this._alphaCurrentLength++]=e,this._alphaElements[this._alphaCurrentLength++]=t):console.log("GradientDataColor warning:data count must lessEqual than 4")},t.addRGB=function(e,t){this._rgbCurrentLength<16?(12===this._rgbCurrentLength&&1!==e&&(e=1,console.log("GradientDataColor warning:the forth key is be force set to 1.")),this._rgbElements[this._rgbCurrentLength++]=e,this._rgbElements[this._rgbCurrentLength++]=t.x,this._rgbElements[this._rgbCurrentLength++]=t.y,this._rgbElements[this._rgbCurrentLength++]=t.z):console.log("GradientDataColor warning:data count must lessEqual than 4")},t.cloneTo=function(e){var t=e,n=0,i=0;t._alphaCurrentLength=this._alphaCurrentLength;var r=t._alphaElements;for(r.length=this._alphaElements.length,n=0,i=this._alphaElements.length;n<i;n++)r[n]=this._alphaElements[n];t._rgbCurrentLength=this._rgbCurrentLength;var a=t._rgbElements;for(a.length=this._rgbElements.length,n=0,i=this._rgbElements.length;n<i;n++)a[n]=this._rgbElements[n]},t.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,t,"alphaGradientCount",function(){return this._alphaCurrentLength/2}),g(0,t,"rgbGradientCount",function(){return this._rgbCurrentLength/4}),e}(),X=function(){function e(){this._currentLength=0,this._elements=null,this._elements=new Float32Array(8)}m(e,"laya.d3.core.particleShuriKen.module.GradientDataInt");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0}),t.add=function(e,t){this._currentLength<8?(6===this._currentLength&&1!==e&&(e=1,console.log("Warning:the forth key is be force set to 1.")),this._elements[this._currentLength++]=e,this._elements[this._currentLength++]=t):console.log("Warning:data count must lessEqual than 4")},t.cloneTo=function(e){var t=e;t._currentLength=this._currentLength;var n=t._elements;n.length=this._elements.length;for(var i=0,r=this._elements.length;i<r;i++)n[i]=this._elements[i]},t.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,t,"gradientCount",function(){return this._currentLength/2}),e}(),Z=function(){function e(){this._currentLength=0,this._elements=null,this._elements=new Float32Array(8)}m(e,"laya.d3.core.particleShuriKen.module.GradientDataNumber");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0}),t.add=function(e,t){this._currentLength<8?(6===this._currentLength&&1!==e&&(e=1,console.log("GradientDataNumber warning:the forth key is be force set to 1.")),this._elements[this._currentLength++]=e,this._elements[this._currentLength++]=t):console.log("GradientDataNumber warning:data count must lessEqual than 4")},t.getKeyByIndex=function(e){return this._elements[2*e]},t.getValueByIndex=function(e){return this._elements[2*e+1]},t.getAverageValue=function(){for(var e=0,t=this._currentLength-2;e<t;e+=2){this._elements[e+1];this._elements[e+3],this._elements[e+2]-this._elements[e]}return 0},t.cloneTo=function(e){var t=e;t._currentLength=this._currentLength;var n=t._elements;n.length=this._elements.length;for(var i=0,r=this._elements.length;i<r;i++)n[i]=this._elements[i]},t.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,t,"gradientCount",function(){return this._currentLength/2}),e}(),Oe=(function(){function e(){this._currentLength=0,this._elements=null,this._elements=new Float32Array(12)}m(e,"laya.d3.core.particleShuriKen.module.GradientDataVector2");var t=e.prototype;x.imps(t,{"laya.d3.core.IClone":!0}),t.add=function(e,t){this._currentLength<8?(6===this._currentLength&&1!==e&&(e=1,console.log("GradientDataVector2 warning:the forth key is be force set to 1.")),this._elements[this._currentLength++]=e,this._elements[this._currentLength++]=t.x,this._elements[this._currentLength++]=t.y):console.log("GradientDataVector2 warning:data count must lessEqual than 4")},t.cloneTo=function(e){var t=e;t._currentLength=this._currentLength;var n=t._elements;n.length=this._elements.length;for(var i=0,r=this._elements.length;i<r;i++)n[i]=this._elements[i]},t.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,t,"gradientCount",function(){return this._currentLength/3})}(),function(){function s(){this._type=0,this._separateAxes=!1,this._gradient=null,this._gradientX=null,this._gradientY=null,this._gradientZ=null,this._constantMin=NaN,this._constantMax=NaN,this._constantMinSeparate=null,this._constantMaxSeparate=null,this._gradientMin=null,this._gradientMax=null,this._gradientXMin=null,this._gradientXMax=null,this._gradientYMin=null,this._gradientYMax=null,this._gradientZMin=null,this._gradientZMax=null}m(s,"laya.d3.core.particleShuriKen.module.GradientSize");var e=s.prototype;return x.imps(e,{"laya.d3.core.IClone":!0}),e.getMaxSizeInGradient=function(){var e=0,t=0,n=-Number.MAX_VALUE;switch(this._type){case 0:if(this._separateAxes){for(e=0,t=this._gradientX.gradientCount;e<t;e++)n=Math.max(n,this._gradientX.getValueByIndex(e));for(e=0,t=this._gradientY.gradientCount;e<t;e++)n=Math.max(n,this._gradientY.getValueByIndex(e))}else for(e=0,t=this._gradient.gradientCount;e<t;e++)n=Math.max(n,this._gradient.getValueByIndex(e));break;case 1:n=this._separateAxes?(n=Math.max(this._constantMinSeparate.x,this._constantMaxSeparate.x),n=Math.max(n,this._constantMinSeparate.y),Math.max(n,this._constantMaxSeparate.y)):Math.max(this._constantMin,this._constantMax);break;case 2:if(this._separateAxes){for(e=0,t=this._gradientXMin.gradientCount;e<t;e++)n=Math.max(n,this._gradientXMin.getValueByIndex(e));for(e=0,t=this._gradientXMax.gradientCount;e<t;e++)n=Math.max(n,this._gradientXMax.getValueByIndex(e));for(e=0,t=this._gradientYMin.gradientCount;e<t;e++)n=Math.max(n,this._gradientYMin.getValueByIndex(e));for(e=0,t=this._gradientZMax.gradientCount;e<t;e++)n=Math.max(n,this._gradientZMax.getValueByIndex(e))}else{for(e=0,t=this._gradientMin.gradientCount;e<t;e++)n=Math.max(n,this._gradientMin.getValueByIndex(e));for(e=0,t=this._gradientMax.gradientCount;e<t;e++)n=Math.max(n,this._gradientMax.getValueByIndex(e))}}return n},e.cloneTo=function(e){var t=e;t._type=this._type,t._separateAxes=this._separateAxes,this._gradient.cloneTo(t._gradient),this._gradientX.cloneTo(t._gradientX),this._gradientY.cloneTo(t._gradientY),this._gradientZ.cloneTo(t._gradientZ),t._constantMin=this._constantMin,t._constantMax=this._constantMax,this._constantMinSeparate.cloneTo(t._constantMinSeparate),this._constantMaxSeparate.cloneTo(t._constantMaxSeparate),this._gradientMin.cloneTo(t._gradientMin),this._gradientMax.cloneTo(t._gradientMax),this._gradientXMin.cloneTo(t._gradientXMin),this._gradientXMax.cloneTo(t._gradientXMax),this._gradientYMin.cloneTo(t._gradientYMin),this._gradientYMax.cloneTo(t._gradientYMax),this._gradientZMin.cloneTo(t._gradientZMin),this._gradientZMax.cloneTo(t._gradientZMax)},e.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,e,"gradientZ",function(){return this._gradientZ}),g(0,e,"gradient",function(){return this._gradient}),g(0,e,"separateAxes",function(){return this._separateAxes}),g(0,e,"type",function(){return this._type}),g(0,e,"gradientMin",function(){return this._gradientMin}),g(0,e,"constantMin",function(){return this._constantMin}),g(0,e,"gradientX",function(){return this._gradientX}),g(0,e,"gradientY",function(){return this._gradientY}),g(0,e,"gradientMax",function(){return this._gradientMax}),g(0,e,"constantMax",function(){return this._constantMax}),g(0,e,"constantMinSeparate",function(){return this._constantMinSeparate}),g(0,e,"constantMaxSeparate",function(){return this._constantMaxSeparate}),g(0,e,"gradientXMin",function(){return this._gradientXMin}),g(0,e,"gradientXMax",function(){return this._gradientXMax}),g(0,e,"gradientYMin",function(){return this._gradientYMin}),g(0,e,"gradientYMax",function(){return this._gradientYMax}),g(0,e,"gradientZMin",function(){return this._gradientZMin}),g(0,e,"gradientZMax",function(){return this._gradientZMax}),s.createByGradient=function(e){var t=new s;return t._type=0,t._separateAxes=!1,t._gradient=e,t},s.createByGradientSeparate=function(e,t,n){var i=new s;return i._type=0,i._separateAxes=!0,i._gradientX=e,i._gradientY=t,i._gradientZ=n,i},s.createByRandomTwoConstant=function(e,t){var n=new s;return n._type=1,n._separateAxes=!1,n._constantMin=e,n._constantMax=t,n},s.createByRandomTwoConstantSeparate=function(e,t){var n=new s;return n._type=1,n._separateAxes=!0,n._constantMinSeparate=e,n._constantMaxSeparate=t,n},s.createByRandomTwoGradient=function(e,t){var n=new s;return n._type=2,n._separateAxes=!1,n._gradientMin=e,n._gradientMax=t,n},s.createByRandomTwoGradientSeparate=function(e,t,n,i,r,a){var o=new s;return o._type=2,o._separateAxes=!0,o._gradientXMin=e,o._gradientXMax=t,o._gradientYMin=n,o._gradientYMax=i,o._gradientZMin=r,o._gradientZMax=a,o},s}()),Ve=function(){function s(){this._type=0,this._constant=null,this._gradientX=null,this._gradientY=null,this._gradientZ=null,this._constantMin=null,this._constantMax=null,this._gradientXMin=null,this._gradientXMax=null,this._gradientYMin=null,this._gradientYMax=null,this._gradientZMin=null,this._gradientZMax=null}m(s,"laya.d3.core.particleShuriKen.module.GradientVelocity");var e=s.prototype;return x.imps(e,{"laya.d3.core.IClone":!0}),e.cloneTo=function(e){var t=e;t._type=this._type,this._constant.cloneTo(t._constant),this._gradientX.cloneTo(t._gradientX),this._gradientY.cloneTo(t._gradientY),this._gradientZ.cloneTo(t._gradientZ),this._constantMin.cloneTo(t._constantMin),this._constantMax.cloneTo(t._constantMax),this._gradientXMin.cloneTo(t._gradientXMin),this._gradientXMax.cloneTo(t._gradientXMax),this._gradientYMin.cloneTo(t._gradientYMin),this._gradientYMax.cloneTo(t._gradientYMax),this._gradientZMin.cloneTo(t._gradientZMin),this._gradientZMax.cloneTo(t._gradientZMax)},e.clone=function(){var e=new this.constructor;return this.cloneTo(e),e},g(0,e,"gradientZ",function(){return this._gradientZ}),g(0,e,"constant",function(){return this._constant}),g(0,e,"type",function(){return this._type}),g(0,e,"gradientXMax",function(){return this._gradientXMax}),g(0,e,"constantMin",function(){return this._constantMin}),g(0,e,"gradientX",function(){return this._gradientX}),g(0,e,"gradientY",function(){return this._gradientY}),g(0,e,"gradientXMin",function(){return this._gradientXMin}),g(0,e,"constantMax",function(){return this._constantMax}),g(0,e,"gradientYMin",function(){return this._gradientYMin}),g(0,e,"gradientYMax",function(){return this._gradientYMax}),g(0,e,"gradientZMin",function(){return this._gradientZMin}),g(0,e,"gradientZMax",function(){return this._gradientZMax}),s.createByConstant=function(e){var t=new s;return t._type=0,t._constant=e,t},s.createByGradient=function(e,t,n){var i=new s;return i._type=1,i._gradientX=e,i._gradientY=t,i._gradientZ=n,i},s.createByRandomTwoConstant=function(e,t){var n=new s;return n._type=2,n._constantMin=e,n._constantMax=t,n},s.createByRandomTwoGradient=function(e,t,n,i,r,a){var o=new s;return o._type=3,o._gradientXMin=e,o._gradientXMax=t,o._gradientYMin=n,o._gradientYMax=i,o._gradientZMin=r,o._gradientZMax=a,o},s}(),Pe=function(){function e(e){this._angularVelocity=null,this.enbale=!1,this._angularVelocity=e}m(e,"laya.d3.core.particleShuriKen.module.RotationOverLifetime");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0}),t.cloneTo=function(e){var t=e;this._angularVelocity.cloneTo(t._angularVelocity),t.enbale=this.enbale},t.clone=function(){var e;switch(this._angularVelocity.type){case 0:e=this._angularVelocity.separateAxes?Ne.createByConstantSeparate(this._angularVelocity.constantSeparate.clone()):Ne.createByConstant(this._angularVelocity.constant);break;case 1:e=this._angularVelocity.separateAxes?Ne.createByGradientSeparate(this._angularVelocity.gradientX.clone(),this._angularVelocity.gradientY.clone(),this._angularVelocity.gradientZ.clone(),this._angularVelocity.gradientW.clone()):Ne.createByGradient(this._angularVelocity.gradient.clone());break;case 2:e=this._angularVelocity.separateAxes?Ne.createByRandomTwoConstantSeparate(this._angularVelocity.constantMinSeparate.clone(),this._angularVelocity.constantMaxSeparate.clone()):Ne.createByRandomTwoConstant(this._angularVelocity.constantMin,this._angularVelocity.constantMax);break;case 3:e=this._angularVelocity.separateAxes?Ne.createByRandomTwoGradientSeparate(this._angularVelocity.gradientXMin.clone(),this._angularVelocity.gradientYMin.clone(),this._angularVelocity.gradientZMin.clone(),this._angularVelocity.gradientWMin.clone(),this._angularVelocity.gradientXMax.clone(),this._angularVelocity.gradientYMax.clone(),this._angularVelocity.gradientZMax.clone(),this._angularVelocity.gradientWMax.clone()):Ne.createByRandomTwoGradient(this._angularVelocity.gradientMin.clone(),this._angularVelocity.gradientMax.clone())}var t=new this.constructor(e);return t.enbale=this.enbale,t},g(0,t,"angularVelocity",function(){return this._angularVelocity}),e}(),Y=function(){function e(){this.enable=!1,this.randomDirection=!1}m(e,"laya.d3.core.particleShuriKen.module.shape.BaseShape");var t=e.prototype;return x.imps(t,{"laya.d3.core.IClone":!0}),t._getShapeBoundBox=function(e){throw new Error("BaseShape: must override it.")},t._getSpeedBoundBox=function(e){throw new Er