class Client;
class ITextureSource;
+class PartialMeshBuffer;
/*
ClientMap
ISceneNode::drop();
}
- void updateCamera(const v3f &pos, const v3f &dir, f32 fov, const v3s16 &offset)
- {
- v3s16 previous_block = getContainerPos(floatToInt(m_camera_position, BS) + m_camera_offset, MAP_BLOCKSIZE);
-
- m_camera_position = pos;
- m_camera_direction = dir;
- m_camera_fov = fov;
- m_camera_offset = offset;
-
- v3s16 current_block = getContainerPos(floatToInt(m_camera_position, BS) + m_camera_offset, MAP_BLOCKSIZE);
-
- // reorder the blocks when camera crosses block boundary
- if (previous_block != current_block)
- m_needs_update_drawlist = true;
- }
+ void updateCamera(v3f pos, v3f dir, f32 fov, v3s16 offset);
/*
Forcefully get a sector from somewhere
f32 getCameraFov() const { return m_camera_fov; }
private:
+
+ // update the vertex order in transparent mesh buffers
+ void updateTransparentMeshBuffers();
+
// Orders blocks by distance to the camera
class MapBlockComparer
{
v3s16 m_camera_block;
};
+
+ // reference to a mesh buffer used when rendering the map.
+ struct DrawDescriptor {
+ v3s16 m_pos;
+ union {
+ scene::IMeshBuffer *m_buffer;
+ const PartialMeshBuffer *m_partial_buffer;
+ };
+ bool m_reuse_material:1;
+ bool m_use_partial_buffer:1;
+
+ DrawDescriptor(v3s16 pos, scene::IMeshBuffer *buffer, bool reuse_material) :
+ m_pos(pos), m_buffer(buffer), m_reuse_material(reuse_material), m_use_partial_buffer(false)
+ {}
+
+ DrawDescriptor(v3s16 pos, const PartialMeshBuffer *buffer) :
+ m_pos(pos), m_partial_buffer(buffer), m_reuse_material(false), m_use_partial_buffer(true)
+ {}
+ };
+
Client *m_client;
RenderingEngine *m_rendering_engine;
v3f m_camera_direction = v3f(0,0,1);
f32 m_camera_fov = M_PI;
v3s16 m_camera_offset;
+ bool m_needs_update_transparent_meshes = true;
std::map<v3s16, MapBlock*, MapBlockComparer> m_drawlist;
std::map<v3s16, MapBlock*> m_drawlist_shadow;
bool m_cache_bilinear_filter;
bool m_cache_anistropic_filter;
bool m_added_to_shadow_renderer{false};
+ u16 m_cache_transparency_sorting_distance;
};