Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
cCaveTunnel Class Reference

A single non-branching tunnel of a WormNestCave. More...

Public Member Functions

 cCaveTunnel (int a_BlockStartX, int a_BlockStartY, int a_BlockStartZ, int a_StartRadius, int a_BlockEndX, int a_BlockEndY, int a_BlockEndZ, int a_EndRadius, cNoise &a_Noise)
 
void ProcessChunk (int a_ChunkX, int a_ChunkZ, cChunkDef::BlockTypes &a_BlockTypes, cChunkDesc::BlockNibbleBytes &a_BlockMetas, cChunkDef::HeightMap &a_HeightMap)
 Carves the tunnel into the chunk specified. More...
 

Public Attributes

cCaveDefPoints m_Points
 

Private Member Functions

void CalcBoundingBox (void)
 Calculates the bounding box of the points present. More...
 
void FinishLinear (void)
 Linearly interpolates the points so that the maximum distance between two neighbors is max 1 block. More...
 
void Randomize (cNoise &a_Noise)
 Generates the shaping defpoints for the cave, based on the cave block coords and noise. More...
 
bool RefineDefPoints (const cCaveDefPoints &a_Src, cCaveDefPoints &a_Dst)
 Refines (adds and smooths) defpoints from a_Src into a_Dst; returns false if no refinement possible (segments too short) More...
 
void Smooth (void)
 Does rounds of smoothing, two passes of RefineDefPoints(), as long as they return true. More...
 

Private Attributes

int m_MaxBlockX
 
int m_MaxBlockY
 
int m_MaxBlockZ
 
int m_MinBlockX
 
int m_MinBlockY
 
int m_MinBlockZ
 

Detailed Description

A single non-branching tunnel of a WormNestCave.

Definition at line 68 of file Caves.cpp.

Constructor & Destructor Documentation

cCaveTunnel::cCaveTunnel ( int  a_BlockStartX,
int  a_BlockStartY,
int  a_BlockStartZ,
int  a_StartRadius,
int  a_BlockEndX,
int  a_BlockEndY,
int  a_BlockEndZ,
int  a_EndRadius,
cNoise a_Noise 
)

Definition at line 158 of file Caves.cpp.

Member Function Documentation

void cCaveTunnel::CalcBoundingBox ( void  )
private

Calculates the bounding box of the points present.

Definition at line 435 of file Caves.cpp.

void cCaveTunnel::FinishLinear ( void  )
private

Linearly interpolates the points so that the maximum distance between two neighbors is max 1 block.

Definition at line 306 of file Caves.cpp.

void cCaveTunnel::ProcessChunk ( int  a_ChunkX,
int  a_ChunkZ,
cChunkDef::BlockTypes a_BlockTypes,
cChunkDesc::BlockNibbleBytes a_BlockMetas,
cChunkDef::HeightMap a_HeightMap 
)

Carves the tunnel into the chunk specified.

Definition at line 456 of file Caves.cpp.

void cCaveTunnel::Randomize ( cNoise a_Noise)
private

Generates the shaping defpoints for the cave, based on the cave block coords and noise.

Definition at line 189 of file Caves.cpp.

bool cCaveTunnel::RefineDefPoints ( const cCaveDefPoints a_Src,
cCaveDefPoints a_Dst 
)
private

Refines (adds and smooths) defpoints from a_Src into a_Dst; returns false if no refinement possible (segments too short)

Definition at line 232 of file Caves.cpp.

void cCaveTunnel::Smooth ( void  )
private

Does rounds of smoothing, two passes of RefineDefPoints(), as long as they return true.

Definition at line 285 of file Caves.cpp.

Member Data Documentation

int cCaveTunnel::m_MaxBlockX
private

Definition at line 71 of file Caves.cpp.

int cCaveTunnel::m_MaxBlockY
private

Definition at line 72 of file Caves.cpp.

int cCaveTunnel::m_MaxBlockZ
private

Definition at line 73 of file Caves.cpp.

int cCaveTunnel::m_MinBlockX
private

Definition at line 71 of file Caves.cpp.

int cCaveTunnel::m_MinBlockY
private

Definition at line 72 of file Caves.cpp.

int cCaveTunnel::m_MinBlockZ
private

Definition at line 73 of file Caves.cpp.

cCaveDefPoints cCaveTunnel::m_Points

Definition at line 91 of file Caves.cpp.


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