You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
3.5 KiB
10 lines
3.5 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("exports ../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass".split(" "),function(b,c,u,f,k,n,p,v){function t(a,d,g,h){const {loggerTag:e,stride:l}=d;return 0!==a.length%l?(h.error(e,`Invalid array length, expected a multiple of ${l}`),new g([])):a}function m(a,d,g,h,e){if(!a)return a;if(a instanceof d)return t(a,h,d,e);for(const l of g)if(a instanceof |
|
l)return t(new d(a),h,d,e);if(Array.isArray(a))return t(new d(a),h,d,e);g=g.map(l=>`'${l.name}'`);e.error(`Failed to set property, expected one of ${g}, but got ${a.constructor.name}`);return new d([])}function q(a,d,g){const h=Array(a.length);for(let e=0;e<a.length;e++)h[e]=a[e];d[g]=h}var r;b.MeshVertexAttributes=r=class extends u.JSONSupport{constructor(a){super(a);this.color=null;this.position=new Float64Array(0);this.tangent=this.normal=this.uv=null}castColor(a){return m(a,Uint8Array,[Uint8ClampedArray], |
|
{loggerTag:".color\x3d",stride:4},k.getLogger(this))}castPosition(a){a&&a instanceof Float32Array&&k.getLogger(this).warn(".position\x3d","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array");return m(a,Float64Array,[Float32Array],{loggerTag:".position\x3d",stride:3},k.getLogger(this))}castUv(a){return m(a,Float32Array,[Float64Array],{loggerTag:".uv\x3d",stride:2},k.getLogger(this))}castNormal(a){return m(a, |
|
Float32Array,[Float64Array],{loggerTag:".normal\x3d",stride:3},k.getLogger(this))}castTangent(a){return m(a,Float32Array,[Float64Array],{loggerTag:".tangent\x3d",stride:4},k.getLogger(this))}clone(){const a={position:f.clone(this.position),uv:f.clone(this.uv),normal:f.clone(this.normal),tangent:f.clone(this.tangent),color:f.clone(this.color)};return new r(a)}clonePositional(){const a={position:f.clone(this.position),normal:f.clone(this.normal),tangent:f.clone(this.tangent),uv:this.uv,color:this.color}; |
|
return new r(a)}get memoryUsage(){let a;a=0+this.position.byteLength;null!=this.uv&&(a+=this.uv.byteLength);null!=this.normal&&(a+=this.normal.byteLength);null!=this.tangent&&(a+=this.tangent.byteLength);null!=this.color&&(a+=this.color.byteLength);return a}};c.__decorate([n.property({json:{write:q}})],b.MeshVertexAttributes.prototype,"color",void 0);c.__decorate([p.cast("color")],b.MeshVertexAttributes.prototype,"castColor",null);c.__decorate([n.property({nonNullable:!0,json:{write:q}})],b.MeshVertexAttributes.prototype, |
|
"position",void 0);c.__decorate([p.cast("position")],b.MeshVertexAttributes.prototype,"castPosition",null);c.__decorate([n.property({json:{write:q}})],b.MeshVertexAttributes.prototype,"uv",void 0);c.__decorate([p.cast("uv")],b.MeshVertexAttributes.prototype,"castUv",null);c.__decorate([n.property({json:{write:q}})],b.MeshVertexAttributes.prototype,"normal",void 0);c.__decorate([p.cast("normal")],b.MeshVertexAttributes.prototype,"castNormal",null);c.__decorate([n.property({json:{write:q}})],b.MeshVertexAttributes.prototype, |
|
"tangent",void 0);c.__decorate([p.cast("tangent")],b.MeshVertexAttributes.prototype,"castTangent",null);b.MeshVertexAttributes=r=c.__decorate([v.subclass("esri.geometry.support.MeshVertexAttributes")],b.MeshVertexAttributes);b.castArray=m;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); |