TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class MeshTreeFilter in Tinman.Terrain.Kernel

The MeshTreeFilter class maintains a hierarchical set of mesh sector flags, to be used during mesh traversal.

sealed class MeshTreeFilter  

Remarks

Processing of a mesh begins with the full mesh structure (i.e. the current state of tessellation, see MeshUpdate). The following figure illustrates the sector hierarchy of an example mesh structure:

                    .---.
                    | R |
                    `---´
           ___________|___________
          |       |       |       |
        .---.   .---.           .---.
        |   |   |   |     X     |   |
        `---´   `---´           `---´
   _______________|_______        |_______________________
  |       |       |       |       |       |       |       |
.---.   .---.   .---.           .---.   .---.   .---.   .---.
|   |   |   |   |   |     X     |   |   |   |   |   |   |   |
`---´   `---´   `---´           `---´   `---´   `---´   `---´
   _______________|_______         _______|_______________
  |       |       |       |       |       |       |       |
.---.   .---.   .---.   .---.   .---.   .---.   .---.
|   |   |   |   |   |   |   |   |   |   |   |   |   |     X
`---´   `---´   `---´   `---´   `---´   `---´   `---´
The sector R is the root of a cubemap face. Sectors marked with X do not exist (see Null). Calling the SectorMark method will place an explicit mark on the given mesh sector (see sectors tagged with M in the figure below). The ancestors of a mesh sector with an explicit mark receive an implicit mark (see sectors tagged with !):
                    .---.
                    | ! |
                    `---´
           ___________|___________
          |       |       |       |
        .---.   .---.           .---.
        |   |   | ! |     X     | ! |
        `---´   `---´           `---´
   _______________|_______        |_______________________
  |       |       |       |       |       |       |       |
.---.   .---.   .---.           .---.   .---.   .---.   .---.
|   |   |   |   | ! |     X     |   |   | M |   |   |   |   |
`---´   `---´   `---´           `---´   `---´   `---´   `---´
   _______________|_______         _______|_______________
  |       |       |       |       |       |       |       |
.---.   .---.   .---.   .---.   .---.   .---.   .---.
|   |   | M |   |   |   | M |   |   |   |   |   |   |     X
`---´   `---´   `---´   `---´   `---´   `---´   `---´
The marks of a mesh sector can be queried with HasMark, HasMarkExplicit and HasMarkImplicit. Mesh sectors can also be culled away using the SectorCull method or by culling all existing children. Culled mesh sectors are reported as Void. The following figure shows the result of culling all mesh sectors marked with M in the figure above:
                    .---.
                    |   |
                    `---´
           ___________|___________
          |       |       |       |
        .---.   .---.           .---.
        | S |   |   |    Null   |   |
        `---´   `---´           `---´
   _______________|_______        |_______________________
  |       |       |       |       |       |       |       |
.---.   .---.   .---.           .---.           .---.   .---.
| S |   | S |   |   |    Null   | S |    Void   | S |   | S |
`---´   `---´   `---´           `---´           `---´   `---´
   _______________|_______
  |       |       |       |
.---.           .---.
| S |    Void   | S |    Void
`---´           `---´
The mesh sectors marked with S are solid, i.e. they do not have any descendants that have been culled away. The solid flag can be queried using IsSolid.

Public / Constructors

MeshTreeFilter

Creates a new instance of MeshTreeFilter.

public constructor MeshTreeFilter ()

Public / Methods

Copy

Copies mesh sector flags from this filter to the input filter of the given tree.

public method Copy (MeshTree tree, bool which = false)
params tree [not-null] The mesh tree whose input filter to update.
  which Depicts which flags to copy:
true to copy culled mesh sectors (see SectorCull),
false to copy marked mesh sectors (see SectorMark).
Defaults to false.

Remarks:

If the given tree does not have an input filter, the method silently returns.

Reset

Resets the flags in this filter.

public method Reset (MeshTreeFilter other = null)
params other The filter to use for resetting the flags of this filter or null to clear all flags. Defaults to null.