方块类型定义:名字、各面图集纹理、方向性、组合声明。 方向性方块在注册时按 orientation 绕 Y 轴展开成多个"具体类型"变体, 每个变体持有旋转后的各面纹理;渲染端只消费纹理 id,不接触 orientation。
更多...
|
| class | Chunk |
| | One 32³ voxel chunk with six direction-sorted packed-rect instance buffers. Coordinates: chunk (cx,cy,cz) → world origin (cx*32, cy*32, cz*32). 更多...
|
| |
| struct | CubeType |
| | CubeType public API. 更多...
|
| |
| class | CubeTypeRegistry |
| | EVENGINE_API_DOMAINS public API. 更多...
|
| |
| struct | DecodedRect |
| | One decoded face rectangle in world space (mirrors voxel_rect.vert). 更多...
|
| |
| struct | DrawBatch |
| | One draw batch: all packed rects of one face direction for one chunk. 更多...
|
| |
| struct | Frustum |
| | Six frustum planes in ax+by+cz+d >= 0 form (normals point inward). 更多...
|
| |
| class | GreedyMesher |
| | Greedy rectangle mesher for one 32³ dense voxel volume. Voxel storage: index = x + y*32 + z*32*32. Value 0 = air; 1..255 = type id. 更多...
|
| |
| struct | PackedRect |
| | Packed face-rectangle instance (exactly 32 bits): bits 0..4 : x (0..31) bits 5..9 : y (0..31) bits 10..14 : z (0..31) bits 15..19 : width - 1 (0..31 → size 1..32) bits 20..24 : height - 1 (0..31 → size 1..32) bits 25..31 : texture index (0..127) 更多...
|
| |
| struct | StreamStats |
| | Result of a streaming pass. 更多...
|
| |
| class | Voxel |
| | High-performance voxel rendering module. 更多...
|
| |
| class | VoxelWorld |
| | Sparse chunk map + visibility selection (frustum + distance + face orientation). Meshing is neighbor-aware (cross-chunk seam culling), parallel-capable and script-friendly via getVisible getters and raycast helpers. 更多...
|
| |
|
| uint8_t | resolveFaceTex (const CubeTypeRegistry &types, uint8_t id, FaceDir dir) |
| | 求某个体素在某面方向上的实际图集纹理 id。 未注册的 id 退化为“所有面 = 原 id”(向后兼容:体素值即纹理 id)。
|
| |
| constexpr int | faceDirCount () |
| | Face dir count.
|
| |
| const char * | faceDirName (FaceDir d) |
| | Face dir name.
|
| |
| bool | faceDirFromName (const std::string &name, FaceDir &out) |
| | Face dir from name.
|
| |
| FaceDir | rotateFaceY (FaceDir dir, int quarterTurns) |
| | 绕 Y 轴旋转一个面方向 quarterTurns 个 90°(右手定则:+X → -Z → -X → +Z)。 仅影响 4 个水平面(±X/±Z),±Y 顶/底保持不变。 供方向性方块在注册各面纹理时旋转使用。
|
| |
| void | faceNormal (FaceDir d, float &nx, float &ny, float &nz) |
| | Outward unit normal for the face.
|
| |
| | Module_IMPL (Voxel, new Voxel()) |
| |
| DecodedRect | decodePackedRect (PackedRect rect, FaceDir dir, float originX, float originY, float originZ, int tilesPerRow=16, uint32_t aoWord=0xFFu) |
| | CPU mirror of the instanced voxel vertex shader placement / UV logic. Used by unit tests to validate packing ↔ geometry without a GPU.
|
| |
| bool | decodedWindingMatchesNormal (const DecodedRect &q) |
| | True when triangle (0,2,1) winding matches outward normal (matches GPU index order).
|
| |
| bool | decodedSecondTriangleMatchesNormal (const DecodedRect &q) |
| | True when the second GPU triangle (0,3,2) also matches the outward normal.
|
| |
方块类型定义:名字、各面图集纹理、方向性、组合声明。 方向性方块在注册时按 orientation 绕 Y 轴展开成多个"具体类型"变体, 每个变体持有旋转后的各面纹理;渲染端只消费纹理 id,不接触 orientation。
| DecodedRect eve::voxel::decodePackedRect |
( |
PackedRect |
rect, |
|
|
FaceDir |
dir, |
|
|
float |
originX, |
|
|
float |
originY, |
|
|
float |
originZ, |
|
|
int |
tilesPerRow = 16, |
|
|
uint32_t |
aoWord = 0xFFu |
|
) |
| |
|
inline |
CPU mirror of the instanced voxel vertex shader placement / UV logic. Used by unit tests to validate packing ↔ geometry without a GPU.
在文件 VoxelRectDecode.h 第 23 行定义.
引用了 eve::voxel::DecodedRect::ao, eve::voxel::DecodedRect::corners, dir, h, eve::voxel::PackedRect::height(), eve::voxel::DecodedRect::height, NegX, NegY, NegZ, eve::voxel::DecodedRect::normal, nx, ny, nz, PosX, PosY, PosZ, eve::voxel::PackedRect::tex(), eve::voxel::DecodedRect::tex, tiles, eve::voxel::DecodedRect::uv, w, eve::voxel::PackedRect::width(), eve::voxel::DecodedRect::width, x, eve::voxel::PackedRect::x(), y, eve::voxel::PackedRect::y(), z , 以及 eve::voxel::PackedRect::z().