Class: SectionVisibilityGraph
Sodium-style section traversal graph. Each meshed section reports which of its face pairs see each other through non-opaque voxels; a per-frame BFS from the camera's section walks the graph, only continuing through a section when the face it entered connects to the face it wants to leave by, and never doubling back toward the camera. Sections the walk cannot reach are occluded — enclosed interiors stop paying for the terrain around them.
Constructors
constructor
• new SectionVisibilityGraph(options): SectionVisibilityGraph
Parameters
| Name | Type |
|---|---|
options | SectionVisibilityGraphOptions |
Returns
Accessors
isComplete
• get isComplete(): boolean
Whether the last walk started from a loaded section. When the camera stands outside the graph the walk cannot claim anything is hidden, and callers must fall back to frustum-only culling.
Returns
boolean
sectionCount
• get sectionCount(): number
Returns
number
stats
• get stats(): Object
Returns
Object
| Name | Type |
|---|---|
constrained | number |
isComplete | boolean |
reached | number |
sections | number |
visible | number |
Methods
addChunk
▸ addChunk(cx, cz): void
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
Returns
void
clear
▸ clear(): void
Returns
void
isSectionReached
▸ isSectionReached(cx, cz, level): boolean
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
Returns
boolean
isSectionVisible
▸ isSectionVisible(cx, cz, level): boolean
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
Returns
boolean
removeChunk
▸ removeChunk(cx, cz): void
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
Returns
void
setConnectivity
▸ setConnectivity(cx, cz, level, connectivity): void
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
connectivity | number |
Returns
void
walk
▸ walk(cameraPosition, projectionScreenMatrix, fogFar): void
Runs the traversal for the current camera. The walk itself follows only
connectivity — frustum and fog decide which reached sections count as
visible, never where the walk may go, so the reached set stays a pure
"an air path exists" answer that shadow-safe chunks can trust. fogFar
(in blocks, horizontal) is the fully-fogged distance; Infinity disables
fog culling.
Parameters
| Name | Type |
|---|---|
cameraPosition | Vector3 |
projectionScreenMatrix | Matrix4 |
fogFar | number |
Returns
void