#include <clientmap.h>
Public Member Functions | |
ClientMap (Client *client, MapDrawControl &control, s32 id) | |
virtual | ~ClientMap ()=default |
s32 | mapType () const |
void | drop () |
void | updateCamera (const v3f &pos, const v3f &dir, f32 fov, const v3s16 &offset) |
MapSector * | emergeSector (v2s16 p) |
virtual void | OnRegisterSceneNode () |
virtual void | render () |
virtual const aabb3f & | getBoundingBox () const |
void | getBlocksInViewRange (v3s16 cam_pos_nodes, v3s16 *p_blocks_min, v3s16 *p_blocks_max) |
void | updateDrawList () |
void | renderMap (video::IVideoDriver *driver, s32 pass) |
int | getBackgroundBrightness (float max_d, u32 daylight_factor, int oldvalue, bool *sunlight_seen_result) |
void | renderPostFx (CameraMode cam_mode) |
virtual void | PrintInfo (std::ostream &out) |
const MapDrawControl & | getControl () const |
f32 | getCameraFov () const |
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 | isNodeUnderground (v3s16 p) |
bool | isValidPosition (v3s16 p) |
void | setNode (v3s16 p, MapNode &n) |
MapNode | getNode (v3s16 p, bool *is_valid_position=NULL) |
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, u32 max_loaded_blocks, std::vector< v3s16 > *unloaded_blocks=NULL) |
void | unloadUnreferencedBlocks (std::vector< v3s16 > *unloaded_blocks=NULL) |
void | deleteSectors (std::vector< v2s16 > &list) |
void | transformLiquids (std::map< v3s16, MapBlock * > &modified_blocks, ServerEnvironment *env) |
std::vector< v3s16 > | findNodesWithMetadata (v3s16 p1, v3s16 p2) |
NodeMetadata * | getNodeMetadata (v3s16 p) |
bool | setNodeMetadata (v3s16 p, NodeMetadata *meta) |
Sets metadata for a node. More... | |
void | removeNodeMetadata (v3s16 p) |
NodeTimer | getNodeTimer (v3s16 p) |
void | setNodeTimer (const NodeTimer &t) |
void | removeNodeTimer (v3s16 p) |
void | transforming_liquid_add (v3s16 p) |
bool | isBlockOccluded (MapBlock *block, v3s16 cam_pos_nodes) |
Private Attributes | |
Client * | m_client |
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 |
std::map< v3s16, MapBlock * > | m_drawlist |
std::set< v2s16 > | m_last_drawn_sectors |
bool | m_cache_trilinear_filter |
bool | m_cache_bilinear_filter |
bool | m_cache_anistropic_filter |
Additional Inherited Members | |
Protected Member Functions inherited from Map | |
bool | determineAdditionalOcclusionCheck (const v3s16 &pos_camera, const core::aabbox3d< s16 > &block_bounds, v3s16 &check) |
bool | isOccluded (const v3s16 &pos_camera, const v3s16 &pos_target, float step, float stepfac, float start_offset, float end_offset, u32 needed_count) |
Protected Attributes inherited from Map | |
IGameDef * | m_gamedef |
std::set< MapEventReceiver * > | m_event_receivers |
std::map< v2s16, MapSector * > | m_sectors |
MapSector * | m_sector_cache = nullptr |
v2s16 | m_sector_cache_p |
UniqueQueue< v3s16 > | m_transforming_liquid |
const NodeDefManager * | m_nodedef |
ClientMap::ClientMap | ( | Client * | client, |
MapDrawControl & | control, | ||
s32 | id | ||
) |
References BS, g_settings, Settings::getBool(), m_box, m_cache_anistropic_filter, m_cache_bilinear_filter, and m_cache_trilinear_filter.
|
virtualdefault |
|
inlinevirtual |
Reimplemented from Map.
Referenced by ClientEnvironment::~ClientEnvironment().
Reimplemented from Map.
References Map::getSectorNoGenerate(), Map::m_gamedef, and Map::m_sectors.
int ClientMap::getBackgroundBrightness | ( | float | max_d, |
u32 | daylight_factor, | ||
int | oldvalue, | ||
bool * | sunlight_seen_result | ||
) |
References BS, CPT_LIGHT, decode_light(), dir(), floatToInt(), g_profiler, NodeDefManager::get(), MapNode::getLightBlend(), Map::getNode(), getVisibleBrightness(), m_camera_direction, m_camera_position, Map::m_nodedef, myrand_range(), ContentFeatures::param_type, and SPT_AVG.
void ClientMap::getBlocksInViewRange | ( | v3s16 | cam_pos_nodes, |
v3s16 * | p_blocks_min, | ||
v3s16 * | p_blocks_max | ||
) |
References m_control, MAP_BLOCKSIZE, and MapDrawControl::wanted_range.
Referenced by updateDrawList().
|
inline |
References m_camera_fov.
Referenced by Client::sendPlayerPos(), and writePlayerPos().
|
inline |
References m_control.
Referenced by Client::sendPlayerPos(), and writePlayerPos().
|
inlinevirtual |
Reimplemented from Map.
References MAPTYPE_CLIENT.
|
virtual |
|
virtual |
Reimplemented from Map.
|
inlinevirtual |
void ClientMap::renderMap | ( | video::IVideoDriver * | driver, |
s32 | pass | ||
) |
References MeshBufListList::add(), analyze_block(), MapBlockMesh::animate(), Profiler::avg(), BS, MapBlockMesh::decreaseAnimationForceTimer(), errorstream, g_profiler, Client::getAnimationTime(), Client::getCrackLevel(), Environment::getDayNightRatio(), Client::getEnv(), MapBlockMesh::getMesh(), MapBlock::getPos(), TimeTaker::getTimerTime(), infostream, intToFloat(), MapBlockMesh::isAnimationForced(), isBlockInSight(), MeshBufListList::lists, m_cache_anistropic_filter, m_cache_bilinear_filter, m_cache_trilinear_filter, m_camera_direction, m_camera_fov, m_camera_offset, m_camera_position, m_client, m_control, m_drawlist, m_last_drawn_sectors, MAP_BLOCKSIZE, MAX_TILE_LAYERS, MapBlock::mesh, MapDrawControl::range_all, MapDrawControl::show_wireframe, and TimeTaker::stop().
Referenced by render().
void ClientMap::renderPostFx | ( | CameraMode | cam_mode | ) |
References BS, CAMERA_MODE_FIRST, Client::checkLocalPrivilege(), floatToInt(), g_settings, NodeDefManager::get(), Settings::getBool(), Map::getNode(), m_camera_position, m_client, Map::m_nodedef, ContentFeatures::post_effect_color, and ContentFeatures::solidness.
|
inline |
References dir(), m_camera_direction, m_camera_fov, m_camera_offset, and m_camera_position.
void ClientMap::updateDrawList | ( | ) |
References Profiler::avg(), BS, CONTENT_IGNORE, floatToInt(), g_profiler, g_settings, NodeDefManager::get(), MapSector::getBlocks(), getBlocksInViewRange(), Settings::getBool(), MapNode::getContent(), Map::getNode(), MapSector::getPos(), isBlockInSight(), Map::isBlockOccluded(), m_camera_direction, m_camera_fov, m_camera_position, m_control, m_drawlist, m_last_drawn_sectors, Map::m_nodedef, Map::m_sectors, MapDrawControl::range_all, MapBlock::refDrop(), MapSector::size(), ContentFeatures::solidness, SPT_AVG, and MapDrawControl::wanted_range.
|
private |
|
private |
Referenced by ClientMap(), and renderMap().
|
private |
Referenced by ClientMap(), and renderMap().
|
private |
Referenced by ClientMap(), and renderMap().
Referenced by getBackgroundBrightness(), renderMap(), updateCamera(), and updateDrawList().
|
private |
Referenced by getCameraFov(), renderMap(), updateCamera(), and updateDrawList().
|
private |
Referenced by renderMap(), and updateCamera().
Referenced by getBackgroundBrightness(), renderMap(), renderPostFx(), updateCamera(), and updateDrawList().
|
private |
Referenced by renderMap(), and renderPostFx().
|
private |
Referenced by getBlocksInViewRange(), getControl(), renderMap(), and updateDrawList().
Referenced by renderMap(), and updateDrawList().
|
private |
Referenced by renderMap(), and updateDrawList().