Minetest  5.4.0
ClientMap Class Reference

#include <clientmap.h>

+ Inheritance diagram for ClientMap:
+ Collaboration diagram for ClientMap:

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)
 
MapSectoremergeSector (v2s16 p)
 
virtual void OnRegisterSceneNode ()
 
virtual void render ()
 
virtual const aabb3fgetBoundingBox () 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 MapDrawControlgetControl () 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)
 
MapSectorgetSectorNoGenerateNoLock (v2s16 p2d)
 
MapSectorgetSectorNoGenerate (v2s16 p2d)
 
MapBlockgetBlockNoCreate (v3s16 p)
 
MapBlockgetBlockNoCreateNoEx (v3s16 p)
 
virtual MapBlockemergeBlock (v3s16 p, bool create_blank=true)
 
const NodeDefManagergetNodeDefManager ()
 
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< v3s16findNodesWithMetadata (v3s16 p1, v3s16 p2)
 
NodeMetadatagetNodeMetadata (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

Clientm_client
 
aabb3f m_box
 
MapDrawControlm_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< v2s16m_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
IGameDefm_gamedef
 
std::set< MapEventReceiver * > m_event_receivers
 
std::map< v2s16, MapSector * > m_sectors
 
MapSectorm_sector_cache = nullptr
 
v2s16 m_sector_cache_p
 
UniqueQueue< v3s16m_transforming_liquid
 
const NodeDefManagerm_nodedef
 

Constructor & Destructor Documentation

◆ ClientMap()

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.

+ Here is the call graph for this function:

◆ ~ClientMap()

virtual ClientMap::~ClientMap ( )
virtualdefault

Member Function Documentation

◆ drop()

void ClientMap::drop ( )
inlinevirtual

Reimplemented from Map.

Referenced by ClientEnvironment::~ClientEnvironment().

+ Here is the caller graph for this function:

◆ emergeSector()

MapSector * ClientMap::emergeSector ( v2s16  p)
virtual

Reimplemented from Map.

References Map::getSectorNoGenerate(), Map::m_gamedef, and Map::m_sectors.

+ Here is the call graph for this function:

◆ getBackgroundBrightness()

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.

+ Here is the call graph for this function:

◆ getBlocksInViewRange()

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().

+ Here is the caller graph for this function:

◆ getBoundingBox()

virtual const aabb3f& ClientMap::getBoundingBox ( ) const
inlinevirtual

References m_box.

◆ getCameraFov()

f32 ClientMap::getCameraFov ( ) const
inline

References m_camera_fov.

Referenced by Client::sendPlayerPos(), and writePlayerPos().

+ Here is the caller graph for this function:

◆ getControl()

const MapDrawControl& ClientMap::getControl ( ) const
inline

References m_control.

Referenced by Client::sendPlayerPos(), and writePlayerPos().

+ Here is the caller graph for this function:

◆ mapType()

s32 ClientMap::mapType ( ) const
inlinevirtual

Reimplemented from Map.

References MAPTYPE_CLIENT.

◆ OnRegisterSceneNode()

void ClientMap::OnRegisterSceneNode ( )
virtual

◆ PrintInfo()

void ClientMap::PrintInfo ( std::ostream &  out)
virtual

Reimplemented from Map.

◆ render()

virtual void ClientMap::render ( )
inlinevirtual

References renderMap().

+ Here is the call graph for this function:

◆ renderMap()

◆ renderPostFx()

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.

+ Here is the call graph for this function:

◆ updateCamera()

void ClientMap::updateCamera ( const v3f pos,
const v3f dir,
f32  fov,
const v3s16 offset 
)
inline

References dir(), m_camera_direction, m_camera_fov, m_camera_offset, and m_camera_position.

+ Here is the call graph for this function:

◆ updateDrawList()

Member Data Documentation

◆ m_box

aabb3f ClientMap::m_box
private
Initial value:
= aabb3f(-BS * 1000000, -BS * 1000000, -BS * 1000000,
BS * 1000000, BS * 1000000, BS * 1000000)
#define BS
Definition: constants.h:74
core::aabbox3d< f32 > aabb3f
Definition: irr_aabb3d.h:26

Referenced by ClientMap(), and getBoundingBox().

◆ m_cache_anistropic_filter

bool ClientMap::m_cache_anistropic_filter
private

Referenced by ClientMap(), and renderMap().

◆ m_cache_bilinear_filter

bool ClientMap::m_cache_bilinear_filter
private

Referenced by ClientMap(), and renderMap().

◆ m_cache_trilinear_filter

bool ClientMap::m_cache_trilinear_filter
private

Referenced by ClientMap(), and renderMap().

◆ m_camera_direction

v3f ClientMap::m_camera_direction = v3f(0,0,1)
private

◆ m_camera_fov

f32 ClientMap::m_camera_fov = M_PI
private

◆ m_camera_offset

v3s16 ClientMap::m_camera_offset
private

Referenced by renderMap(), and updateCamera().

◆ m_camera_position

v3f ClientMap::m_camera_position = v3f(0,0,0)
private

◆ m_client

Client* ClientMap::m_client
private

Referenced by renderMap(), and renderPostFx().

◆ m_control

MapDrawControl& ClientMap::m_control
private

◆ m_drawlist

std::map<v3s16, MapBlock*> ClientMap::m_drawlist
private

Referenced by renderMap(), and updateDrawList().

◆ m_last_drawn_sectors

std::set<v2s16> ClientMap::m_last_drawn_sectors
private

Referenced by renderMap(), and updateDrawList().


The documentation for this class was generated from the following files: