import { HighPrecisionPointMaterial } from "@here/harp-materials" ; import * as THREE from "three" ; import { HighPrecisionObject } from "./HighPrecisionLines" ; import { HighPrecisionUtils } from "./HighPrecisionUtils" ; /**
 * Class used to render high-precision points.
 */ export class HighPrecisionPoints extends THREE . Points implements HighPrecisionObject { matrixWorldInverse : THREE . Matrix4 ; /**
     * Number of dimensions this `HighPrecisionObject` is specified in (2D/3D).
     */ dimensionality ? : number ; param geometry param material param positions param color param opacity constructor ( geometry ? , material ? , positions ? , color ? , opacity ? ) { if ( material === undefined ) { material = new HighPrecisionPointMaterial ( { color : color ? color : HighPrecisionPointMaterial . DEFAULT_COLOR , opacity : opacity !== undefined ? opacity : 1 } ) ; } super ( geometry === undefined ? new THREE . BufferGeometry ( ) : geometry , material ) ; this . matrixWorldInverse = new THREE . Matrix4 ( ) ; if ( positions ) { this . setPositions ( positions ) ; } } get bufferGeometry ( ) : THREE . BufferGeometry { return this . geometry as THREE . BufferGeometry ; } /**
     * Clears the [[BufferGeometry]] used to render this point.
     */ clearGeometry ( ) { return ( this . geometry = new THREE . BufferGeometry ( ) ) ; } get shaderMaterial ( ) : THREE . ShaderMaterial { return this . material as THREE . ShaderMaterial ; } setPositions ( positions ) { HighPrecisionUtils . setPositions ( this , positions ) ; } setupForRendering ( ) { if ( ( this . material as any ) . isHighPrecisionPointsMaterial && this . dimensionality !== undefined ) { ( this . material as any ) . setDimensionality ( this . dimensionality ) ; } this . onBeforeRender = ( _renderer , _scene , camera , _geometry , _material , _group ) => { HighPrecisionUtils . updateHpUniforms ( this , camera , this . shaderMaterial ) ; } ; } updateMatrixWorld ( force ) { const doUpdateMatrixWorldInverse = this . matrixWorldNeedsUpdate || force ; super . updateMatrixWorld ( force ) ; if ( doUpdateMatrixWorldInverse ) { this . matrixWorldInverse . copy ( this . matrixWorld ) . invert ( ) ; } } }