mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
MapblockMeshGenerator: Use more verbose member names (#13244)
This commit is contained in:
parent
5a5697273b
commit
8db4381304
File diff suppressed because it is too large
Load Diff
@ -61,17 +61,25 @@ struct LightFrame {
|
|||||||
class MapblockMeshGenerator
|
class MapblockMeshGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MeshMakeData *data;
|
MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output,
|
||||||
MeshCollector *collector;
|
scene::IMeshManipulator *mm);
|
||||||
|
void generate();
|
||||||
|
void renderSingle(content_t node, u8 param2 = 0x00);
|
||||||
|
|
||||||
const NodeDefManager *nodedef;
|
private:
|
||||||
scene::IMeshManipulator *meshmanip;
|
MeshMakeData *const data;
|
||||||
|
MeshCollector *const collector;
|
||||||
|
|
||||||
|
const NodeDefManager *const nodedef;
|
||||||
|
scene::IMeshManipulator *const meshmanip;
|
||||||
|
|
||||||
|
const v3s16 blockpos_nodes;
|
||||||
|
|
||||||
// options
|
// options
|
||||||
bool enable_mesh_cache;
|
const bool enable_mesh_cache;
|
||||||
|
|
||||||
// current node
|
// current node
|
||||||
v3s16 blockpos_nodes;
|
struct {
|
||||||
v3s16 p;
|
v3s16 p;
|
||||||
v3f origin;
|
v3f origin;
|
||||||
MapNode n;
|
MapNode n;
|
||||||
@ -80,7 +88,8 @@ public:
|
|||||||
LightFrame frame;
|
LightFrame frame;
|
||||||
video::SColor color;
|
video::SColor color;
|
||||||
TileSpec tile;
|
TileSpec tile;
|
||||||
float scale;
|
f32 scale;
|
||||||
|
} cur_node;
|
||||||
|
|
||||||
// lighting
|
// lighting
|
||||||
void getSmoothLightFrame();
|
void getSmoothLightFrame();
|
||||||
@ -106,21 +115,25 @@ public:
|
|||||||
u8 getNodeBoxMask(aabb3f box, u8 solid_neighbors, u8 sametype_neighbors) const;
|
u8 getNodeBoxMask(aabb3f box, u8 solid_neighbors, u8 sametype_neighbors) const;
|
||||||
|
|
||||||
// liquid-specific
|
// liquid-specific
|
||||||
bool top_is_same_liquid;
|
struct LiquidData {
|
||||||
bool draw_liquid_bottom;
|
|
||||||
TileSpec tile_liquid;
|
|
||||||
TileSpec tile_liquid_top;
|
|
||||||
content_t c_flowing;
|
|
||||||
content_t c_source;
|
|
||||||
video::SColor color_liquid_top;
|
|
||||||
struct NeighborData {
|
struct NeighborData {
|
||||||
f32 level;
|
f32 level;
|
||||||
content_t content;
|
content_t content;
|
||||||
bool is_same_liquid;
|
bool is_same_liquid;
|
||||||
bool top_is_same_liquid;
|
bool top_is_same_liquid;
|
||||||
};
|
};
|
||||||
NeighborData liquid_neighbors[3][3];
|
|
||||||
|
bool top_is_same_liquid;
|
||||||
|
bool draw_bottom;
|
||||||
|
TileSpec tile;
|
||||||
|
TileSpec tile_top;
|
||||||
|
content_t c_flowing;
|
||||||
|
content_t c_source;
|
||||||
|
video::SColor color_top;
|
||||||
|
NeighborData neighbors[3][3];
|
||||||
f32 corner_levels[2][2];
|
f32 corner_levels[2][2];
|
||||||
|
};
|
||||||
|
LiquidData cur_liquid;
|
||||||
|
|
||||||
void prepareLiquidNodeDrawing();
|
void prepareLiquidNodeDrawing();
|
||||||
void getLiquidNeighborhood();
|
void getLiquidNeighborhood();
|
||||||
@ -133,16 +146,22 @@ public:
|
|||||||
// raillike-specific
|
// raillike-specific
|
||||||
// name of the group that enables connecting to raillike nodes of different kind
|
// name of the group that enables connecting to raillike nodes of different kind
|
||||||
static const std::string raillike_groupname;
|
static const std::string raillike_groupname;
|
||||||
|
struct RaillikeData {
|
||||||
int raillike_group;
|
int raillike_group;
|
||||||
|
};
|
||||||
|
RaillikeData cur_rail;
|
||||||
bool isSameRail(v3s16 dir);
|
bool isSameRail(v3s16 dir);
|
||||||
|
|
||||||
// plantlike-specific
|
// plantlike-specific
|
||||||
|
struct PlantlikeData {
|
||||||
PlantlikeStyle draw_style;
|
PlantlikeStyle draw_style;
|
||||||
v3f offset;
|
v3f offset;
|
||||||
float rotate_degree;
|
float rotate_degree;
|
||||||
bool random_offset_Y;
|
bool random_offset_Y;
|
||||||
int face_num;
|
int face_num;
|
||||||
float plant_height;
|
float plant_height;
|
||||||
|
};
|
||||||
|
PlantlikeData cur_plant;
|
||||||
|
|
||||||
void drawPlantlikeQuad(float rotation, float quad_offset = 0,
|
void drawPlantlikeQuad(float rotation, float quad_offset = 0,
|
||||||
bool offset_top_only = false);
|
bool offset_top_only = false);
|
||||||
@ -171,10 +190,4 @@ public:
|
|||||||
// common
|
// common
|
||||||
void errorUnknownDrawtype();
|
void errorUnknownDrawtype();
|
||||||
void drawNode();
|
void drawNode();
|
||||||
|
|
||||||
public:
|
|
||||||
MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output,
|
|
||||||
scene::IMeshManipulator *mm);
|
|
||||||
void generate();
|
|
||||||
void renderSingle(content_t node, u8 param2 = 0x00);
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user