import { watcher } from '@feng3d/watcher'; import { CircleGeometry } from '../../thirdparty/three/imports'; import { BufferGeometry3D } from '../core/BufferGeometry3D'; export class CircleGeometry3D extends BufferGeometry3D { radius = 1; segments = 32; thetaStart = 0; thetaLength = Math.PI * 2; get _geometry() { if (!this.__geometry) { this.__geometry = new CircleGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength); } return this.__geometry; } declare protected __geometry: CircleGeometry; constructor() { super(); watcher.watchs(this as CircleGeometry3D, ['radius', 'segments', 'thetaStart', 'thetaLength'], this._invalidate, this); } destroy() { watcher.unwatchs(this as CircleGeometry3D, ['radius', 'segments', 'thetaStart', 'thetaLength'], this._invalidate, this); } }