1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="be953494-249c-4094-bf8a-57de8d6a9435",t._sentryDebugIdIdentifier="sentry-dbid-be953494-249c-4094-bf8a-57de8d6a9435")}catch(t){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[92770],{25412:function(t,e,r){r.d(e,{FM:function(){return l},Lt:function(){return y},P:function(){return c},_f:function(){return u},jp:function(){return R},y3:function(){return m}});var i=r(21226),s=r(94551),o=r(2554),n=r(70646),a=r(1716),h=r(95953);let _=t=>parseInt(t.toString().replace(/\W/g,""));class l{constructor(t=0,e=0){this.x=t,this.y=e}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){let t=_(this.x),e=_(this.y);return 397*t^e}toArray(t,e=0){return t[e]=this.x,t[e+1]=this.y,this}fromArray(t,e=0){return l.FromArrayToRef(t,e,this),this}asArray(){let t=[];return this.toArray(t,0),t}copyFrom(t){return this.x=t.x,this.y=t.y,this}copyFromFloats(t,e){return this.x=t,this.y=e,this}set(t,e){return this.copyFromFloats(t,e)}add(t){return new this.constructor(this.x+t.x,this.y+t.y)}addToRef(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e}addInPlace(t){return this.x+=t.x,this.y+=t.y,this}addVector3(t){return new this.constructor(this.x+t.x,this.y+t.y)}subtract(t){return new this.constructor(this.x-t.x,this.y-t.y)}subtractToRef(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e}subtractInPlace(t){return this.x-=t.x,this.y-=t.y,this}multiplyInPlace(t){return this.x*=t.x,this.y*=t.y,this}multiply(t){return new this.constructor(this.x*t.x,this.y*t.y)}multiplyToRef(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByFloats(t,e){return new this.constructor(this.x*t,this.y*e)}divide(t){return new this.constructor(this.x/t.x,this.y/t.y)}divideToRef(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e}divideInPlace(t){return this.divideToRef(t,this)}negate(){return new this.constructor(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(t){return t.copyFromFloats(-1*this.x,-1*this.y)}scaleInPlace(t){return this.x*=t,this.y*=t,this}scale(t){let e=new this.constructor(0,0);return this.scaleToRef(t,e),e}scaleToRef(t,e){return e.x=this.x*t,e.y=this.y*t,e}scaleAndAddToRef(t,e){return e.x+=this.x*t,e.y+=this.y*t,e}equals(t){return t&&this.x===t.x&&this.y===t.y}equalsWithEpsilon(t,e=s.kn){return t&&i.R.WithinEpsilon(this.x,t.x,e)&&i.R.WithinEpsilon(this.y,t.y,e)}floor(){return new this.constructor(Math.floor(this.x),Math.floor(this.y))}fract(){return new this.constructor(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}rotateToRef(t,e){let r=Math.cos(t),i=Math.sin(t),s=r*this.x-i*this.y,o=i*this.x+r*this.y;return e.x=s,e.y=o,e}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return l.NormalizeToRef(this,this),this}clone(){return new this.constructor(this.x,this.y)}static Zero(){return new l(0,0)}static One(){return new l(1,1)}static Random(t=0,e=1){return new l(i.R.RandomRange(t,e),i.R.RandomRange(t,e))}static get ZeroReadOnly(){return l._ZeroReadOnly}static FromArray(t,e=0){return new l(t[e],t[e+1])}static FromArrayToRef(t,e,r){return r.x=t[e],r.y=t[e+1],r}static CatmullRom(t,e,r,i,s){let o=s*s,n=s*o,a=.5*(2*e.x+(-t.x+r.x)*s+(2*t.x-5*e.x+4*r.x-i.x)*o+(-t.x+3*e.x-3*r.x+i.x)*n),h=.5*(2*e.y+(-t.y+r.y)*s+(2*t.y-5*e.y+4*r.y-i.y)*o+(-t.y+3*e.y-3*r.y+i.y)*n);return new t.constructor(a,h)}static Clamp(t,e,r){let i=t.x;i=(i=i>r.x?r.x:i)<e.x?e.x:i;let s=t.y;return s=(s=s>r.y?r.y:s)<e.y?e.y:s,new t.constructor(i,s)}static Hermite(t,e,r,i,s){let o=s*s,n=s*o,a=2*n-3*o+1,h=-2*n+3*o,_=n-2*o+s,l=n-o,c=t.x*a+r.x*h+e.x*_+i.x*l,y=t.y*a+r.y*h+e.y*_+i.y*l;return new t.constructor(c,y)}static Hermite1stDerivative(t,e,r,i,s){let o=new t.constructor;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let n=s*s;return o.x=(n-s)*6*t.x+(3*n-4*s+1)*e.x+(-n+s)*6*r.x+(3*n-2*s)*i.x,o.y=(n-s)*6*t.y+(3*n-4*s+1)*e.y+(-n+s)*6*r.y+(3*n-2*s)*i.y,o}static Lerp(t,e,r){let i=t.x+(e.x-t.x)*r,s=t.y+(e.y-t.y)*r;return new t.constructor(i,s)}static Dot(t,e){return t.x*e.x+t.y*e.y}static Normalize(t){let e=new t.constructor;return this.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){let r=t.length();return 0===r||(e.x=t.x/r,e.y=t.y/r),e}
1static Minimize(t,e){let r=t.x<e.x?t.x:e.x,i=t.y<e.y?t.y:e.y;return new t.constructor(r,i)}static Maximize(t,e){let r=t.x>e.x?t.x:e.x,i=t.y>e.y?t.y:e.y;return new t.constructor(r,i)}static Transform(t,e){let r=new t.constructor;return l.TransformToRef(t,e,r),r}static TransformToRef(t,e,r){let i=e.m,s=t.x*i[0]+t.y*i[4]+i[12],o=t.x*i[1]+t.y*i[5]+i[13];return r.x=s,r.y=o,r}static PointInTriangle(t,e,r,i){let s=.5*(-r.y*i.x+e.y*(-r.x+i.x)+e.x*(r.y-i.y)+r.x*i.y),o=s<0?-1:1,n=(e.y*i.x-e.x*i.y+(i.y-e.y)*t.x+(e.x-i.x)*t.y)*o,a=(e.x*r.y-e.y*r.x+(e.y-r.y)*t.x+(r.x-e.x)*t.y)*o;return n>0&&a>0&&n+a<2*s*o}static Distance(t,e){return Math.sqrt(l.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y;return r*r+i*i}static Center(t,e){let r=new t.constructor;return l.CenterToRef(t,e,r)}static CenterToRef(t,e,r){return r.copyFromFloats((t.x+e.x)/2,(t.y+e.y)/2)}static DistanceOfPointFromSegment(t,e,r){let i=l.DistanceSquared(e,r);if(0===i)return l.Distance(t,e);let s=r.subtract(e),o=Math.max(0,Math.min(1,l.Dot(t.subtract(e),s)/i)),n=e.add(s.multiplyByFloats(o,o));return l.Distance(t,n)}}l._ZeroReadOnly=l.Zero();class c{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}constructor(t=0,e=0,r=0){this._isDirty=!0,this._x=t,this._y=e,this._z=r}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){let t=_(this._x),e=_(this._y),r=_(this._z),i=t;return 397*(i=397*i^e)^r}asArray(){let t=[];return this.toArray(t,0),t}toArray(t,e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,this}fromArray(t,e=0){return c.FromArrayToRef(t,e,this),this}toQuaternion(){return u.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(t){return this.addInPlaceFromFloats(t._x,t._y,t._z)}addInPlaceFromFloats(t,e,r){return this._x+=t,this._y+=e,this._z+=r,this._isDirty=!0,this}add(t){return new this.constructor(this._x+t._x,this._y+t._y,this._z+t._z)}addToRef(t,e){return e.copyFromFloats(this._x+t._x,this._y+t._y,this._z+t._z)}subtractInPlace(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this._isDirty=!0,this}subtract(t){return new this.constructor(this._x-t._x,this._y-t._y,this._z-t._z)}subtractToRef(t,e){return this.subtractFromFloatsToRef(t._x,t._y,t._z,e)}subtractFromFloats(t,e,r){return new this.constructor(this._x-t,this._y-e,this._z-r)}subtractFromFloatsToRef(t,e,r,i){return i.copyFromFloats(this._x-t,this._y-e,this._z-r)}negate(){return new this.constructor(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(t){return t.copyFromFloats(-1*this._x,-1*this._y,-1*this._z)}scaleInPlace(t){return this._x*=t,this._y*=t,this._z*=t,this._isDirty=!0,this}scale(t){return new this.constructor(this._x*t,this._y*t,this._z*t)}scaleToRef(t,e){return e.copyFromFloats(this._x*t,this._y*t,this._z*t)}getNormalToRef(t){let e=this.length(),r=Math.acos(this.y/e),i=Math.atan2(this.z,this.x);r>Math.PI/2?r-=Math.PI/2:r+=Math.PI/2;let s=e*Math.sin(r)*Math.cos(i),o=e*Math.cos(r),n=e*Math.sin(r)*Math.sin(i);return t.set(s,o,n),t}applyRotationQuaternionToRef(t,e){let r=t._w*this._x+t._y*this._z-t._z*this._y,i=t._w*this._y+t._z*this._x-t._x*this._z,s=t._w*this._z+t._x*this._y-t._y*this._x,o=-t._x*this._x-t._y*this._y-t._z*this._z;return e._x=r*t._w+-(o*t._x)+-(i*t._z)- -(s*t._y),e._y=i*t._w+-(o*t._y)+-(s*t._x)- -(r*t._z),e._z=s*t._w+-(o*t._z)+-(r*t._y)- -(i*t._x),e._isDirty=!0,e}applyRotationQuaternionInPlace(t){return this.applyRotationQuaternionToRef(t,this)}applyRotationQuaternion(t){return this.applyRotationQuaternionToRef(t,new this.constructor)}scaleAndAddToRef(t,e){return e.addInPlaceFromFloats(this._x*t,this._y*t,this._z*t)}projectOnPlane(t,e){let r=new this.constructor;return this.projectOnPlaneToRef(t,e,r),r}projectOnPlaneToRef(t,e,r){let i=t.normal,s=t.d,o=x.Vector3[0];this.subtractToRef(e,o),o.normalize();let n=c.Dot(o,i);if(1e-10>Math.abs(n))r.setAll(1/0);else{let t=-(c.Dot(e,i)+s)/n,a=o.scaleInPlace(t);e.addToRef(a,r)}return r}equals(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z}equalsWithEpsilon(t,e=s.kn){return t&&i.R.WithinEpsilon(this._x,t._x,e)&&i.R.WithinEpsilon(this._y,t._y,e)&&i.R.WithinEpsilon(this._z,t._z,e)}
1equalsToFloats(t,e,r){return this._x===t&&this._y===e&&this._z===r}multiplyInPlace(t){return this._x*=t._x,this._y*=t._y,this._z*=t._z,this._isDirty=!0,this}multiply(t){return this.multiplyByFloats(t._x,t._y,t._z)}multiplyToRef(t,e){return e.copyFromFloats(this._x*t._x,this._y*t._y,this._z*t._z)}multiplyByFloats(t,e,r){return new this.constructor(this._x*t,this._y*e,this._z*r)}divide(t){return new this.constructor(this._x/t._x,this._y/t._y,this._z/t._z)}divideToRef(t,e){return e.copyFromFloats(this._x/t._x,this._y/t._y,this._z/t._z)}divideInPlace(t){return this.divideToRef(t,this)}minimizeInPlace(t){return this.minimizeInPlaceFromFloats(t._x,t._y,t._z)}maximizeInPlace(t){return this.maximizeInPlaceFromFloats(t._x,t._y,t._z)}minimizeInPlaceFromFloats(t,e,r){return t<this._x&&(this.x=t),e<this._y&&(this.y=e),r<this._z&&(this.z=r),this}maximizeInPlaceFromFloats(t,e,r){return t>this._x&&(this.x=t),e>this._y&&(this.y=e),r>this._z&&(this.z=r),this}isNonUniformWithinEpsilon(t){let e=Math.abs(this._x),r=Math.abs(this._y);if(!i.R.WithinEpsilon(e,r,t))return!0;let s=Math.abs(this._z);return!(i.R.WithinEpsilon(e,s,t)&&i.R.WithinEpsilon(r,s,t))}get isNonUniform(){let t=Math.abs(this._x);return t!==Math.abs(this._y)||t!==Math.abs(this._z)}floor(){return new this.constructor(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fract(){return new this.constructor(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z==0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(t){return"xyz"===(t=t.toLowerCase())||(x.Vector3[0].copyFrom(this),["x","y","z"].forEach((e,r)=>{this[e]=x.Vector3[0][t[r]]})),this}rotateByQuaternionToRef(t,e){return t.toRotationMatrix(x.Matrix[0]),c.TransformCoordinatesToRef(this,x.Matrix[0],e),e}rotateByQuaternionAroundPointToRef(t,e,r){return this.subtractToRef(e,x.Vector3[0]),x.Vector3[0].rotateByQuaternionToRef(t,x.Vector3[0]),e.addToRef(x.Vector3[0],r),r}cross(t){let e=new this.constructor;return c.CrossToRef(this,t,e)}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){let t=new this.constructor(0,0,0);return this.normalizeToRef(t),t}normalizeToRef(t){let e=this.length();return 0===e||1===e?t.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/e,t)}clone(){return new this.constructor(this._x,this._y,this._z)}copyFrom(t){return this.copyFromFloats(t._x,t._y,t._z)}copyFromFloats(t,e,r){return this._x=t,this._y=e,this._z=r,this._isDirty=!0,this}set(t,e,r){return this.copyFromFloats(t,e,r)}setAll(t){return this._x=this._y=this._z=t,this._isDirty=!0,this}static GetClipFactor(t,e,r,i){let s=c.Dot(t,r)-i;return s/(s-(c.Dot(e,r)-i))}static GetAngleBetweenVectors(t,e,r){let s=t.normalizeToRef(x.Vector3[1]),o=e.normalizeToRef(x.Vector3[2]),n=c.Dot(s,o),a=Math.acos(n=i.R.Clamp(n,-1,1)),h=x.Vector3[3];return(c.CrossToRef(s,o,h),c.Dot(h,r)>0)?isNaN(a)?0:a:isNaN(a)?-Math.PI:-Math.acos(n)}static GetAngleBetweenVectorsOnPlane(t,e,r){x.Vector3[0].copyFrom(t);let s=x.Vector3[0];x.Vector3[1].copyFrom(e);let o=x.Vector3[1];x.Vector3[2].copyFrom(r);let n=x.Vector3[2],a=x.Vector3[3],h=x.Vector3[4];s.normalize(),o.normalize(),n.normalize(),c.CrossToRef(n,s,a),c.CrossToRef(a,n,h);let _=Math.atan2(c.Dot(o,a),c.Dot(o,h));return i.R.NormalizeRadians(_)}static PitchYawRollToMoveBetweenPointsToRef(t,e,r){let i=R.Vector3[0];return e.subtractToRef(t,i),r._y=Math.atan2(i.x,i.z)||0,r._x=Math.atan2(Math.sqrt(i.x**2+i.z**2),i.y)||0,r._z=0,r._isDirty=!0,r}static PitchYawRollToMoveBetweenPoints(t,e){let r=c.Zero();return c.PitchYawRollToMoveBetweenPointsToRef(t,e,r)}static SlerpToRef(t,e,r,o){let n,a;r=i.R.Clamp(r,0,1);let h=x.Vector3[0],_=x.Vector3[1];h.copyFrom(t);let l=h.length();h.normalizeFromLength(l),_.copyFrom(e);let y=_.length();_.normalizeFromLength(y);let u=c.Dot(h,_);if(u<1-s.kn){let t=Math.acos(u),e=1/Math.sin(t);n=Math.sin((1-r)*t)*e,a=Math.sin(r*t)*e}else n=1-r,a=r;return h.scaleInPlace(n),_.scaleInPlace(a),o.copyFrom(h).addInPlace(_),o.scaleInPlace(i.R.Lerp(l,y,r)),o}static SmoothToRef(t,e,r,i,s){return c.SlerpToRef(t,e,0===i?1:r/i,s),s}static FromArray(t,e=0){return new c(t[e],t[e+1],t[e+2])}static FromFloatArray(t,e){return c.FromArray(t,e)}static FromArrayToRef(t,e,r){return r._x=t[e],r._y=t[e+1],r._z=t[e+2],r._isDirty=!0,r}static FromFloatArrayToRef(t,e,r){return c.FromArrayToRef(t,e,r)}static FromFloatsToRef(t,e,r,i){return i.copyFromFloats(t,e,r),i}static Zero(){return new c(0,0,0)}static One(){return new c(1,1,1)}static Up(){return new c(0,1,0)}static get UpReadOnly(){return c._UpReadOnly}static get DownReadOnly(){return c._DownReadOnly}static get RightReadOnly(){return c._RightReadOnly}static get LeftReadOnly(){return c._LeftReadOnly}static get LeftHandedForwardReadOnly(){return c._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return c._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return c._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return c._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return c._ZeroReadOnly}static Down(){return new c(0,-1,0)}static Forward(t=!1){return new c(0,0,t?-1:1)}static Backward(t=!1){return new c(0,0,t?1:-1)}static Right(){return new c(1,0,0)}static Left(){return new c(-1,0,0)}static Random(t=0,e=1){return new c(i.R.RandomRange(t,e),i.R.RandomRange(t,e),i.R.RandomRange(t,e))}static TransformCoordinates(t,e){let r=c.Zero();return c.TransformCoordinatesToRef(t,e,r),r}static TransformCoordinatesToRef(t,e,r){return c.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformCoordinatesFromFloatsToRef(t,e,r,i,s){let o=i.m,n=t*o[0]+e*o[4]+r*o[8]+o[12],a=t*o[1]+e*o[5]+r*o[9]+o[13],h=t*o[2]+e*o[6]+r*o[10]+o[14],_=1/(t*o[3]+e*o[7]+r*o[11]+o[15]);return s._x=n*_,s._y=a*_,s._z=h*_,s._isDirty=!0,s}static TransformNormal(t,e){let r=c.Zero();return c.TransformNormalToRef(t,e,r),r}static TransformNormalToRef(t,e,r){return this.TransformNormalFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformNormalFromFloatsToRef(t,e,r,i,s){let o=i.m;return s._x=t*o[0]+e*o[4]+r*o[8],s._y=t*o[1]+e*o[5]+r*o[9],s._z=t*o[2]+e*o[6]+r*o[10],s._isDirty=!0,s}static CatmullRom(t,e,r,i,s){let o=s*s,n=s*o,a=.5*(2*e._x+(-t._x+r._x)*s+(2*t._x-5*e._x+4*r._x-i._x)*o+(-t._x+3*e._x-3*r._x+i._x)*n),h=.5*(2*e._y+(-t._y+r._y)*s+(2*t._y-5*e._y+4*r._y-i._y)*o+(-t._y+3*e._y-3*r._y+i._y)*n),_=.5*(2*e._z+(-t._z+r._z)*s+(2*t._z-5*e._z+4*r._z-i._z)*o+(-t._z+3*e._z-3*r._z+i._z)*n);return new t.constructor(a,h,_)}static Clamp(t,e,r){let i=new t.constructor;return c.ClampToRef(t,e,r,i),i}static ClampToRef(t,e,r,i){let s=t._x;s=(s=s>r._x?r._x:s)<e._x?e._x:s;let o=t._y;o=(o=o>r._y?r._y:o)<e._y?e._y:o;let n=t._z;return n=(n=n>r._z?r._z:n)<e._z?e._z:n,i.copyFromFloats(s,o,n),i}static CheckExtends(t,e,r){e.minimizeInPlace(t),r.maximizeInPlace(t)}static Hermite(t,e,r,i,s){let o=s*s,n=s*o,a=2*n-3*o+1,h=-2*n+3*o,_=n-2*o+s,l=n-o,c=t._x*a+r._x*h+e._x*_+i._x*l,y=t._y*a+r._y*h+e._y*_+i._y*l,u=t._z*a+r._z*h+e._z*_+i._z*l;return new t.constructor(c,y,u)}static Hermite1stDerivative(t,e,r,i,s){let o=new t.constructor;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let n=s*s;return o._x=(n-s)*6*t._x+(3*n-4*s+1)*e._x+(-n+s)*6*r._x+(3*n-2*s)*i._x,o._y=(n-s)*6*t._y+(3*n-4*s+1)*e._y+(-n+s)*6*r._y+(3*n-2*s)*i._y,o._z=(n-s)*6*t._z+(3*n-4*s+1)*e._z+(-n+s)*6*r._z+(3*n-2*s)*i._z,o._isDirty=!0,o}static Lerp(t,e,r){let i=new t.constructor(0,0,0);return c.LerpToRef(t,e,r,i),i}static LerpToRef(t,e,r,i){return i._x=t._x+(e._x-t._x)*r,i._y=t._y+(e._y-t._y)*r,i._z=t._z+(e._z-t._z)*r,i._isDirty=!0,i}static Dot(t,e){return t._x*e._x+t._y*e._y+t._z*e._z}static Cross(t,e){let r=new t.constructor;return c.CrossToRef(t,e,r),r}static CrossToRef(t,e,r){let i=t._y*e._z-t._z*e._y,s=t._z*e._x-t._x*e._z,o=t._x*e._y-t._y*e._x;return r.copyFromFloats(i,s,o),r}static Normalize(t){let e=c.Zero();return c.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Project(t,e,r,i){let s=new t.constructor;return c.ProjectToRef(t,e,r,i,s),s}static ProjectToRef(t,e,r,i,s){let o=i.width,n=i.height,a=i.x,h=i.y,_=x.Matrix[1];m.FromValuesToRef(o/2,0,0,0,0,-n/2,0,0,0,0,.5,0,a+o/2,n/2+h,.5,1,_);let l=x.Matrix[0];return e.multiplyToRef(r,l),l.multiplyToRef(_,l),c.TransformCoordinatesToRef(t,l,s),s}static Reflect(t,e){return this.ReflectToRef(t,e,new c)}static ReflectToRef(t,e,r){let i=R.Vector3[0];return i.copyFrom(e).scaleInPlace(2*c.Dot(t,e)),r.copyFrom(t).subtractInPlace(i)}static _UnprojectFromInvertedMatrixToRef(t,e,r){c.TransformCoordinatesToRef(t,e,r);let s=e.m,o=t._x*s[3]+t._y*s[7]+t._z*s[11]+s[15];
1return i.R.WithinEpsilon(o,1)&&r.scaleInPlace(1/o),r}static UnprojectFromTransform(t,e,r,i,s){return this.Unproject(t,e,r,i,s,m.IdentityReadOnly)}static Unproject(t,e,r,i,s,o){let n=new t.constructor;return c.UnprojectToRef(t,e,r,i,s,o,n),n}static UnprojectToRef(t,e,r,i,s,o,n){return c.UnprojectFloatsToRef(t._x,t._y,t._z,e,r,i,s,o,n),n}static UnprojectFloatsToRef(t,e,r,i,s,o,n,a,_){var l;let y=x.Matrix[0];o.multiplyToRef(n,y),y.multiplyToRef(a,y),y.invert();let u=x.Vector3[0];return u.x=t/i*2-1,u.y=-(e/s*2-1),(null===(l=h.l.LastCreatedEngine)||void 0===l?void 0:l.isNDCHalfZRange)?u.z=r:u.z=2*r-1,c._UnprojectFromInvertedMatrixToRef(u,y,_),_}static Minimize(t,e){let r=new t.constructor;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new t.constructor;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(c.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t._x-e._x,i=t._y-e._y,s=t._z-e._z;return r*r+i*i+s*s}static ProjectOnTriangleToRef(t,e,r,o,n){let a,h;let _=x.Vector3[0],l=x.Vector3[1],y=x.Vector3[2],u=x.Vector3[3],m=x.Vector3[4];r.subtractToRef(e,_),o.subtractToRef(e,l),o.subtractToRef(r,y);let R=_.length(),f=l.length(),d=y.length();if(R<s.kn||f<s.kn||d<s.kn)return n.copyFrom(e),c.Distance(t,e);t.subtractToRef(e,m),c.CrossToRef(_,l,u);let z=u.length();if(z<s.kn)return n.copyFrom(e),c.Distance(t,e);u.normalizeFromLength(z);let T=m.length();if(T<s.kn)return n.copyFrom(e),0;m.normalizeFromLength(T);let w=c.Dot(u,m),p=x.Vector3[5],F=x.Vector3[6];p.copyFrom(u).scaleInPlace(-T*w),F.copyFrom(t).addInPlace(p);let I=x.Vector3[4],M=x.Vector3[5],g=x.Vector3[7],D=x.Vector3[8];I.copyFrom(_).scaleInPlace(1/R),D.copyFrom(l).scaleInPlace(1/f),I.addInPlace(D).scaleInPlace(-1),M.copyFrom(_).scaleInPlace(-1/R),D.copyFrom(y).scaleInPlace(1/d),M.addInPlace(D).scaleInPlace(-1),g.copyFrom(y).scaleInPlace(-1/d),D.copyFrom(l).scaleInPlace(-1/f),g.addInPlace(D).scaleInPlace(-1);let P=x.Vector3[9];P.copyFrom(F).subtractInPlace(e),c.CrossToRef(I,P,D);let A=c.Dot(D,u);P.copyFrom(F).subtractInPlace(r),c.CrossToRef(M,P,D);let V=c.Dot(D,u);P.copyFrom(F).subtractInPlace(o),c.CrossToRef(g,P,D);let C=c.Dot(D,u),L=x.Vector3[10];A>0&&V<0?(L.copyFrom(_),a=e,h=r):V>0&&C<0?(L.copyFrom(y),a=r,h=o):(L.copyFrom(l).scaleInPlace(-1),a=o,h=e);let k=x.Vector3[9],H=x.Vector3[4];if(a.subtractToRef(F,D),h.subtractToRef(F,k),c.CrossToRef(D,k,H),!(0>c.Dot(H,u)))return n.copyFrom(F),Math.abs(T*w);let v=x.Vector3[5];c.CrossToRef(L,H,v),v.normalize();let O=x.Vector3[9];O.copyFrom(a).subtractInPlace(F);let b=O.length();if(b<s.kn)return n.copyFrom(a),c.Distance(t,a);O.normalizeFromLength(b);let S=c.Dot(v,O),B=x.Vector3[7];B.copyFrom(F).addInPlace(v.scaleInPlace(b*S)),D.copyFrom(B).subtractInPlace(a),T=L.length(),L.normalizeFromLength(T);let U=c.Dot(D,L)/Math.max(T,s.kn);return U=i.R.Clamp(U,0,1),B.copyFrom(a).addInPlace(L.scaleInPlace(U*T)),n.copyFrom(B),c.Distance(t,B)}static Center(t,e){return c.CenterToRef(t,e,c.Zero())}static CenterToRef(t,e,r){return r.copyFromFloats((t._x+e._x)/2,(t._y+e._y)/2,(t._z+e._z)/2)}static RotationFromAxis(t,e,r){let i=new t.constructor;return c.RotationFromAxisToRef(t,e,r,i),i}static RotationFromAxisToRef(t,e,r,i){let s=x.Quaternion[0];return u.RotationQuaternionFromAxisToRef(t,e,r,s),s.toEulerAnglesToRef(i),i}}c._UpReadOnly=c.Up(),c._DownReadOnly=c.Down(),c._LeftHandedForwardReadOnly=c.Forward(!1),c._RightHandedForwardReadOnly=c.Forward(!0),c._LeftHandedBackwardReadOnly=c.Backward(!1),c._RightHandedBackwardReadOnly=c.Backward(!0),c._RightReadOnly=c.Right(),c._LeftReadOnly=c.Left(),c._ZeroReadOnly=c.Zero();class y{constructor(t=0,e=0,r=0,i=0){this.x=t,this.y=e,this.z=r,this.w=i}toString(){return`{X: ${this.x} Y: ${this.y} Z: ${this.z} W: ${this.w}}`}getClassName(){return"Vector4"}getHashCode(){let t=_(this.x),e=_(this.y),r=_(this.z),i=_(this.w),s=t;return 397*(s=397*(s=397*s^e)^r)^i}asArray(){let t=[];return this.toArray(t,0),t}toArray(t,e){return void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,this}fromArray(t,e=0){return y.FromArrayToRef(t,e,this),this}addInPlace(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}add(t){return new this.constructor(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)}addToRef(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e.w=this.w+t.w,e}subtractInPlace(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subtract(t){return new this.constructor(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)}subtractToRef(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e.w=this.w-t.w,e}subtractFromFloats(t,e,r,i){return new this.constructor(this.x-t,this.y-e,this.z-r,this.w-i)}subtractFromFloatsToRef(t,e,r,i,s){return s.x=this.x-t,s.y=this.y-e,s.z=this.z-r,s.w=this.w-i,s}negate(){return new this.constructor(-this.x,-this.y,-this.z,-this.w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(t){return t.copyFromFloats(-1*this.x,-1*this.y,-1*this.z,-1*this.w)}scaleInPlace(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}scale(t){return new this.constructor(this.x*t,this.y*t,this.z*t,this.w*t)}scaleToRef(t,e){return e.x=this.x*t,e.y=this.y*t,e.z=this.z*t,e.w=this.w*t,e}scaleAndAddToRef(t,e){return e.x+=this.x*t,e.y+=this.y*t,e.z+=this.z*t,e.w+=this.w*t,e}equals(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w}equalsWithEpsilon(t,e=s.kn){return t&&i.R.WithinEpsilon(this.x,t.x,e)&&i.R.WithinEpsilon(this.y,t.y,e)&&i.R.WithinEpsilon(this.z,t.z,e)&&i.R.WithinEpsilon(this.w,t.w,e)}equalsToFloats(t,e,r,i){return this.x===t&&this.y===e&&this.z===r&&this.w===i}multiplyInPlace(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiply(t){return new this.constructor(this.x*t.x,this.y*t.y,this.z*t.z,this.w*t.w)}multiplyToRef(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e.z=this.z*t.z,e.w=this.w*t.w,e}multiplyByFloats(t,e,r,i){return new this.constructor(this.x*t,this.y*e,this.z*r,this.w*i)}divide(t){return new this.constructor(this.x/t.x,this.y/t.y,this.z/t.z,this.w/t.w)}divideToRef(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e.z=this.z/t.z,e.w=this.w/t.w,e}divideInPlace(t){return this.divideToRef(t,this)}minimizeInPlace(t){return t.x<this.x&&(this.x=t.x),t.y<this.y&&(this.y=t.y),t.z<this.z&&(this.z=t.z),t.w<this.w&&(this.w=t.w),this}maximizeInPlace(t){return t.x>this.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this}floor(){return new this.constructor(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))}fract(){return new this.constructor(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}normalize(){let t=this.length();return 0===t?this:this.scaleInPlace(1/t)}
1toVector3(){return new c(this.x,this.y,this.z)}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copyFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}copyFromFloats(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this}set(t,e,r,i){return this.copyFromFloats(t,e,r,i)}setAll(t){return this.x=this.y=this.z=this.w=t,this}static FromArray(t,e){return e||(e=0),new y(t[e],t[e+1],t[e+2],t[e+3])}static FromArrayToRef(t,e,r){return r.x=t[e],r.y=t[e+1],r.z=t[e+2],r.w=t[e+3],r}static FromFloatArrayToRef(t,e,r){return y.FromArrayToRef(t,e,r),r}static FromFloatsToRef(t,e,r,i,s){return s.x=t,s.y=e,s.z=r,s.w=i,s}static Zero(){return new y(0,0,0,0)}static One(){return new y(1,1,1,1)}static Random(t=0,e=1){return new y(i.R.RandomRange(t,e),i.R.RandomRange(t,e),i.R.RandomRange(t,e),i.R.RandomRange(t,e))}static get ZeroReadOnly(){return y._ZeroReadOnly}static Normalize(t){let e=y.Zero();return y.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return e.copyFrom(t),e.normalize(),e}static Minimize(t,e){let r=new t.constructor;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new t.constructor;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(y.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y,s=t.z-e.z,o=t.w-e.w;return r*r+i*i+s*s+o*o}static Center(t,e){return y.CenterToRef(t,e,y.Zero())}static CenterToRef(t,e,r){return r.copyFromFloats((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2,(t.w+e.w)/2)}static TransformCoordinates(t,e){let r=y.Zero();return y.TransformCoordinatesToRef(t,e,r),r}static TransformCoordinatesToRef(t,e,r){return y.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformCoordinatesFromFloatsToRef(t,e,r,i,s){let o=i.m,n=t*o[0]+e*o[4]+r*o[8]+o[12],a=t*o[1]+e*o[5]+r*o[9]+o[13],h=t*o[2]+e*o[6]+r*o[10]+o[14],_=t*o[3]+e*o[7]+r*o[11]+o[15];return s.x=n,s.y=a,s.z=h,s.w=_,s}static TransformNormal(t,e){let r=new t.constructor;return y.TransformNormalToRef(t,e,r),r}static TransformNormalToRef(t,e,r){let i=e.m,s=t.x*i[0]+t.y*i[4]+t.z*i[8],o=t.x*i[1]+t.y*i[5]+t.z*i[9],n=t.x*i[2]+t.y*i[6]+t.z*i[10];return r.x=s,r.y=o,r.z=n,r.w=t.w,r}static TransformNormalFromFloatsToRef(t,e,r,i,s,o){let n=s.m;return o.x=t*n[0]+e*n[4]+r*n[8],o.y=t*n[1]+e*n[5]+r*n[9],o.z=t*n[2]+e*n[6]+r*n[10],o.w=i,o}static FromVector3(t,e=0){return new y(t._x,t._y,t._z,e)}}y._ZeroReadOnly=y.Zero();class u{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}get w(){return this._w}set w(t){this._w=t,this._isDirty=!0}constructor(t=0,e=0,r=0,i=1){this._isDirty=!0,this._x=t,this._y=e,this._z=r,this._w=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){let t=_(this._x),e=_(this._y),r=_(this._z),i=_(this._w),s=t;return 397*(s=397*(s=397*s^e)^r)^i}asArray(){return[this._x,this._y,this._z,this._w]}toArray(t,e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,this}equals(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z&&this._w===t._w}equalsWithEpsilon(t,e=s.kn){return t&&i.R.WithinEpsilon(this._x,t._x,e)&&i.R.WithinEpsilon(this._y,t._y,e)&&i.R.WithinEpsilon(this._z,t._z,e)&&i.R.WithinEpsilon(this._w,t._w,e)}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copyFrom(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._w=t._w,this._isDirty=!0,this}copyFromFloats(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this._isDirty=!0,this}set(t,e,r,i){return this.copyFromFloats(t,e,r,i)}add(t){return new this.constructor(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)}addInPlace(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._w+=t._w,this._isDirty=!0,this}subtract(t){return new this.constructor(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)}subtractInPlace(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this._w-=t._w,this._isDirty=!0,this}scale(t){return new this.constructor(this._x*t,this._y*t,this._z*t,this._w*t)}scaleToRef(t,e){return e._x=this._x*t,e._y=this._y*t,e._z=this._z*t,e._w=this._w*t,e._isDirty=!0,e}scaleInPlace(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this._isDirty=!0,this}scaleAndAddToRef(t,e){return e._x+=this._x*t,e._y+=this._y*t,e._z+=this._z*t,e._w+=this._w*t,e._isDirty=!0,e}multiply(t){let e=new this.constructor(0,0,0,1);return this.multiplyToRef(t,e),e}multiplyToRef(t,e){let r=this._x*t._w+this._y*t._z-this._z*t._y+this._w*t._x,i=-this._x*t._z+this._y*t._w+this._z*t._x+this._w*t._y,s=this._x*t._y-this._y*t._x+this._z*t._w+this._w*t._z,o=-this._x*t._x-this._y*t._y-this._z*t._z+this._w*t._w;return e.copyFromFloats(r,i,s,o),e}multiplyInPlace(t){return this.multiplyToRef(t,this),this}conjugateToRef(t){return t.copyFromFloats(-this._x,-this._y,-this._z,this._w),t}
1conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new this.constructor(-this._x,-this._y,-this._z,this._w)}invert(){let t=this.conjugate(),e=this.lengthSquared();return 0==e||1==e||t.scaleInPlace(1/e),t}invertInPlace(){this.conjugateInPlace();let t=this.lengthSquared();return 0==t||1==t||this.scaleInPlace(1/t),this}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){let t=this.length();return 0===t||this.scaleInPlace(1/t),this}normalizeToNew(){let t=this.length();return 0===t?this.clone():this.scale(1/t)}toEulerAngles(){let t=c.Zero();return this.toEulerAnglesToRef(t),t}toEulerAnglesToRef(t){let e=this._z,r=this._x,i=this._y,s=this._w,o=i*e-r*s;if(o<-.4999999)t._y=2*Math.atan2(i,s),t._x=Math.PI/2,t._z=0,t._isDirty=!0;else if(o>.4999999)t._y=2*Math.atan2(i,s),t._x=-Math.PI/2,t._z=0,t._isDirty=!0;else{let n=s*s,a=e*e,h=r*r,_=i*i;t._z=Math.atan2(2*(r*i+e*s),-a-h+_+n),t._x=Math.asin(-2*o),t._y=Math.atan2(2*(e*r+i*s),a-h-_+n),t._isDirty=!0}return t}toRotationMatrix(t){return m.FromQuaternionToRef(this,t),t}fromRotationMatrix(t){return u.FromRotationMatrixToRef(t,this),this}static FromRotationMatrix(t){let e=new u;return u.FromRotationMatrixToRef(t,e),e}static FromRotationMatrixToRef(t,e){let r;let i=t.m,s=i[0],o=i[4],n=i[8],a=i[1],h=i[5],_=i[9],l=i[2],c=i[6],y=i[10],u=s+h+y;return u>0?(r=.5/Math.sqrt(u+1),e._w=.25/r,e._x=(c-_)*r,e._y=(n-l)*r,e._z=(a-o)*r):s>h&&s>y?(r=2*Math.sqrt(1+s-h-y),e._w=(c-_)/r,e._x=.25*r,e._y=(o+a)/r,e._z=(n+l)/r):h>y?(r=2*Math.sqrt(1+h-s-y),e._w=(n-l)/r,e._x=(o+a)/r,e._y=.25*r,e._z=(_+c)/r):(r=2*Math.sqrt(1+y-s-h),e._w=(a-o)/r,e._x=(n+l)/r,e._y=(_+c)/r,e._z=.25*r),e._isDirty=!0,e}static Dot(t,e){return t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w}static AreClose(t,e,r=.1){let i=u.Dot(t,e);return 1-i*i<=r}static SmoothToRef(t,e,r,s,o){let n=0===s?1:r/s;return n=i.R.Clamp(n,0,1),u.SlerpToRef(t,e,n,o),o}static Zero(){return new u(0,0,0,0)}static Inverse(t){return new t.constructor(-t._x,-t._y,-t._z,t._w)}static InverseToRef(t,e){return e.set(-t._x,-t._y,-t._z,t._w),e}static Identity(){return new u(0,0,0,1)}static IsIdentity(t){return t&&0===t._x&&0===t._y&&0===t._z&&1===t._w}static RotationAxis(t,e){return u.RotationAxisToRef(t,e,new u)}static RotationAxisToRef(t,e,r){let i=Math.sin(e/2);return t.normalize(),r._w=Math.cos(e/2),r._x=t._x*i,r._y=t._y*i,r._z=t._z*i,r._isDirty=!0,r}static FromArray(t,e){return e||(e=0),new u(t[e],t[e+1],t[e+2],t[e+3])}static FromArrayToRef(t,e,r){return r._x=t[e],r._y=t[e+1],r._z=t[e+2],r._w=t[e+3],r._isDirty=!0,r}static FromEulerAngles(t,e,r){let i=new u;return u.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerAnglesToRef(t,e,r,i){return u.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerVector(t){let e=new u;return u.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromEulerVectorToRef(t,e){return u.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromUnitVectorsToRef(t,e,r){let i=c.Dot(t,e)+1;return i<s.kn?Math.abs(t.x)>Math.abs(t.z)?r.set(-t.y,t.x,0,0):r.set(0,-t.z,t.y,0):(c.CrossToRef(t,e,R.Vector3[0]),r.set(R.Vector3[0].x,R.Vector3[0].y,R.Vector3[0].z,i)),r.normalize()}static RotationYawPitchRoll(t,e,r){let i=new u;return u.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){let s=.5*r,o=.5*e,n=.5*t,a=Math.sin(s),h=Math.cos(s),_=Math.sin(o),l=Math.cos(o),c=Math.sin(n),y=Math.cos(n);return i._x=y*_*h+c*l*a,i._y=c*l*h-y*_*a,i._z=y*l*a-c*_*h,i._w=y*l*h+c*_*a,i._isDirty=!0,i}static RotationAlphaBetaGamma(t,e,r){let i=new u;return u.RotationAlphaBetaGammaToRef(t,e,r,i),i}static RotationAlphaBetaGammaToRef(t,e,r,i){let s=(r+t)*.5,o=(r-t)*.5,n=.5*e;return i._x=Math.cos(o)*Math.sin(n),i._y=Math.sin(o)*Math.sin(n),i._z=Math.sin(s)*Math.cos(n),i._w=Math.cos(s)*Math.cos(n),i._isDirty=!0,i}static RotationQuaternionFromAxis(t,e,r){let i=new u(0,0,0,0);return u.RotationQuaternionFromAxisToRef(t,e,r,i),i}static RotationQuaternionFromAxisToRef(t,e,r,i){let s=x.Matrix[0];return m.FromXYZAxesToRef(t.normalize(),e.normalize(),r.normalize(),s),u.FromRotationMatrixToRef(s,i),i}static FromLookDirectionLH(t,e){let r=new u;return u.FromLookDirectionLHToRef(t,e,r),r}static FromLookDirectionLHToRef(t,e,r){let i=x.Matrix[0];return m.LookDirectionLHToRef(t,e,i),u.FromRotationMatrixToRef(i,r),r}static FromLookDirectionRH(t,e){let r=new u;return u.FromLookDirectionRHToRef(t,e,r),r}static FromLookDirectionRHToRef(t,e,r){let i=x.Matrix[0];return m.LookDirectionRHToRef(t,e,i),u.FromRotationMatrixToRef(i,r)}static Slerp(t,e,r){let i=u.Identity();return u.SlerpToRef(t,e,r,i),i}static SlerpToRef(t,e,r,i){let s,o;let n=t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w,a=!1;if(n<0&&(a=!0,n=-n),n>.999999)o=1-r,s=a?-r:r;
1else{let t=Math.acos(n),e=1/Math.sin(t);o=Math.sin((1-r)*t)*e,s=a?-Math.sin(r*t)*e:Math.sin(r*t)*e}return i._x=o*t._x+s*e._x,i._y=o*t._y+s*e._y,i._z=o*t._z+s*e._z,i._w=o*t._w+s*e._w,i._isDirty=!0,i}static Hermite(t,e,r,i,s){let o=s*s,n=s*o,a=2*n-3*o+1,h=-2*n+3*o,_=n-2*o+s,l=n-o,c=t._x*a+r._x*h+e._x*_+i._x*l,y=t._y*a+r._y*h+e._y*_+i._y*l,u=t._z*a+r._z*h+e._z*_+i._z*l,m=t._w*a+r._w*h+e._w*_+i._w*l;return new t.constructor(c,y,u,m)}static Hermite1stDerivative(t,e,r,i,s){let o=new t.constructor;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let n=s*s;return o._x=(n-s)*6*t._x+(3*n-4*s+1)*e._x+(-n+s)*6*r._x+(3*n-2*s)*i._x,o._y=(n-s)*6*t._y+(3*n-4*s+1)*e._y+(-n+s)*6*r._y+(3*n-2*s)*i._y,o._z=(n-s)*6*t._z+(3*n-4*s+1)*e._z+(-n+s)*6*r._z+(3*n-2*s)*i._z,o._w=(n-s)*6*t._w+(3*n-4*s+1)*e._w+(-n+s)*6*r._w+(3*n-2*s)*i._w,o._isDirty=!0,o}}class m{static get Use64Bits(){return a.Z.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=m._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(t,e=!1,r=!1,i=!0){this._isIdentity=t,this._isIdentity3x2=t||r,this._isIdentityDirty=!this._isIdentity&&e,this._isIdentity3x2Dirty=!this._isIdentity3x2&&i}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,a.Z.MatrixTrackPrecisionChange&&a.Z.MatrixTrackedMatrices.push(this),this._m=new a.Z.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;let t=this._m;this._isIdentity=1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]?this._isIdentity3x2=!1:0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(!0===this._isIdentity)return 1;let t=this._m,e=t[0],r=t[1],i=t[2],s=t[3],o=t[4],n=t[5],a=t[6],h=t[7],_=t[8],l=t[9],c=t[10],y=t[11],u=t[12],m=t[13],x=t[14],R=t[15],f=c*R-x*y,d=l*R-m*y,z=l*x-m*c,T=_*R-u*y,w=_*x-c*u,p=_*m-u*l;return e*+(n*f-a*d+h*z)+-(r*(o*f-a*T+h*w))+i*+(o*d-n*T+h*p)+-(s*(o*z-n*w+a*p))}toArray(){return this._m}asArray(){return this._m}invert(){return this.invertToRef(this),this}reset(){return m.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(t){let e=new this.constructor;return this.addToRef(t,e),e}addToRef(t,e){let r=this._m,i=e._m,s=t.m;for(let t=0;t<16;t++)i[t]=r[t]+s[t];return e.markAsUpdated(),e}addToSelf(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]+=r[t];return this.markAsUpdated(),this}invertToRef(t){if(!0===this._isIdentity)return m.IdentityToRef(t),t;let e=this._m,r=e[0],i=e[1],s=e[2],o=e[3],n=e[4],a=e[5],h=e[6],_=e[7],l=e[8],c=e[9],y=e[10],u=e[11],x=e[12],R=e[13],f=e[14],d=e[15],z=y*d-f*u,T=c*d-R*u,w=c*f-R*y,p=l*d-x*u,F=l*f-y*x,I=l*R-x*c,M=+(a*z-h*T+_*w),g=-(n*z-h*p+_*F),D=+(n*T-a*p+_*I),P=-(n*w-a*F+h*I),A=r*M+i*g+s*D+o*P;if(0===A)return t.copyFrom(this),t;let V=1/A,C=h*d-f*_,L=a*d-R*_,k=a*f-R*h,H=n*d-x*_,v=n*f-x*h,O=n*R-x*a,b=h*u-y*_,S=a*u-c*_,B=a*y-c*h,U=n*u-l*_,Z=n*y-l*h,q=n*c-l*a;return m.FromValuesToRef(M*V,-(i*z-s*T+o*w)*V,+(i*C-s*L+o*k)*V,-(i*b-s*S+o*B)*V,g*V,+(r*z-s*p+o*F)*V,-(r*C-s*H+o*v)*V,+(r*b-s*U+o*Z)*V,D*V,-(r*T-i*p+o*I)*V,+(r*L-i*H+o*O)*V,-(r*S-i*U+o*q)*V,P*V,+(r*w-i*F+s*I)*V,-(r*k-i*v+s*O)*V,+(r*B-i*Z+s*q)*V,t),t}addAtIndex(t,e){return this._m[t]+=e,this.markAsUpdated(),this}multiplyAtIndex(t,e){return this._m[t]*=e,this.markAsUpdated(),this}setTranslationFromFloats(t,e,r){return this._m[12]=t,this._m[13]=e,this._m[14]=r,this.markAsUpdated(),this}addTranslationFromFloats(t,e,r){return this._m[12]+=t,this._m[13]+=e,this._m[14]+=r,this.markAsUpdated(),this}setTranslation(t){return this.setTranslationFromFloats(t._x,t._y,t._z)}getTranslation(){return new c(this._m[12],this._m[13],this._m[14])}getTranslationToRef(t){return t.x=this._m[12],t.y=this._m[13],t.z=this._m[14],t}removeRotationAndScaling(){let t=this.m;return m.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&
10===t[13]&&0===t[14]&&1===t[15]),this}multiply(t){let e=new this.constructor;return this.multiplyToRef(t,e),e}copyFrom(t){return t.copyToArray(this._m),this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(t,e=0){let r=this._m;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],this}multiplyToRef(t,e){return this._isIdentity?e.copyFrom(t):t._isIdentity?e.copyFrom(this):(this.multiplyToArray(t,e._m,0),e.markAsUpdated()),e}multiplyToArray(t,e,r){let i=this._m,s=t.m,o=i[0],n=i[1],a=i[2],h=i[3],_=i[4],l=i[5],c=i[6],y=i[7],u=i[8],m=i[9],x=i[10],R=i[11],f=i[12],d=i[13],z=i[14],T=i[15],w=s[0],p=s[1],F=s[2],I=s[3],M=s[4],g=s[5],D=s[6],P=s[7],A=s[8],V=s[9],C=s[10],L=s[11],k=s[12],H=s[13],v=s[14],O=s[15];return e[r]=o*w+n*M+a*A+h*k,e[r+1]=o*p+n*g+a*V+h*H,e[r+2]=o*F+n*D+a*C+h*v,e[r+3]=o*I+n*P+a*L+h*O,e[r+4]=_*w+l*M+c*A+y*k,e[r+5]=_*p+l*g+c*V+y*H,e[r+6]=_*F+l*D+c*C+y*v,e[r+7]=_*I+l*P+c*L+y*O,e[r+8]=u*w+m*M+x*A+R*k,e[r+9]=u*p+m*g+x*V+R*H,e[r+10]=u*F+m*D+x*C+R*v,e[r+11]=u*I+m*P+x*L+R*O,e[r+12]=f*w+d*M+z*A+T*k,e[r+13]=f*p+d*g+z*V+T*H,e[r+14]=f*F+d*D+z*C+T*v,e[r+15]=f*I+d*P+z*L+T*O,this}equals(t){if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;let e=this.m,r=t.m;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}clone(){let t=new this.constructor;return t.copyFrom(this),t}getClassName(){return"Matrix"}getHashCode(){let t=_(this._m[0]);for(let e=1;e<16;e++)t=397*t^_(this._m[e]);return t}decomposeToTransformNode(t){return t.rotationQuaternion=t.rotationQuaternion||new u,this.decompose(t.scaling,t.rotationQuaternion,t.position)}decompose(t,e,r,i){if(this._isIdentity)return r&&r.setAll(0),t&&t.setAll(1),e&&e.copyFromFloats(0,0,0,1),!0;let s=this._m;if(r&&r.copyFromFloats(s[12],s[13],s[14]),(t=t||x.Vector3[0]).x=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),t.y=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),t.z=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]),i){let e=i.scaling.x<0?-1:1,r=i.scaling.y<0?-1:1,s=i.scaling.z<0?-1:1;t.x*=e,t.y*=r,t.z*=s}else 0>=this.determinant()&&(t.y*=-1);if(0===t._x||0===t._y||0===t._z)return e&&e.copyFromFloats(0,0,0,1),!1;if(e){let r=1/t._x,i=1/t._y,o=1/t._z;m.FromValuesToRef(s[0]*r,s[1]*r,s[2]*r,0,s[4]*i,s[5]*i,s[6]*i,0,s[8]*o,s[9]*o,s[10]*o,0,0,0,0,1,x.Matrix[0]),u.FromRotationMatrixToRef(x.Matrix[0],e)}return!0}getRow(t){if(t<0||t>3)return null;let e=4*t;return new y(this._m[e+0],this._m[e+1],this._m[e+2],this._m[e+3])}getRowToRef(t,e){if(t>=0&&t<3){let r=4*t;e.x=this._m[r+0],e.y=this._m[r+1],e.z=this._m[r+2],e.w=this._m[r+3]}return e}setRow(t,e){return this.setRowFromFloats(t,e.x,e.y,e.z,e.w)}transpose(){let t=new this.constructor;return m.TransposeToRef(this,t),t}transposeToRef(t){return m.TransposeToRef(this,t),t}setRowFromFloats(t,e,r,i,s){if(t<0||t>3)return this;let o=4*t;return this._m[o+0]=e,this._m[o+1]=r,this._m[o+2]=i,this._m[o+3]=s,this.markAsUpdated(),this}scale(t){let e=new this.constructor;return this.scaleToRef(t,e),e}scaleToRef(t,e){for(let r=0;r<16;r++)e._m[r]=this._m[r]*t;return e.markAsUpdated(),e}scaleAndAddToRef(t,e){for(let r=0;r<16;r++)e._m[r]+=this._m[r]*t;return e.markAsUpdated(),e}toNormalMatrix(t){let e=x.Matrix[0];this.invertToRef(e),e.transposeToRef(t);let r=t._m;return m.FromValuesToRef(r[0],r[1],r[2],0,r[4],r[5],r[6],0,r[8],r[9],r[10],0,0,0,0,1,t),t}getRotationMatrix(){let t=new this.constructor;return this.getRotationMatrixToRef(t),t}getRotationMatrixToRef(t){let e=x.Vector3[0];if(!this.decompose(e))return m.IdentityToRef(t),t;let r=this._m,i=1/e._x,s=1/e._y,o=1/e._z;return m.FromValuesToRef(r[0]*i,r[1]*i,r[2]*i,0,r[4]*s,r[5]*s,r[6]*s,0,r[8]*o,r[9]*o,r[10]*o,0,0,0,0,1,t),t}toggleModelMatrixHandInPlace(){let t=this._m;return t[2]*=-1,t[6]*=-1,t[8]*=-1,t[9]*=-1,t[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){let t=this._m;return t[8]*=-1,t[9]*=-1,t[10]*=-1,t[11]*=-1,this.markAsUpdated(),this}static FromArray(t,e=0){let r=new m;return m.FromArrayToRef(t,e,r),r}static FromArrayToRef(t,e,r){for(let i=0;i<16;i++)r._m[i]=t[i+e];return r.markAsUpdated(),r}static FromFloat32ArrayToRefScaled(t,e,r,i){for(let s=0;s<16;s++)i._m[s]=t[s+e]*r;return i.markAsUpdated(),i}static get IdentityReadOnly(){return m._IdentityReadOnly}static FromValuesToRef(t,e,r,i,s,o,n,a,h,_,l,c,y,u,m,x,R){let f=R._m;f[0]=t,f[1]=e,f[2]=r,f[3]=i,f[4]=s,f[5]=o,f[6]=n,f[7]=a,f[8]=h,f[9]=_,f[10]=l,f[11]=c,f[12]=y,f[13]=u,f[14]=m,f[15]=x,R.markAsUpdated()}static FromValues(t,e,r,i,s,o,n,a,h,_,l,c,y,u,x,R){let f=new m,d=f._m;return d[0]=t,d[1]=e,d[2]=r,d[3]=i,d[4]=s,d[5]=o,d[6]=n,d[7]=a,d[8]=h,d[9]=_,d[10]=l,d[11]=c,d[12]=y,d[13]=u,d[14]=x,d[15]=R,f.markAsUpdated(),f}static Compose(t,e,r){let i=new m;return m.ComposeToRef(t,e,r,i),i}static ComposeToRef(t,e,r,i){let s=i._m,o=e._x,n=e._y,a=e._z,h=e._w,_=o+o,l=n+n,c=a+a,y=o*_,u=o*l,m=o*c,x=n*l,R=n*c,f=a*c,d=h*_,z=h*l,T=h*c,w=t._x,p=t._y,F=t._z;return s[0]=(1-(x+f))*w,s[1]=(u+T)*w,s[2]=(m-z)*w,s[3]=0,s[4]=(u-T)*p,s[5]=(1-(y+f))*p,s[6]=(R+d)*p,s[7]=0,s[8]=(m+z)*F,s[9]=(R-d)*F,s[10]=(1-(y+x))*F,s[11]=0,s[12]=r._x,s[13]=r._y,s[14]=r._z,s[15]=1,i.markAsUpdated(),i}static Identity(){let t=m.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t}static IdentityToRef(t){return m.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0),t}static Zero(){let t=m.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t}static RotationX(t){let e=new m;return m.RotationXToRef(t,e),e}static Invert(t){let e=new t.constructor;return t.invertToRef(e),e}static RotationXToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return m.FromValuesToRef(1,0,0,0,0,i,r,0,0,-r,i,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationY(t){let e=new m;return m.RotationYToRef(t,e),e}static RotationYToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return m.FromValuesToRef(i,0,-r,0,0,1,0,0,r,0,i,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationZ(t){let e=new m;return m.RotationZToRef(t,e),e}static RotationZToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return m.FromValuesToRef(i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationAxis(t,e){let r=new m;return m.RotationAxisToRef(t,e,r),r}static RotationAxisToRef(t,e,r){let i=Math.sin(-e),s=Math.cos(-e),o=1-s;t.normalize();let n=r._m;return n[0]=t._x*t._x*o+s,n[1]=t._x*t._y*o-t._z*i,n[2]=t._x*t._z*o+t._y*i,n[3]=0,n[4]=t._y*t._x*o+t._z*i,n[5]=t._y*t._y*o+s,n[6]=t._y*t._z*o-t._x*i,n[7]=0,n[8]=t._z*t._x*o-t._y*i,n[9]=t._z*t._y*o+t._x*i,n[10]=t._z*t._z*o+s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,r.markAsUpdated(),r}static RotationAlignToRef(t,e,r){let i=c.Dot(e,t),o=r._m;if(i<-1+s.kn)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0;else{let r=c.Cross(e,t),s=1/(1+i);o[0]=r._x*r._x*s+i,o[1]=r._y*r._x*s-r._z,o[2]=r._z*r._x*s+r._y,o[3]=0,o[4]=r._x*r._y*s+r._z,o[5]=r._y*r._y*s+i,o[6]=r._z*r._y*s-r._x,o[7]=0,o[8]=r._x*r._z*s-r._y,o[9]=r._y*r._z*s+r._x,o[10]=r._z*r._z*s+i,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,r.markAsUpdated(),r}static RotationYawPitchRoll(t,e,r){let i=new m;return m.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){return u.RotationYawPitchRollToRef(t,e,r,x.Quaternion[0]),x.Quaternion[0].toRotationMatrix(i),i}static Scaling(t,e,r){let i=new m;return m.ScalingToRef(t,e,r,i),i}static ScalingToRef(t,e,r,i){return m.FromValuesToRef(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1,i),i._updateIdentityStatus(1===t&&1===e&&1===r),i}static Translation(t,e,r){let i=new m;return m.TranslationToRef(t,e,r,i),i}static TranslationToRef(t,e,r,i){return m.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1,i),i._updateIdentityStatus(0===t&&0===e&&0===r),i}static Lerp(t,e,r){let i=new t.constructor;return m.LerpToRef(t,e,r,i),i}static LerpToRef(t,e,r,i){let s=i._m,o=t.m,n=e.m;for(let t=0;t<16;t++)s[t]=o[t]*(1-r)+n[t]*r;return i.markAsUpdated(),i}static DecomposeLerp(t,e,r){let i=new t.constructor;return m.DecomposeLerpToRef(t,e,r,i),i}static DecomposeLerpToRef(t,e,r,i){let s=x.Vector3[0],o=x.Quaternion[0],n=x.Vector3[1];t.decompose(s,o,n);
1let a=x.Vector3[2],h=x.Quaternion[1],_=x.Vector3[3];e.decompose(a,h,_);let l=x.Vector3[4];c.LerpToRef(s,a,r,l);let y=x.Quaternion[2];u.SlerpToRef(o,h,r,y);let R=x.Vector3[5];return c.LerpToRef(n,_,r,R),m.ComposeToRef(l,y,R,i),i}static LookAtLH(t,e,r){let i=new m;return m.LookAtLHToRef(t,e,r,i),i}static LookAtLHToRef(t,e,r,i){let s=x.Vector3[0],o=x.Vector3[1],n=x.Vector3[2];e.subtractToRef(t,n),n.normalize(),c.CrossToRef(r,n,s);let a=s.lengthSquared();0===a?s.x=1:s.normalizeFromLength(Math.sqrt(a)),c.CrossToRef(n,s,o),o.normalize();let h=-c.Dot(s,t),_=-c.Dot(o,t),l=-c.Dot(n,t);m.FromValuesToRef(s._x,o._x,n._x,0,s._y,o._y,n._y,0,s._z,o._z,n._z,0,h,_,l,1,i)}static LookAtRH(t,e,r){let i=new m;return m.LookAtRHToRef(t,e,r,i),i}static LookAtRHToRef(t,e,r,i){let s=x.Vector3[0],o=x.Vector3[1],n=x.Vector3[2];t.subtractToRef(e,n),n.normalize(),c.CrossToRef(r,n,s);let a=s.lengthSquared();0===a?s.x=1:s.normalizeFromLength(Math.sqrt(a)),c.CrossToRef(n,s,o),o.normalize();let h=-c.Dot(s,t),_=-c.Dot(o,t),l=-c.Dot(n,t);return m.FromValuesToRef(s._x,o._x,n._x,0,s._y,o._y,n._y,0,s._z,o._z,n._z,0,h,_,l,1,i),i}static LookDirectionLH(t,e){let r=new m;return m.LookDirectionLHToRef(t,e,r),r}static LookDirectionLHToRef(t,e,r){let i=x.Vector3[0];i.copyFrom(t),i.scaleInPlace(-1);let s=x.Vector3[1];return c.CrossToRef(e,i,s),m.FromValuesToRef(s._x,s._y,s._z,0,e._x,e._y,e._z,0,i._x,i._y,i._z,0,0,0,0,1,r),r}static LookDirectionRH(t,e){let r=new m;return m.LookDirectionRHToRef(t,e,r),r}static LookDirectionRHToRef(t,e,r){let i=x.Vector3[2];return c.CrossToRef(e,t,i),m.FromValuesToRef(i._x,i._y,i._z,0,e._x,e._y,e._z,0,t._x,t._y,t._z,0,0,0,0,1,r),r}static OrthoLH(t,e,r,i,s){let o=new m;return m.OrthoLHToRef(t,e,r,i,o,s),o}static OrthoLHToRef(t,e,r,i,s,o){let n=2/t,a=2/e,h=2/(i-r),_=-(i+r)/(i-r);return m.FromValuesToRef(n,0,0,0,0,a,0,0,0,0,h,0,0,0,_,1,s),o&&s.multiplyToRef(f,s),s._updateIdentityStatus(1===n&&1===a&&1===h&&0===_),s}static OrthoOffCenterLH(t,e,r,i,s,o,n){let a=new m;return m.OrthoOffCenterLHToRef(t,e,r,i,s,o,a,n),a}static OrthoOffCenterLHToRef(t,e,r,i,s,o,n,a){return m.FromValuesToRef(2/(e-t),0,0,0,0,2/(i-r),0,0,0,0,2/(o-s),0,(t+e)/(t-e),(i+r)/(r-i),-(o+s)/(o-s),1,n),a&&n.multiplyToRef(f,n),n.markAsUpdated(),n}static OrthoOffCenterRH(t,e,r,i,s,o,n){let a=new m;return m.OrthoOffCenterRHToRef(t,e,r,i,s,o,a,n),a}static OrthoOffCenterRHToRef(t,e,r,i,s,o,n,a){return m.OrthoOffCenterLHToRef(t,e,r,i,s,o,n,a),n._m[10]*=-1,n}static PerspectiveLH(t,e,r,i,s,o=0){let n=new m;return m.FromValuesToRef(2*r/t,0,0,0,0,2*r/e,0,Math.tan(o),0,0,(i+r)/(i-r),1,0,0,-2*i*r/(i-r),0,n),s&&n.multiplyToRef(f,n),n._updateIdentityStatus(!1),n}static PerspectiveFovLH(t,e,r,i,s,o=0,n=!1){let a=new m;return m.PerspectiveFovLHToRef(t,e,r,i,a,!0,s,o,n),a}static PerspectiveFovLHToRef(t,e,r,i,s,o=!0,n,a=0,h=!1){let _=1/Math.tan(.5*t),l=o?_/e:_,c=o?_:_*e,y=h&&0===r?-1:0!==i?(i+r)/(i-r):1,u=h&&0===r?2*i:0!==i?-2*i*r/(i-r):-2*r;return m.FromValuesToRef(l,0,0,0,0,c,0,Math.tan(a),0,0,y,1,0,0,u,0,s),n&&s.multiplyToRef(f,s),s._updateIdentityStatus(!1),s}static PerspectiveFovReverseLHToRef(t,e,r,i,s,o=!0,n,a=0){let h=1/Math.tan(.5*t),_=o?h/e:h,l=o?h:h*e;return m.FromValuesToRef(_,0,0,0,0,l,0,Math.tan(a),0,0,-r,1,0,0,1,0,s),n&&s.multiplyToRef(f,s),s._updateIdentityStatus(!1),s}static PerspectiveFovRH(t,e,r,i,s,o=0,n=!1){let a=new m;return m.PerspectiveFovRHToRef(t,e,r,i,a,!0,s,o,n),a}static PerspectiveFovRHToRef(t,e,r,i,s,o=!0,n,a=0,h=!1){let _=1/Math.tan(.5*t),l=o?_/e:_,c=o?_:_*e,y=h&&0===r?1:0!==i?-(i+r)/(i-r):-1,u=h&&0===r?2*i:0!==i?-2*i*r/(i-r):-2*r;return m.FromValuesToRef(l,0,0,0,0,c,0,Math.tan(a),0,0,y,-1,0,0,u,0,s),n&&s.multiplyToRef(f,s),s._updateIdentityStatus(!1),s}static PerspectiveFovReverseRHToRef(t,e,r,i,s,o=!0,n,a=0){let h=1/Math.tan(.5*t),_=o?h/e:h,l=o?h:h*e;return m.FromValuesToRef(_,0,0,0,0,l,0,Math.tan(a),0,0,-r,-1,0,0,-1,0,s),n&&s.multiplyToRef(f,s),s._updateIdentityStatus(!1),s}static PerspectiveFovWebVRToRef(t,e,r,i,s=!1,o,n=0){let a=Math.tan(t.upDegrees*Math.PI/180),h=Math.tan(t.downDegrees*Math.PI/180),_=Math.tan(t.leftDegrees*Math.PI/180),l=Math.tan(t.rightDegrees*Math.PI/180),c=2/(_+l),y=2/(a+h),u=i._m;return u[0]=c,u[1]=u[2]=u[3]=u[4]=0,u[5]=y,u[6]=0,u[7]=Math.tan(n),u[8]=(_-l)*c*.5,u[9]=-((a-h)*y*.5),u[10]=-r/(e-r),u[11]=1*(s?-1:1),u[12]=u[13]=u[15]=0,u[14]=-(2*r*e)/(r-e),o&&i.multiplyToRef(f,i),i.markAsUpdated(),i}static GetFinalMatrix(t,e,r,i,s,o){let n=t.width,a=t.height,h=t.x,_=t.y,l=m.FromValues(n/2,0,0,0,0,-a/2,0,0,0,0,o-s,0,h+n/2,a/2+_,s,1),c=new e.constructor;return e.multiplyToRef(r,c),c.multiplyToRef(i,c),c.multiplyToRef(l,c)}static GetAsMatrix2x2(t){let e=t.m,r=[e[0],e[1],e[4],e[5]];return a.Z.MatrixUse64Bits?r:new Float32Array(r)}static GetAsMatrix3x3(t){let e=t.m,r=[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]];return a.Z.MatrixUse64Bits?r:new Float32Array(r)}static Transpose(t){let e=new t.constructor;return m.TransposeToRef(t,e),e}static TransposeToRef(t,e){let r=e._m,i=t.m;return r[0]=i[0],r[1]=i[4],r[2]=i[8],r[3]=i[12],r[4]=i[1],r[5]=i[5],r[6]=i[9],r[7]=i[13],r[8]=i[2],r[9]=i[6],r[10]=i[10],r[11]=i[14],r[12]=i[3],r[13]=i[7],r[14]=i[11],r[15]=i[15],e.markAsUpdated(),e._updateIdentityStatus(t._isIdentity,t._isIdentityDirt
1y),e}static Reflection(t){let e=new m;return m.ReflectionToRef(t,e),e}static ReflectionToRef(t,e){t.normalize();let r=t.normal.x,i=t.normal.y,s=t.normal.z,o=-2*r,n=-2*i,a=-2*s;return m.FromValuesToRef(o*r+1,n*r,a*r,0,o*i,n*i+1,a*i,0,o*s,n*s,a*s+1,0,o*t.d,n*t.d,a*t.d,1,e),e}static FromXYZAxesToRef(t,e,r,i){return m.FromValuesToRef(t._x,t._y,t._z,0,e._x,e._y,e._z,0,r._x,r._y,r._z,0,0,0,0,1,i),i}static FromQuaternionToRef(t,e){let r=t._x*t._x,i=t._y*t._y,s=t._z*t._z,o=t._x*t._y,n=t._z*t._w,a=t._z*t._x,h=t._y*t._w,_=t._y*t._z,l=t._x*t._w;return e._m[0]=1-2*(i+s),e._m[1]=2*(o+n),e._m[2]=2*(a-h),e._m[3]=0,e._m[4]=2*(o-n),e._m[5]=1-2*(s+r),e._m[6]=2*(_+l),e._m[7]=0,e._m[8]=2*(a+h),e._m[9]=2*(_-l),e._m[10]=1-2*(i+r),e._m[11]=0,e._m[12]=0,e._m[13]=0,e._m[14]=0,e._m[15]=1,e.markAsUpdated(),e}}m._UpdateFlagSeed=0,m._IdentityReadOnly=m.Identity();class x{}x.Vector3=o.B.BuildTuple(11,c.Zero),x.Matrix=o.B.BuildTuple(2,m.Identity),x.Quaternion=o.B.BuildTuple(3,u.Zero);class R{}R.Vector2=o.B.BuildTuple(3,l.Zero),R.Vector3=o.B.BuildTuple(13,c.Zero),R.Vector4=o.B.BuildTuple(3,y.Zero),R.Quaternion=o.B.BuildTuple(2,u.Zero),R.Matrix=o.B.BuildTuple(8,m.Identity),(0,n.H)("BABYLON.Vector2",l),(0,n.H)("BABYLON.Vector3",c),(0,n.H)("BABYLON.Vector4",y),(0,n.H)("BABYLON.Matrix",m);let f=m.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.