28#include <unordered_map>
89 areaSQ = (v2-v1).crossProduct(v3-v1).getLengthSQ() / 4;
97 return (v2-v1).crossProduct(v3-v1);
134 s32
buildTree(
v3f normal,
v3f origin,
float delta,
const std::vector<s32> &list, u32 depth);
135 void traverse(s32 node,
v3f viewpoint, std::vector<s32> &output)
const;
193 bool animate(
bool faraway,
float time,
int crack, u32 daynight_ratio);
207 std::vector<MinimapMapblock*> minimap_mapblocks;
209 return minimap_mapblocks;
301video::SColor
encode_light(u16 light, u8 emissive_light);
323 u16 light, u32 daynight_ratio);
333 const video::SColor &data,
const video::SColorf &dayLight);
static v2f dir(const v2f &pos_dist)
Definition camera.cpp:205
Definition texturesource.h:45
Implements a binary space partitioning tree See also: https://en.wikipedia.org/wiki/Binary_space_part...
Definition mapblock_mesh.h:106
std::vector< TreeNode > nodes
Definition mapblock_mesh.h:138
void buildTree(const std::vector< MeshTriangle > *triangles, u16 side_lingth)
Definition mapblock_mesh.cpp:439
const std::vector< MeshTriangle > * triangles
Definition mapblock_mesh.h:137
s32 root
Definition mapblock_mesh.h:139
void traverse(v3f viewpoint, std::vector< s32 > &output) const
Definition mapblock_mesh.h:112
MapBlockBspTree()
Definition mapblock_mesh.h:108
Definition mapblock_mesh.h:181
std::vector< MinimapMapblock * > m_minimap_mapblocks
Definition mapblock_mesh.h:247
~MapBlockMesh()
Definition mapblock_mesh.cpp:804
void updateTransparentBuffers(v3f camera_pos, v3s16 block_pos)
update transparent buffers to render towards the camera
Definition mapblock_mesh.cpp:899
MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offset)
Definition mapblock_mesh.cpp:612
u32 m_last_daynight_ratio
Definition mapblock_mesh.h:273
f32 getBoundingRadius() const
Radius of the bounding-sphere, in BS-space.
Definition mapblock_mesh.h:224
bool isAnimationForced() const
Definition mapblock_mesh.h:212
const std::vector< PartialMeshBuffer > & getTransparentBuffers() const
get the list of transparent buffers
Definition mapblock_mesh.h:234
bool m_enable_shaders
Definition mapblock_mesh.h:254
v3f getBoundingSphereCenter() const
Center of the bounding-sphere, in BS-space, relative to block pos.
Definition mapblock_mesh.h:227
int m_animation_force_timer
Definition mapblock_mesh.h:258
std::map< std::pair< u8, u32 >, std::string > m_crack_materials
Definition mapblock_mesh.h:264
MapBlockBspTree m_bsp_tree
Definition mapblock_mesh.h:282
std::vector< MinimapMapblock * > moveMinimapMapblocks()
Definition mapblock_mesh.h:205
void consolidateTransparentBuffers()
Definition mapblock_mesh.cpp:935
f32 m_bounding_radius
Definition mapblock_mesh.h:251
scene::IMesh * getMesh()
Definition mapblock_mesh.h:195
bool animate(bool faraway, float time, int crack, u32 daynight_ratio)
Definition mapblock_mesh.cpp:818
void decreaseAnimationForceTimer()
Definition mapblock_mesh.h:217
std::map< std::pair< u8, u32 >, std::map< u32, video::SColor > > m_daynight_diffs
Definition mapblock_mesh.h:277
std::vector< MeshTriangle > m_transparent_triangles
Definition mapblock_mesh.h:280
bool m_transparent_buffers_consolidated
Definition mapblock_mesh.h:286
scene::IMesh * m_mesh[MAX_TILE_LAYERS]
Definition mapblock_mesh.h:246
IShaderSource * m_shdrsrc
Definition mapblock_mesh.h:249
ITextureSource * m_tsrc
Definition mapblock_mesh.h:248
int m_last_crack
Definition mapblock_mesh.h:262
bool m_has_animation
Definition mapblock_mesh.h:257
scene::IMesh * getMesh(u8 layer)
Definition mapblock_mesh.h:200
std::map< std::pair< u8, u32 >, AnimationInfo > m_animation_info
Definition mapblock_mesh.h:269
v3f m_bounding_sphere_center
Definition mapblock_mesh.h:252
std::vector< PartialMeshBuffer > m_transparent_buffers
Definition mapblock_mesh.h:284
Definition mapblock_mesh.h:75
scene::SMeshBuffer * buffer
Definition mapblock_mesh.h:77
u16 p3
Definition mapblock_mesh.h:78
float areaSQ
Definition mapblock_mesh.h:80
v3f getNormal() const
Definition mapblock_mesh.h:92
u16 p2
Definition mapblock_mesh.h:78
v3f centroid
Definition mapblock_mesh.h:79
void updateAttributes()
Definition mapblock_mesh.h:82
u16 p1
Definition mapblock_mesh.h:78
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:556
Definition mapblock_mesh.h:153
void afterDraw() const
Definition mapblock_mesh.cpp:602
PartialMeshBuffer(scene::SMeshBuffer *buffer, std::vector< u16 > &&vertex_indexes)
Definition mapblock_mesh.h:155
std::vector< u16 > m_vertex_indexes
Definition mapblock_mesh.h:166
void beforeDraw() const
Definition mapblock_mesh.cpp:595
scene::SMeshBuffer * m_buffer
Definition mapblock_mesh.h:165
scene::IMeshBuffer * getBuffer() const
Definition mapblock_mesh.h:159
const std::vector< u16 > & getVertexIndexes() const
Definition mapblock_mesh.h:160
core::vector3d< s16 > v3s16
Definition irr_v3d.h:28
core::vector3df v3f
Definition irr_v3d.h:26
void getNodeTileN(MapNode mn, const v3s16 &p, u8 tileindex, MeshMakeData *data, TileSpec &tile)
Definition mapblock_mesh.cpp:335
u8 get_solid_sides(MeshMakeData *data)
Return bitset of the sides of the mesh that consist of solid nodes only Bits: 0 0 -Z +Z -X +X -Y +Y.
Definition mapblock_mesh.cpp:993
u16 getSmoothLightTransparent(const v3s16 &p, const v3s16 &corner, MeshMakeData *data)
Definition mapblock_mesh.cpp:266
void final_color_blend(video::SColor *result, u16 light, u32 daynight_ratio)
Definition mapblock_mesh.cpp:292
video::SColor encode_light(u16 light, u8 emissive_light)
Definition mapblock_mesh.cpp:965
u16 getInteriorLight(MapNode n, s32 increment, const NodeDefManager *ndef)
Definition mapblock_mesh.cpp:100
u16 getFaceLight(MapNode n, MapNode n2, const NodeDefManager *ndef)
Definition mapblock_mesh.cpp:136
void getNodeTile(MapNode mn, const v3s16 &p, const v3s16 &dir, MeshMakeData *data, TileSpec &tile)
Definition mapblock_mesh.cpp:355
void get_sunlight_color(video::SColorf *sunlight, u32 daynight_ratio)
Definition mapblock_mesh.cpp:284
u16 getSmoothLightSolid(const v3s16 &p, const v3s16 &face_dir, const v3s16 &corner, MeshMakeData *data)
Definition mapblock_mesh.cpp:256
Definition activeobjectmgr.cpp:26
Definition mapblock_mesh.h:120
v3f normal
Definition mapblock_mesh.h:121
std::vector< s32 > triangle_refs
Definition mapblock_mesh.h:123
v3f origin
Definition mapblock_mesh.h:122
s32 front_ref
Definition mapblock_mesh.h:124
s32 back_ref
Definition mapblock_mesh.h:125
TreeNode(v3f normal, v3f origin, const std::vector< s32 > &triangle_refs, s32 front_ref, s32 back_ref)
Definition mapblock_mesh.h:128
Definition mapblock_mesh.h:240
int frame_offset
Definition mapblock_mesh.h:242
TileLayer tile
Definition mapblock_mesh.h:243
int frame
Definition mapblock_mesh.h:241
Definition mapblock_mesh.h:44
void fillBlockDataBegin(const v3s16 &blockpos)
Definition mapblock_mesh.cpp:48
v3s16 m_crack_pos_relative
Definition mapblock_mesh.h:47
const NodeDefManager * nodedef
Definition mapblock_mesh.h:51
bool m_smooth_lighting
Definition mapblock_mesh.h:48
bool m_use_shaders
Definition mapblock_mesh.h:52
MeshMakeData(const NodeDefManager *ndef, u16 side_length, bool use_shaders)
Definition mapblock_mesh.cpp:42
VoxelManipulator m_vmanip
Definition mapblock_mesh.h:45
void setSmoothLighting(bool smooth_lighting)
Definition mapblock_mesh.cpp:75
void setCrack(int crack_level, v3s16 crack_pos)
Definition mapblock_mesh.cpp:69
u16 side_length
Definition mapblock_mesh.h:49
void fillBlockData(const v3s16 &bp, MapNode *data)
Definition mapblock_mesh.cpp:60
v3s16 m_blockpos
Definition mapblock_mesh.h:46
Defines a layer of a tile.
Definition tile.h:73
static std::string p(std::string path)
Definition test_filesys.cpp:66
#define MAX_TILE_LAYERS
Definition tile.h:69