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)
 
AString ExportAsSVG (int a_Color, int a_OffsetX, int a_OffsetZ) const
 
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 69 of file Caves.cpp.

Constructor & Destructor Documentation

◆ cCaveTunnel()

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 160 of file Caves.cpp.

Member Function Documentation

◆ CalcBoundingBox()

void cCaveTunnel::CalcBoundingBox ( void  )
private

Calculates the bounding box of the points present.

Definition at line 437 of file Caves.cpp.

◆ ExportAsSVG()

AString cCaveTunnel::ExportAsSVG ( int  a_Color,
int  a_OffsetX,
int  a_OffsetZ 
) const

Definition at line 557 of file Caves.cpp.

◆ FinishLinear()

void cCaveTunnel::FinishLinear ( void  )
private

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

Definition at line 308 of file Caves.cpp.

◆ ProcessChunk()

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 458 of file Caves.cpp.

◆ Randomize()

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 191 of file Caves.cpp.

◆ RefineDefPoints()

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 234 of file Caves.cpp.

◆ Smooth()

void cCaveTunnel::Smooth ( void  )
private

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

Definition at line 287 of file Caves.cpp.

Member Data Documentation

◆ m_MaxBlockX

int cCaveTunnel::m_MaxBlockX
private

Definition at line 72 of file Caves.cpp.

◆ m_MaxBlockY

int cCaveTunnel::m_MaxBlockY
private

Definition at line 73 of file Caves.cpp.

◆ m_MaxBlockZ

int cCaveTunnel::m_MaxBlockZ
private

Definition at line 74 of file Caves.cpp.

◆ m_MinBlockX

int cCaveTunnel::m_MinBlockX
private

Definition at line 72 of file Caves.cpp.

◆ m_MinBlockY

int cCaveTunnel::m_MinBlockY
private

Definition at line 73 of file Caves.cpp.

◆ m_MinBlockZ

int cCaveTunnel::m_MinBlockZ
private

Definition at line 74 of file Caves.cpp.

◆ m_Points

cCaveDefPoints cCaveTunnel::m_Points

Definition at line 92 of file Caves.cpp.


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