Skip to content

eulerjs API / @eulerjs/marine/webgpu / QuadtreeLod

QuadtreeLod ​

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:54

The sea as a quadtree of square nodes (Strugar's CDLOD, 2009): from a few nodes the size of the whole sea around the centre, each splits into four while the centre is near enough, so that nodes grow with distance from it. Every node is the same grid, drawn in one instanced call; its vertices morph onto the grid twice as coarse by the distance its parent stops splitting at, so neighbours of different sizes meet without cracks. Given the camera, nodes out of its view are left out.

Extends ​

  • Mesh

Constructors ​

Constructor ​

ts
new QuadtreeLod(fields, options?): QuadtreeLod;

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:74

Parameters ​

ParameterType
fieldsGpuWaveFields
options?QuadtreeLodOptions

Returns ​

QuadtreeLod

Overrides ​

ts
Mesh.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionOverridesDefined in
cellsAcrossreadonlynumberundefined--packages/marine/src/webgpu/QuadtreeLod.ts:56
finestSpacingreadonlynumberundefined--packages/marine/src/webgpu/QuadtreeLod.ts:55
geometrypublicInstancedBufferGeometryTHREE.BufferGeometry | new THREE.BufferGeometry().An instance of THREE.BufferGeometry | BufferGeometry (or derived classes), defining the object's structure.Mesh.geometrypackages/marine/src/webgpu/QuadtreeLod.ts:62
levelCountreadonlynumberundefined--packages/marine/src/webgpu/QuadtreeLod.ts:57
materialpublicSpectralWaterMaterialTHREE.MeshBasicMaterial | new THREE.MeshBasicMaterial().An instance of material derived from the THREE.Material | Material base class or an array of materials, defining the object's appearance.Mesh.materialpackages/marine/src/webgpu/QuadtreeLod.ts:63
nodeCountpublicnumber0Nodes drawn the last update.-packages/marine/src/webgpu/QuadtreeLod.ts:65
rangeFactorreadonlynumberundefined--packages/marine/src/webgpu/QuadtreeLod.ts:58
waveBoundpublicnumber | undefinedundefinedAs set, or undefined to follow the sea.-packages/marine/src/webgpu/QuadtreeLod.ts:60

Accessors ​

drawCallCount ​

Get Signature ​

ts
get drawCallCount(): number;

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:130

Returns ​

number


reach ​

Get Signature ​

ts
get reach(): number;

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:122

Metres from the centre the sea reaches at least: the roots around the centre's.

Returns ​

number


rootSize ​

Get Signature ​

ts
get rootSize(): number;

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:117

The size of the largest nodes, those of the last level.

Returns ​

number


triangleCount ​

Get Signature ​

ts
get triangleCount(): number;

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:126

Returns ​

number

Methods ​

update() ​

ts
update(centre, camera?): void;

Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:135

Chooses the nodes around centre, the viewer usually; with camera, only those in its view.

Parameters ​

ParameterType
centreVector3
camera?Camera

Returns ​

void

Released under the MIT License.