#include <clientmap.h>
Inheritance diagram for ClientMap:
Collaboration diagram for ClientMap:Classes | |
| class | MapBlockComparer |
Public Member Functions | |
| ClientMap (Client *client, RenderingEngine *rendering_engine, MapDrawControl &control, s32 id) | |
| bool | maySaveBlocks () override |
| void | updateCamera (v3f pos, v3f dir, f32 fov, v3s16 offset, video::SColor light_color) |
| MapSector * | emergeSector (v2s16 p) override |
| virtual void | OnRegisterSceneNode () override |
| virtual void | render () override |
| virtual const aabb3f & | getBoundingBox () const override |
| void | getBlocksInViewRange (v3s16 cam_pos_nodes, v3s16 *p_blocks_min, v3s16 *p_blocks_max, float range=-1.0f) |
| void | updateDrawList () |
| void | touchMapBlocks () |
| void | updateDrawListShadow (v3f shadow_light_pos, v3f shadow_light_dir, float radius, float length) |
| bool | needsUpdateDrawList () |
| void | renderMap (video::IVideoDriver *driver, s32 pass) |
| void | renderMapShadows (video::IVideoDriver *driver, const video::SMaterial &material, s32 pass, int frame, int total_frames) |
| int | getBackgroundBrightness (float max_d, u32 daylight_factor, int oldvalue, bool *sunlight_seen_result) |
| void | renderPostFx (CameraMode cam_mode) |
| void | invalidateMapBlockMesh (MapBlockMesh *mesh) |
| void | PrintInfo (std::ostream &out) override |
| const MapDrawControl & | getControl () const |
| f32 | getWantedRange () const |
| f32 | getCameraFov () const |
| void | onSettingChanged (std::string_view name, bool all) |
Public Member Functions inherited from Map | |
| Map (IGameDef *gamedef) | |
| virtual | ~Map () |
| DISABLE_CLASS_COPY (Map) | |
| void | addEventReceiver (MapEventReceiver *event_receiver) |
| void | removeEventReceiver (MapEventReceiver *event_receiver) |
| void | dispatchEvent (const MapEditEvent &event) |
| MapSector * | getSectorNoGenerateNoLock (v2s16 p2d) |
| MapSector * | getSectorNoGenerate (v2s16 p2d) |
| MapBlock * | getBlockNoCreate (v3s16 p) |
| MapBlock * | getBlockNoCreateNoEx (v3s16 p) |
| virtual MapBlock * | emergeBlock (v3s16 p, bool create_blank=true) |
| const NodeDefManager * | getNodeDefManager () |
| bool | isValidPosition (v3s16 p) |
| void | setNode (v3s16 p, MapNode n) |
| MapNode | getNode (v3s16 p, bool *is_valid_position=NULL) |
| virtual void | addNodeAndUpdate (v3s16 p, MapNode n, std::map< v3s16, MapBlock * > &modified_blocks, bool remove_metadata=true) |
| void | removeNodeAndUpdate (v3s16 p, std::map< v3s16, MapBlock * > &modified_blocks) |
| bool | addNodeWithEvent (v3s16 p, MapNode n, bool remove_metadata=true) |
| bool | removeNodeWithEvent (v3s16 p) |
| virtual void | beginSave () |
| virtual void | endSave () |
| virtual void | save (ModifiedState save_level) |
| virtual bool | saveBlock (MapBlock *block) |
| virtual bool | deleteBlock (v3s16 blockpos) |
| void | timerUpdate (float dtime, float unload_timeout, s32 max_loaded_blocks, std::vector< v3s16 > *unloaded_blocks=NULL) |
| void | unloadUnreferencedBlocks (std::vector< v3s16 > *unloaded_blocks=NULL) |
| void | deleteSectors (std::vector< v2s16 > &list) |
| std::vector< v3s16 > | findNodesWithMetadata (v3s16 p1, v3s16 p2) |
| NodeMetadata * | getNodeMetadata (v3s16 p) |
| bool | setNodeMetadata (v3s16 p, NodeMetadata *meta) |
| Sets metadata for a node. | |
| void | removeNodeMetadata (v3s16 p) |
| NodeTimer | getNodeTimer (v3s16 p) |
| void | setNodeTimer (const NodeTimer &t) |
| void | removeNodeTimer (v3s16 p) |
| template<typename F > | |
| void | forEachNodeInArea (v3s16 minp, v3s16 maxp, F func) |
| bool | isBlockOccluded (MapBlock *block, v3s16 cam_pos_nodes) |
| bool | isBlockOccluded (v3s16 pos_relative, v3s16 cam_pos_nodes, bool simple_check=false) |
Protected Member Functions | |
| virtual | ~ClientMap () |
| void | reportMetrics (u64 save_time_us, u32 saved_blocks, u32 all_blocks) override |
Protected Member Functions inherited from Map | |
| bool | determineAdditionalOcclusionCheck (v3s16 pos_camera, const core::aabbox3d< s16 > &block_bounds, v3s16 &to_check) |
| bool | isOccluded (v3s16 pos_camera, v3s16 pos_target, float step, float stepfac, float start_offset, float end_offset, u32 needed_count) |
Private Member Functions | |
| bool | isMeshOccluded (MapBlock *mesh_block, u16 mesh_size, v3s16 cam_pos_nodes) |
| void | updateTransparentMeshBuffers () |
Private Attributes | |
| Client * | m_client |
| RenderingEngine * | m_rendering_engine |
| aabb3f | m_box |
| MapDrawControl & | m_control |
| v3f | m_camera_position = v3f(0,0,0) |
| v3f | m_camera_direction = v3f(0,0,1) |
| f32 | m_camera_fov = M_PI |
| v3s16 | m_camera_offset |
| video::SColor | m_camera_light_color = video::SColor(0xFFFFFFFF) |
| bool | m_needs_update_transparent_meshes = true |
| std::map< v3s16, MapBlock *, MapBlockComparer > | m_drawlist |
| std::vector< MapBlock * > | m_keeplist |
| std::map< v3s16, MapBlock * > | m_drawlist_shadow |
| bool | m_needs_update_drawlist |
| CachedMeshBuffers | m_dynamic_buffers |
| bool | m_cache_trilinear_filter |
| bool | m_cache_bilinear_filter |
| bool | m_cache_anistropic_filter |
| bool | m_cache_transparency_sorting_group_by_buffers |
| u16 | m_cache_transparency_sorting_distance |
| bool | m_loops_occlusion_culler |
| bool | m_enable_raytraced_culling |
Additional Inherited Members | |
Protected Attributes inherited from Map | |
| IGameDef * | m_gamedef |
| std::set< MapEventReceiver * > | m_event_receivers |
| std::unordered_map< v2s16, MapSector * > | m_sectors |
| MapSector * | m_sector_cache = nullptr |
| v2s16 | m_sector_cache_p |
| const NodeDefManager * | m_nodedef |
| ClientMap::ClientMap | ( | Client * | client, |
| RenderingEngine * | rendering_engine, | ||
| MapDrawControl & | control, | ||
| s32 | id ) |
References ClientMap_settings, g_settings, on_settings_changed(), onSettingChanged(), and Settings::registerChangedCallback().
Here is the call graph for this function:
|
protectedvirtual |
References Settings::deregisterAllChangedCallbacks(), g_settings, and m_dynamic_buffers.
Here is the call graph for this function:Reimplemented from Map.
References Map::getSectorNoGenerate(), Map::m_gamedef, and Map::m_sectors.
Referenced by Client::step().
Here is the call graph for this function:
Here is the caller graph for this function:| int ClientMap::getBackgroundBrightness | ( | float | max_d, |
| u32 | daylight_factor, | ||
| int | oldvalue, | ||
| bool * | sunlight_seen_result ) |
References ARRLEN, BS, dir(), floatToInt(), g_profiler, MapNode::getLightBlend(), getVisibleBrightness(), ContentLightingFlags::has_light, myrand_range(), and SPT_AVG.
Here is the call graph for this function:| void ClientMap::getBlocksInViewRange | ( | v3s16 | cam_pos_nodes, |
| v3s16 * | p_blocks_min, | ||
| v3s16 * | p_blocks_max, | ||
| float | range = -1.0f ) |
References m_control, MAP_BLOCKSIZE, and MapDrawControl::wanted_range.
Referenced by touchMapBlocks(), and updateDrawList().
Here is the caller graph for this function:
|
inline |
References m_camera_fov.
Referenced by Client::sendPlayerPos(), and writePlayerPos().
Here is the caller graph for this function:
|
inline |
References m_control.
|
inline |
References m_control, and MapDrawControl::wanted_range.
Referenced by Client::sendPlayerPos(), and writePlayerPos().
Here is the caller graph for this function:| void ClientMap::invalidateMapBlockMesh | ( | MapBlockMesh * | mesh | ) |
Referenced by Client::step().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References MapBlock::getPos(), MapBlock::getPosRelative(), and MAP_BLOCKSIZE.
Referenced by updateDrawList().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
Reimplemented from Map.
|
inline |
References m_needs_update_drawlist.
|
overridevirtual |
| void ClientMap::onSettingChanged | ( | std::string_view | name, |
| bool | all ) |
References g_settings, Settings::get(), Settings::getBool(), Settings::getU16(), m_cache_anistropic_filter, m_cache_bilinear_filter, m_cache_transparency_sorting_distance, m_cache_transparency_sorting_group_by_buffers, m_cache_trilinear_filter, m_enable_raytraced_culling, and m_loops_occlusion_culler.
Referenced by ClientMap().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Reimplemented from Map.
|
overridevirtual |
| void ClientMap::renderMap | ( | video::IVideoDriver * | driver, |
| s32 | pass ) |
References MapBlockMesh::animate(), animated, Profiler::avg(), BS, MapBlockMesh::decreaseAnimationForceTimer(), g_profiler, ShadowRenderer::get_texture(), MapBlockMesh::getBoundingRadius(), MapBlockMesh::getBoundingSphereCenter(), MapBlock::getPosRelative(), MapBlockMesh::getTransparentBuffers(), intToFloat(), ShadowRenderer::is_active(), MapBlockMesh::isAnimationForced(), MAP_BLOCKSIZE, setMaterialFilters(), TimeTaker::stop(), ShadowRenderer::TEXTURE_LAYER_SHADOW, transformBuffersToDrawOrder(), and ZoneScoped.
Referenced by render().
Here is the call graph for this function:
Here is the caller graph for this function:| void ClientMap::renderMapShadows | ( | video::IVideoDriver * | driver, |
| const video::SMaterial & | material, | ||
| s32 | pass, | ||
| int | frame, | ||
| int | total_frames ) |
References Profiler::avg(), BS, g_profiler, g_settings, Settings::getBool(), intToFloat(), MAP_BLOCKSIZE, NDT_ALLFACES, TimeTaker::stop(), TILE_MATERIAL_WAVING_LEAVES, and transformBuffersToDrawOrder().
Referenced by ShadowRenderer::renderShadowMap().
Here is the call graph for this function:
Here is the caller graph for this function:| void ClientMap::renderPostFx | ( | CameraMode | cam_mode | ) |
References BS, CAMERA_MODE_FIRST, floatToInt(), ContentFeatures::post_effect_color, and ContentFeatures::post_effect_color_shaded.
Referenced by MapPostFxStep::run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprotectedvirtual |
Reimplemented from Map.
References Profiler::avg(), and g_profiler.
Here is the call graph for this function:| void ClientMap::touchMapBlocks | ( | ) |
References Profiler::avg(), BS, floatToInt(), g_profiler, MapSector::getBlocks(), getBlocksInViewRange(), MapBlockMesh::getBoundingRadius(), MapBlockMesh::getBoundingSphereCenter(), MapSector::getPos(), MapBlock::getPosRelative(), intToFloat(), m_camera_position, m_control, m_loops_occlusion_culler, Map::m_sectors, MAP_BLOCKSIZE, MapDrawControl::range_all, MapBlock::resetUsageTimer(), MapSector::size(), SPT_AVG, and MapDrawControl::wanted_range.
Here is the call graph for this function:References BS, dir(), floatToInt(), getContainerPos(), m_camera_direction, m_camera_fov, m_camera_light_color, m_camera_offset, m_camera_position, m_dynamic_buffers, m_needs_update_drawlist, m_needs_update_transparent_meshes, and MAP_BLOCKSIZE.
Referenced by Game::updateCameraOffset().
Here is the call graph for this function:
Here is the caller graph for this function:| void ClientMap::updateDrawList | ( | ) |
References MapDrawControl::allow_noclip, Profiler::avg(), BS, MeshGrid::cell_size, CONTENT_IGNORE, floatToInt(), g_profiler, NodeDefManager::get(), MapBlockFlags::Chunk::getBits(), Map::getBlockNoCreateNoEx(), MapSector::getBlockNoCreateNoEx(), MapSector::getBlocks(), getBlocksInViewRange(), MapBlockMesh::getBoundingRadius(), MapBlockMesh::getBoundingSphereCenter(), Client::getCamera(), MeshGrid::getCellPos(), MapBlockFlags::getChunk(), getContainerPos(), MapNode::getContent(), Camera::getFrustumCuller(), Client::getMeshGrid(), MeshGrid::getMeshPos(), Map::getNode(), MapBlock::getPos(), MapSector::getPos(), MapBlock::getPosRelative(), Map::getSectorNoGenerate(), intToFloat(), isMeshOccluded(), m_camera_position, m_client, m_control, m_drawlist, m_enable_raytraced_culling, m_keeplist, m_loops_occlusion_culler, m_needs_update_drawlist, Map::m_nodedef, Map::m_sectors, MAP_BLOCKSIZE, MapDrawControl::range_all, MapBlock::refDrop(), MapBlock::refGrab(), MapBlock::resetUsageTimer(), MapSector::size(), SPT_AVG, and MapDrawControl::wanted_range.
Here is the call graph for this function:| void ClientMap::updateDrawListShadow | ( | v3f | shadow_light_pos, |
| v3f | shadow_light_dir, | ||
| float | radius, | ||
| float | length ) |
References Profiler::avg(), BS, g_profiler, MapSector::getBlocks(), MapBlockMesh::getBoundingRadius(), MapBlockMesh::getBoundingSphereCenter(), MapBlock::getPos(), MapBlock::getPosRelative(), intToFloat(), MapBlock::refDrop(), MapBlock::refGrab(), MapBlock::resetUsageTimer(), MapSector::size(), and SPT_AVG.
Here is the call graph for this function:
|
private |
References Profiler::avg(), BS, MapBlockMesh::consolidateTransparentBuffers(), g_profiler, MapBlockMesh::getBoundingRadius(), MapBlockMesh::getBoundingSphereCenter(), MapBlock::getPos(), MapBlock::getPosRelative(), MapBlockMesh::getTransparentBuffers(), intToFloat(), SPT_AVG, and MapBlockMesh::updateTransparentBuffers().
Here is the call graph for this function:
|
private |
|
private |
Referenced by onSettingChanged().
|
private |
Referenced by onSettingChanged().
|
private |
Referenced by onSettingChanged().
|
private |
Referenced by onSettingChanged().
|
private |
Referenced by onSettingChanged().
Referenced by updateCamera().
|
private |
Referenced by getCameraFov(), and updateCamera().
|
private |
Referenced by updateCamera().
|
private |
Referenced by updateCamera().
Referenced by touchMapBlocks(), updateCamera(), and updateDrawList().
|
private |
Referenced by updateDrawList().
|
private |
Referenced by getBlocksInViewRange(), getControl(), getWantedRange(), touchMapBlocks(), and updateDrawList().
|
private |
Referenced by updateDrawList().
|
private |
Referenced by ~ClientMap(), and updateCamera().
|
private |
Referenced by onSettingChanged(), and updateDrawList().
|
private |
Referenced by updateDrawList().
|
private |
Referenced by onSettingChanged(), touchMapBlocks(), and updateDrawList().
|
private |
Referenced by needsUpdateDrawList(), updateCamera(), and updateDrawList().
|
private |
Referenced by updateCamera().
|
private |