#include <content_mapblock.h>
Classes | |
| struct | LiquidData |
| struct | RaillikeData |
| struct | PlantlikeData |
Public Member Functions | |
| MapblockMeshGenerator (MeshMakeData *input, MeshCollector *output) | |
| void | generate () |
Private Member Functions | |
| void | getSmoothLightFrame () |
| LightInfo | blendLight (const v3f &vertex_pos) |
| video::SColor | blendLightColor (const v3f &vertex_pos) |
| video::SColor | blendLightColor (const v3f &vertex_pos, const v3f &vertex_normal) |
| void | useTile (TileSpec *tile_ret, int index=0, u8 set_flags=0, u8 reset_flags=0, bool special=false) |
| void | getTile (int index, TileSpec *tile_ret) |
| void | getTile (v3s16 direction, TileSpec *tile_ret) |
| void | getSpecialTile (int index, TileSpec *tile_ret, bool apply_crack=false) |
| void | drawQuad (const TileSpec &tile, v3f *vertices, const v3s16 &normal=v3s16(0, 0, 0), float vertical_tiling=1.0) |
| template<typename Fn> | |
| void | drawCuboid (const aabb3f &box, const TileSpec *tiles, int tilecount, const f32 *txc, u8 mask, Fn &&face_lighter) |
| void | drawAutoLightedCuboid (aabb3f box, const TileSpec &tile, f32 const *txc=nullptr, u8 mask=0) |
| void | drawAutoLightedCuboid (aabb3f box, const TileSpec *tiles, int tile_count, f32 const *txc=nullptr, u8 mask=0) |
| u8 | getNodeBoxMask (aabb3f box, u8 solid_neighbors, u8 sametype_neighbors) const |
| void | prepareLiquidNodeDrawing () |
| void | getLiquidNeighborhood () |
| void | calculateCornerLevels () |
| f32 | getCornerLevel (int i, int k) const |
| void | drawLiquidSides () |
| void | drawLiquidTop () |
| void | drawLiquidBottom () |
| bool | isSameRail (v3s16 dir) |
| void | drawPlantlikeQuad (const TileSpec &tile, float rotation, float quad_offset=0, bool offset_top_only=false) |
| void | drawPlantlike (const TileSpec &tile, bool is_rooted=false) |
| void | drawFirelikeQuad (const TileSpec &tile, float rotation, float opening_angle, float offset_h, float offset_v=0.0) |
| void | drawSolidNode () |
| void | drawLiquidNode () |
| void | drawGlasslikeNode () |
| void | drawGlasslikeFramedNode () |
| void | drawAllfacesNode () |
| void | drawTorchlikeNode () |
| void | drawSignlikeNode () |
| void | drawPlantlikeNode () |
| void | drawPlantlikeRootedNode () |
| void | drawFirelikeNode () |
| void | drawFencelikeNode () |
| void | drawRaillikeNode () |
| void | drawNodeboxNode () |
| void | drawMeshNode () |
| void | errorUnknownDrawtype () |
| void | drawNode () |
Static Private Member Functions | |
| static void | generateCuboidTextureCoords (aabb3f const &box, f32 *coords) |
Private Attributes | |
| MeshMakeData *const | data |
| MeshCollector *const | collector |
| const NodeDefManager *const | nodedef |
| const v3s16 | blockpos_nodes |
| struct { | |
| v3s16 p | |
| v3f origin | |
| MapNode n | |
| const ContentFeatures * f | |
| LightFrame lframe | |
| video::SColor lcolor | |
| } | cur_node |
| LiquidData | cur_liquid |
| RaillikeData | cur_rail |
| PlantlikeData | cur_plant |
Static Private Attributes | |
| static const std::string | raillike_groupname = "connect_to_raillike" |
| MapblockMeshGenerator::MapblockMeshGenerator | ( | MeshMakeData * | input, |
| MeshCollector * | output ) |
References blockpos_nodes, collector, data, MAP_BLOCKSIZE, and nodedef.
References BS, cur_node, SMOOTH_LIGHTING_OVERSIZE, x, y, and z.
Referenced by blendLightColor(), blendLightColor(), and drawAutoLightedCuboid().
|
private |
References blendLight(), cur_node, encode_light(), and LightInfo::getPair().
Referenced by drawLiquidBottom(), drawLiquidSides(), drawLiquidTop(), drawMeshNode(), and drawQuad().
|
private |
References applyFacesShading(), blendLight(), cur_node, encode_light(), LightInfo::getPair(), and MYMAX.
|
private |
References cur_liquid, and getCornerLevel().
Referenced by drawLiquidNode().
|
private |
References BS, data, drawAutoLightedCuboid(), getSmoothLightFrame(), and getTile().
Referenced by drawNode().
|
private |
References drawAutoLightedCuboid().
Referenced by drawAllfacesNode(), drawAutoLightedCuboid(), drawFencelikeNode(), drawGlasslikeFramedNode(), and drawNodeboxNode().
|
private |
References applyFacesShading(), blendLight(), cur_node, data, Diag02, Diag13, drawCuboid(), encode_light(), LightInfo::getPair(), light_indices, lightDiff(), and MYMAX.
|
private |
References collector, cur_node, Diag13, MYMIN, quad_indices_02, quad_indices_13, and setupCuboidVertices().
Referenced by drawAutoLightedCuboid(), and drawSolidNode().
|
private |
References blockpos_nodes, BS, cur_node, data, drawAutoLightedCuboid(), ContentFeatures::drawtype, MATERIAL_FLAG_CRACK, NDT_FENCELIKE, nodedef, R90, TileSpec::rotation, and useTile().
Referenced by drawNode().
|
private |
References blockpos_nodes, BS, CONTENT_AIR, CONTENT_IGNORE, cur_node, D6D_XN, D6D_XP, D6D_YN, D6D_YP, D6D_ZN, D6D_ZP, data, drawFirelikeQuad(), g_6dirs, MapNode::getContent(), and useTile().
Referenced by drawNode().
|
private |
References BS, cur_node, and drawQuad().
Referenced by drawFirelikeNode().
|
private |
References blockpos_nodes, BS, CPT2_GLASSLIKE_LIQUID_LEVEL, cur_node, D6D_XN, D6D_XP, D6D_YN, D6D_YP, D6D_ZN, D6D_ZP, data, dir(), drawAutoLightedCuboid(), drawQuad(), FRAMED_EDGE_COUNT, FRAMED_NEIGHBOR_COUNT, g_26dirs, g_6dirs, generateCuboidTextureCoords(), MapNode::getContent(), getSpecialTile(), and getTile().
Referenced by drawNode().
|
private |
References blockpos_nodes, BS, cur_node, D6D_XN, D6D_XP, D6D_YN, D6D_YP, D6D_ZN, D6D_ZP, data, dir(), drawQuad(), g_6dirs, MapNode::getContent(), and useTile().
Referenced by drawNode().
|
private |
References blendLightColor(), BS, collector, cur_liquid, cur_node, data, and quad_indices.
Referenced by drawLiquidNode().
|
private |
References calculateCornerLevels(), cur_liquid, drawLiquidBottom(), drawLiquidSides(), drawLiquidTop(), getLiquidNeighborhood(), and prepareLiquidNodeDrawing().
Referenced by drawNode().
|
private |
References blendLightColor(), BS, collector, MapblockMeshGenerator::LiquidData::NeighborData::content, cur_liquid, cur_node, data, MapblockMeshGenerator::LiquidData::NeighborData::is_same_liquid, nodedef, quad_indices, and MapblockMeshGenerator::LiquidData::NeighborData::top_is_same_liquid.
Referenced by drawLiquidNode().
|
private |
References blendLightColor(), blockpos_nodes, BS, collector, cur_liquid, cur_node, data, dir(), quad_indices, x, and z.
Referenced by drawLiquidNode().
|
private |
References applyFacesShading(), blendLightColor(), cloneStaticMesh(), collector, CPT2_4DIR, CPT2_COLORED_4DIR, CPT2_COLORED_DEGROTATE, CPT2_COLORED_FACEDIR, CPT2_COLORED_WALLMOUNTED, CPT2_DEGROTATE, CPT2_FACEDIR, CPT2_WALLMOUNTED, cur_node, data, MYMIN, nodedef, recalculateBoundingBox(), rotateMeshBy6dFacedir(), rotateMeshXZby(), useTile(), wallmounted_to_facedir, and warningstream.
Referenced by drawNode().
|
private |
References BS, cur_node, data, drawAllfacesNode(), drawFencelikeNode(), drawFirelikeNode(), drawGlasslikeFramedNode(), drawGlasslikeNode(), drawLiquidNode(), drawMeshNode(), drawNodeboxNode(), drawPlantlikeNode(), drawPlantlikeRootedNode(), drawRaillikeNode(), drawSignlikeNode(), drawSolidNode(), drawTorchlikeNode(), encode_light(), errorUnknownDrawtype(), getInteriorLight(), getSmoothLightFrame(), intToFloat(), NDT_AIRLIKE, NDT_ALLFACES, NDT_FENCELIKE, NDT_FIRELIKE, NDT_FLOWINGLIQUID, NDT_GLASSLIKE, NDT_GLASSLIKE_FRAMED, NDT_LIQUID, NDT_MESH, NDT_NODEBOX, NDT_NORMAL, NDT_PLANTLIKE, NDT_PLANTLIKE_ROOTED, NDT_RAILLIKE, NDT_SIGNLIKE, NDT_TORCHLIKE, and nodedef.
Referenced by generate().
|
private |
References blockpos_nodes, BS, CPT2_4DIR, CPT2_COLORED_4DIR, CPT2_COLORED_FACEDIR, CPT2_COLORED_WALLMOUNTED, CPT2_FACEDIR, CPT2_LEVELED, CPT2_WALLMOUNTED, cur_node, data, dir(), drawAutoLightedCuboid(), generateCuboidTextureCoords(), getNodeBoxMask(), getTile(), NDT_NORMAL, NODEBOX_CONNECTED, nodedef, MapNode::param0, and MapNode::param2.
Referenced by drawNode().
|
private |
References BS, CPT2_COLORED_DEGROTATE, CPT2_DEGROTATE, CPT2_LEVELED, CPT2_MESHOPTIONS, cur_node, cur_plant, drawPlantlikeQuad(), DWM_XN, DWM_XP, DWM_YP, DWM_ZN, DWM_ZP, MO_BIT_RANDOM_OFFSET, MO_BIT_RANDOM_OFFSET_Y, MO_BIT_SCALE_SQRT2, MO_MASK_STYLE, PseudoRandom::next(), nodedef, PLANT_STYLE_CROSS, PLANT_STYLE_CROSS2, PLANT_STYLE_HASH, PLANT_STYLE_HASH2, and PLANT_STYLE_STAR.
Referenced by drawPlantlikeNode(), and drawPlantlikeRootedNode().
|
private |
References drawPlantlike(), and useTile().
Referenced by drawNode().
|
private |
References BS, cur_node, cur_plant, drawQuad(), DWM_XN, DWM_XP, DWM_YN, DWM_YP, DWM_ZN, DWM_ZP, PseudoRandom::next(), and nodedef.
Referenced by drawPlantlike().
|
private |
References blockpos_nodes, BS, cur_node, data, drawPlantlike(), drawSolidNode(), encode_light(), getInteriorLight(), getSmoothLightFrame(), nodedef, and useTile().
Referenced by drawNode().
|
private |
References applyFacesShading(), blendLightColor(), collector, cur_node, data, and quad_indices.
Referenced by drawFirelikeQuad(), drawGlasslikeFramedNode(), drawGlasslikeNode(), drawPlantlikeQuad(), drawRaillikeNode(), drawSignlikeNode(), and drawTorchlikeNode().
|
private |
References BS, cur_node, cur_rail, dir(), drawQuad(), isSameRail(), MATERIAL_FLAG_BACKFACE_CULLING, raillike_groupname, and useTile().
Referenced by drawNode().
|
private |
References BS, cur_node, drawQuad(), DWM_S1, DWM_S2, DWM_XN, DWM_XP, DWM_YN, DWM_YP, DWM_ZN, DWM_ZP, MATERIAL_FLAG_BACKFACE_CULLING, nodedef, and useTile().
Referenced by drawNode().
|
private |
References applyFacesShading(), blockpos_nodes, BS, CONTENT_AIR, CONTENT_IGNORE, cur_node, data, Diag02, Diag13, drawCuboid(), encode_light(), MapNode::getContent(), getFaceLight(), getSmoothLightSolid(), getTile(), light_dirs, light_indices, lightDiff(), MATERIAL_FLAG_BACKFACE_CULLING, NDT_LIQUID, NDT_NORMAL, and nodedef.
Referenced by drawNode(), and drawPlantlikeRootedNode().
|
private |
References BS, cur_node, drawQuad(), DWM_S1, DWM_S2, DWM_XN, DWM_XP, DWM_YN, DWM_YP, DWM_ZN, DWM_ZP, MATERIAL_FLAG_BACKFACE_CULLING, nodedef, and useTile().
Referenced by drawNode().
|
private |
References cur_node, FATAL_ERROR, and infostream.
Referenced by drawNode().
| void MapblockMeshGenerator::generate | ( | ) |
References blockpos_nodes, cur_node, data, drawNode(), nodedef, and ZoneScoped.
Referenced by createGenericNodeMesh(), and generateNodeMesh().
|
staticprivate |
References BS.
Referenced by drawGlasslikeFramedNode(), and drawNodeboxNode().
|
private |
References BS, MapblockMeshGenerator::LiquidData::NeighborData::content, CONTENT_AIR, cur_liquid, MapblockMeshGenerator::LiquidData::NeighborData::level, and MapblockMeshGenerator::LiquidData::NeighborData::top_is_same_liquid.
Referenced by calculateCornerLevels().
|
private |
References blockpos_nodes, MapblockMeshGenerator::LiquidData::NeighborData::content, CONTENT_IGNORE, cur_liquid, cur_node, data, MapNode::getContent(), MapblockMeshGenerator::LiquidData::NeighborData::is_same_liquid, MapblockMeshGenerator::LiquidData::NeighborData::level, LIQUID_LEVEL_MASK, LIQUID_LEVEL_MAX, nodedef, MapNode::param2, rangelim(), and MapblockMeshGenerator::LiquidData::NeighborData::top_is_same_liquid.
Referenced by drawLiquidNode().
|
private |
References ALPHAMODE_OPAQUE, BS, and cur_node.
Referenced by drawNodeboxNode().
|
private |
References blockpos_nodes, cur_node, data, getSmoothLightTransparent(), light_dirs, LightPair::lightDay, and LightPair::lightNight.
Referenced by drawAllfacesNode(), drawNode(), and drawPlantlikeRootedNode().
|
private |
References TileLayer::color, cur_node, TileLayer::empty(), f, TileLayer::has_color, TileSpec::layers, MATERIAL_FLAG_CRACK, and TileLayer::material_flags.
Referenced by drawGlasslikeFramedNode(), prepareLiquidNodeDrawing(), and useTile().
|
private |
References cur_node, data, and getNodeTileN().
Referenced by drawAllfacesNode(), drawGlasslikeFramedNode(), drawNodeboxNode(), drawSolidNode(), and useTile().
|
private |
References blockpos_nodes, cur_node, cur_rail, data, dir(), ContentFeatures::drawtype, MapNode::getContent(), ContentFeatures::getGroup(), NDT_RAILLIKE, nodedef, and raillike_groupname.
Referenced by drawRaillikeNode().
|
private |
References blockpos_nodes, cur_liquid, cur_node, data, encode_light(), MapNode::getContent(), getInteriorLight(), getSpecialTile(), and nodedef.
Referenced by drawLiquidNode().
|
private |
References cur_node, data, getSpecialTile(), getTile(), and TileSpec::layers.
Referenced by drawFencelikeNode(), drawFirelikeNode(), drawGlasslikeNode(), drawMeshNode(), drawPlantlikeNode(), drawPlantlikeRootedNode(), drawRaillikeNode(), drawSignlikeNode(), and drawTorchlikeNode().
|
private |
Referenced by MapblockMeshGenerator(), drawFencelikeNode(), drawFirelikeNode(), drawGlasslikeFramedNode(), drawGlasslikeNode(), drawLiquidTop(), drawNodeboxNode(), drawPlantlikeRootedNode(), drawSolidNode(), generate(), getLiquidNeighborhood(), getSmoothLightFrame(), isSameRail(), and prepareLiquidNodeDrawing().
|
private |
Referenced by MapblockMeshGenerator(), drawCuboid(), drawLiquidBottom(), drawLiquidSides(), drawLiquidTop(), drawMeshNode(), and drawQuad().
|
private |
| struct { ... } MapblockMeshGenerator::cur_node |
Referenced by blendLight(), blendLightColor(), blendLightColor(), drawAutoLightedCuboid(), drawCuboid(), drawFencelikeNode(), drawFirelikeNode(), drawFirelikeQuad(), drawGlasslikeFramedNode(), drawGlasslikeNode(), drawLiquidBottom(), drawLiquidSides(), drawLiquidTop(), drawMeshNode(), drawNode(), drawNodeboxNode(), drawPlantlike(), drawPlantlikeQuad(), drawPlantlikeRootedNode(), drawQuad(), drawRaillikeNode(), drawSignlikeNode(), drawSolidNode(), drawTorchlikeNode(), errorUnknownDrawtype(), generate(), getLiquidNeighborhood(), getNodeBoxMask(), getSmoothLightFrame(), getSpecialTile(), getTile(), getTile(), isSameRail(), prepareLiquidNodeDrawing(), and useTile().
|
private |
Referenced by drawPlantlike(), and drawPlantlikeQuad().
|
private |
Referenced by drawRaillikeNode(), and isSameRail().
|
private |
Referenced by MapblockMeshGenerator(), drawAllfacesNode(), drawAutoLightedCuboid(), drawFencelikeNode(), drawFirelikeNode(), drawGlasslikeFramedNode(), drawGlasslikeNode(), drawLiquidBottom(), drawLiquidSides(), drawLiquidTop(), drawMeshNode(), drawNode(), drawNodeboxNode(), drawPlantlikeRootedNode(), drawQuad(), drawSolidNode(), generate(), getLiquidNeighborhood(), getSmoothLightFrame(), getTile(), getTile(), isSameRail(), prepareLiquidNodeDrawing(), and useTile().
| const ContentFeatures* MapblockMeshGenerator::f |
Referenced by getSpecialTile().
| video::SColor MapblockMeshGenerator::lcolor |
| LightFrame MapblockMeshGenerator::lframe |
| MapNode MapblockMeshGenerator::n |
|
private |
Referenced by MapblockMeshGenerator(), drawFencelikeNode(), drawLiquidSides(), drawMeshNode(), drawNode(), drawNodeboxNode(), drawPlantlike(), drawPlantlikeQuad(), drawPlantlikeRootedNode(), drawSignlikeNode(), drawSolidNode(), drawTorchlikeNode(), generate(), getLiquidNeighborhood(), isSameRail(), and prepareLiquidNodeDrawing().
| v3f MapblockMeshGenerator::origin |
| v3s16 MapblockMeshGenerator::p |
|
staticprivate |
Referenced by drawRaillikeNode(), and isSameRail().