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
new QuadtreeLod(fields, options?): QuadtreeLod;Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:74
Parameters
| Parameter | Type |
|---|---|
fields | GpuWaveFields |
options? | QuadtreeLodOptions |
Returns
QuadtreeLod
Overrides
Mesh.constructorProperties
| Property | Modifier | Type | Default value | Description | Overrides | Defined in |
|---|---|---|---|---|---|---|
cellsAcross | readonly | number | undefined | - | - | packages/marine/src/webgpu/QuadtreeLod.ts:56 |
finestSpacing | readonly | number | undefined | - | - | packages/marine/src/webgpu/QuadtreeLod.ts:55 |
geometry | public | InstancedBufferGeometry | THREE.BufferGeometry | new THREE.BufferGeometry(). | An instance of THREE.BufferGeometry | BufferGeometry (or derived classes), defining the object's structure. | Mesh.geometry | packages/marine/src/webgpu/QuadtreeLod.ts:62 |
levelCount | readonly | number | undefined | - | - | packages/marine/src/webgpu/QuadtreeLod.ts:57 |
material | public | SpectralWaterMaterial | THREE.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.material | packages/marine/src/webgpu/QuadtreeLod.ts:63 |
nodeCount | public | number | 0 | Nodes drawn the last update. | - | packages/marine/src/webgpu/QuadtreeLod.ts:65 |
rangeFactor | readonly | number | undefined | - | - | packages/marine/src/webgpu/QuadtreeLod.ts:58 |
waveBound | public | number | undefined | undefined | As set, or undefined to follow the sea. | - | packages/marine/src/webgpu/QuadtreeLod.ts:60 |
Accessors
drawCallCount
Get Signature
get drawCallCount(): number;Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:130
Returns
number
reach
Get Signature
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
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
get triangleCount(): number;Defined in: packages/marine/src/webgpu/QuadtreeLod.ts:126
Returns
number
Methods
update()
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
| Parameter | Type |
|---|---|
centre | Vector3 |
camera? | Camera |
Returns
void
