UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 1.9 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as e,subclass as i}from"../../core/accessorSupport/decorators.js";import{fromRotationTranslationScale as s,invert as a,exactEquals as l}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as p}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as c,fromArray as u,fromValues as x,clone as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromAxisAndAngle as h,angle as b,angleRad as g,axis as j,up as y}from"./axisAngleDegrees.js";let A=class extends(o(r)){constructor(t){super(t),this.translation=c(),this.rotationAxis=u(y),this.rotationAngle=0,this.scale=x(1,1,1)}get rotation(){return h(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=f(j(t)),this.rotationAngle=b(t)}get localMatrix(){const t=n();return p(N,j(this.rotation),g(this.rotation)),s(t,N,this.translation,this.scale),t}get localMatrixInverse(){return a(n(),this.localMatrix)}equals(t){return this===t||null!=t&&l(this.localMatrix,t.localMatrix)}};t([e({type:[Number],nonNullable:!0,json:{write:!0}})],A.prototype,"translation",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],A.prototype,"rotationAxis",void 0),t([e({type:Number,nonNullable:!0,json:{write:!0}})],A.prototype,"rotationAngle",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],A.prototype,"scale",void 0),t([e()],A.prototype,"rotation",null),t([e()],A.prototype,"localMatrix",null),t([e()],A.prototype,"localMatrixInverse",null),A=t([i("esri.geometry.support.MeshTransform")],A);const N=m();export{A as default};