CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Transvoxel Class Reference

#include <CeresEngine/Renderer/Terrain/Transvoxel.hpp>

Classes

struct  RegularCellData
 
struct  TransitionCellData
 The TransitionCellData structure holds information about the triangulation used for a single equivalence class in the Transvoxel Algorithm transition cell, described in Section 4.3. More...
 

Static Public Member Functions

static MeshPtr voxelize (Int32 x, Int32 y, Int32 z)
 

Static Private Attributes

static const UInt8 regularCellClass [256]
 The regularCellClass table maps an 8-bit regular Marching Cubes case index to an equivalence class index.
 
static const RegularCellData regularCellData [16]
 The regularCellData table holds the triangulation data for all 16 distinct classes to which a case can be mapped by the regularCellClass table.
 
static const Array< UInt16, 12 > regularVertexData [256]
 The regularVertexData table gives the vertex locations for every one of the 256 possible cases in the modified Marching Cubes algorithm.
 
static const UInt8 transitionCellClass [512]
 The transitionCellClass table maps a 9-bit transition cell case index to an equivalence class index.
 
static const TransitionCellData transitionCellData [56]
 The transitionCellData table holds the triangulation data for all 56 distinct classes to which a case can be mapped by the transitionCellClass table.
 
static const UInt8 transitionCornerData [13]
 The transitionCornerData table contains the transition cell corner reuse data shown in Figure 4.18.
 
static const UInt16 transitionVertexData [512][12]
 The transitionVertexData table gives the vertex locations for every one of the 512 possible cases in the Tranvoxel Algorithm.
 

Member Function Documentation

◆ voxelize()

static MeshPtr CeresEngine::Transvoxel::voxelize ( Int32  x,
Int32  y,
Int32  z 
)
static

Member Data Documentation

◆ regularCellClass

const UInt8 CeresEngine::Transvoxel::regularCellClass[256]
staticprivate

The regularCellClass table maps an 8-bit regular Marching Cubes case index to an equivalence class index.

Even though there are 18 equivalence classes in our modified Marching Cubes algorithm, a couple of them use the same exact triangulations, just with different vertex locations. We combined those classes for this table so that the class index ranges from 0 to 15.

◆ regularCellData

const RegularCellData CeresEngine::Transvoxel::regularCellData[16]
staticprivate

The regularCellData table holds the triangulation data for all 16 distinct classes to which a case can be mapped by the regularCellClass table.

◆ regularVertexData

const Array<UInt16, 12> CeresEngine::Transvoxel::regularVertexData[256]
staticprivate

The regularVertexData table gives the vertex locations for every one of the 256 possible cases in the modified Marching Cubes algorithm.

Each 16-bit value also provides information about whether a vertex can be reused from a neighboring cell. See Section 3.3 for details. The low byte contains the indexes for the two endpoints of the edge on which the vertex lies, as numbered in Figure 3.7. The high byte contains the vertex reuse data shown in Figure 3.8.

◆ transitionCellClass

const UInt8 CeresEngine::Transvoxel::transitionCellClass[512]
staticprivate

The transitionCellClass table maps a 9-bit transition cell case index to an equivalence class index.

Even though there are 73 equivalence classes in the Transvoxel Algorithm, several of them use the same exact triangulations, just with different vertex locations. We combined those classes for this table so that the class index ranges from 0 to 55. The high bit is set in the cases for which the inverse state of the voxel data maps to the equivalence class, meaning that the winding order of each triangle should be reversed.

◆ transitionCellData

const TransitionCellData CeresEngine::Transvoxel::transitionCellData[56]
staticprivate

The transitionCellData table holds the triangulation data for all 56 distinct classes to which a case can be mapped by the transitionCellClass table.

The class index should be ANDed with 0x7F before using it to look up triangulation data in this table.

◆ transitionCornerData

const UInt8 CeresEngine::Transvoxel::transitionCornerData[13]
staticprivate

The transitionCornerData table contains the transition cell corner reuse data shown in Figure 4.18.

◆ transitionVertexData

const UInt16 CeresEngine::Transvoxel::transitionVertexData[512][12]
staticprivate

The transitionVertexData table gives the vertex locations for every one of the 512 possible cases in the Tranvoxel Algorithm.

Each 16-bit value also provides information about whether a vertex can be reused from a neighboring cell. See Section 4.5 for details. The low byte contains the indexes for the two endpoints of the edge on which the vertex lies, as numbered in Figure 4.16. The high byte contains the vertex reuse data shown in Figure 4.17.


The documentation for this class was generated from the following file: