@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.91 kB
JavaScript
import{isNone as r,isSome as t}from"../../../../core/maybe.js";import{generateUID as s}from"../../../../core/uid.js";import{c as i}from"../../../../chunks/mat4.js";import{c as e}from"../../../../chunks/mat4f64.js";import{m as o}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec4f64.js";import{maxScale as n}from"../../support/mathUtils.js";class h{constructor(r,t={}){this.geometry=r,this.boundingSphere=a(),this.screenToWorldRatio=1,this._transformation=e(),this._shaderTransformationDirty=!0,this.id=s(),this.layerUid=t.layerUid,this.graphicUid=t.graphicUid,this.boundingInfo=t.boundingInfo,this.shaderTransformer=t.shaderTransformer,this.castShadow=!!t.castShadow&&t.castShadow}get transformation(){return this._transformation}updateTransformation(r){r(this._transformation),this._shaderTransformationDirty=!0,this.computeBoundingSphere(this._transformation,this.boundingSphere)}shaderTransformationChanged(){this._shaderTransformationDirty=!0}computeBoundingSphere(t,s,i=n(t)){r(this.boundingInfo)||(o(s,this.boundingInfo.center,t),s[3]=this.boundingInfo.radius*i)}get hasShaderTransformation(){return t(this.shaderTransformer)}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return r(this.shaderTransformer)?this.transformation:(this._shaderTransformationDirty&&(this._shaderTransformation||(this._shaderTransformation=e()),i(this._shaderTransformation,this.shaderTransformer(this.transformation)),this._shaderTransformationDirty=!1),this._shaderTransformation)}get indices(){return this.geometry.indices}get vertexAttributes(){return this.geometry.vertexAttributes}get highlights(){return this.geometry.highlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(r){this.geometry.visible=r}}class m extends h{}export{h as RenderGeometry,m as ValidatedRenderGeometry};