generate tessellated vertices for a given block in the world.
More...
#include <BlockTessellators.h>
|
| BlockTessellatorBase (CBlockWorld *pWorld) |
|
virtual void | SetWorld (CBlockWorld *pWorld) |
|
int32_t | GetAvgVertexLight (int32_t v1, int32_t v2, int32_t v3, int32_t v4) |
|
int32_t | GetMaxVertexLight (int32_t v1, int32_t v2, int32_t v3, int32_t v4) |
| not used. More...
|
|
uint8 | GetMeshBrightness (BlockTemplate *pBlockTemplate, uint8 *blockBrightness) |
|
uint32_t | CalculateCubeAO () |
| calculate ambient occlusion flags for cube model. More...
|
|
virtual int32 | TessellateBlock (BlockChunk *pChunk, uint16 packedBlockId, BlockRenderMethod dwShaderID, BlockVertexCompressed **pOutputData) |
| generate triangles for a given block in a block world, taking all nearby blocks into consideration. More...
|
|
|
Block * | neighborBlocks [27] |
|
uint8_t | blockBrightness [27 *3] |
|
BlockModel | tessellatedModel |
|
generate tessellated vertices for a given block in the world.
§ CalculateCubeAO()
uint32_t ParaEngine::BlockTessellatorBase::CalculateCubeAO |
( |
| ) |
|
calculate ambient occlusion flags for cube model.
- Returns
- ao_flags
§ FetchNearbyBlockInfo()
void ParaEngine::BlockTessellatorBase::FetchNearbyBlockInfo |
( |
BlockChunk * |
pChunk, |
|
|
const Uint16x3 & |
packedBlockId, |
|
|
int |
nNearbyBlockCount = 27 , |
|
|
int |
nNearbyLightCount = -1 |
|
) |
| |
|
protected |
fetch and update nearby (3*3*3=27 blocks) block id and block brightness.
- Parameters
-
nNearbyBlockCount | how many nearby blocks to update. 1 means only the center block, 7 means including 6 neighbors. by default it is 27, which fetches all blocks in 3*3*3=27 block region. |
nNearbyLightCount | default it is -1, which means same as nNearbyBlockCount. if 0 it will disable fetching any light data |
§ GetMaxVertexLight()
int32_t ParaEngine::BlockTessellatorBase::GetMaxVertexLight |
( |
int32_t |
v1, |
|
|
int32_t |
v2, |
|
|
int32_t |
v3, |
|
|
int32_t |
v4 |
|
) |
| |
not used.
old algorithm for GetAvgVertexLight
§ GetMeshBrightness()
uint8 ParaEngine::BlockTessellatorBase::GetMeshBrightness |
( |
BlockTemplate * |
pBlockTemplate, |
|
|
uint8 * |
blockBrightness |
|
) |
| |
- Parameters
-
brightness | at least array of 7 values. first is center, the following 6 is neighbours. |
§ TessellateBlock()
int32 ParaEngine::BlockTessellatorBase::TessellateBlock |
( |
BlockChunk * |
pChunk, |
|
|
uint16 |
packedBlockId, |
|
|
BlockRenderMethod |
dwShaderID, |
|
|
BlockVertexCompressed ** |
pOutputData |
|
) |
| |
|
virtual |
generate triangles for a given block in a block world, taking all nearby blocks into consideration.
generate block vertex data for rendering in relative chunk space. [threading]: this function is not thread safe, since it internally use global static object as the output.
- Parameters
-
pOutputData | generated vertex data. use it immediately and do not keep a reference to it. it will be invalid after the next call to this function. |
- Returns
- rect face count is returned. this value*4 is the number of generated vertices in pOutputData.
Reimplemented in ParaEngine::BlockGeneralTessellator.
§ UpdateCurrentBlock()
bool ParaEngine::BlockTessellatorBase::UpdateCurrentBlock |
( |
BlockChunk * |
pChunk, |
|
|
uint16 |
packedBlockId |
|
) |
| |
|
protected |
update the current block info, including all block position, m_pCurBlockModel, m_nBlockData, etc.
will be updated.
The documentation for this class was generated from the following files:
- Client/trunk/ParaEngineClient/BlockEngine/BlockTessellators.h
- Client/trunk/ParaEngineClient/BlockEngine/BlockTessellators.cpp