#include <environment.h>
◆ Environment()
Environment::Environment |
( |
IGameDef * | gamedef | ) |
|
References g_settings, Settings::getBool(), Settings::getFloat(), Settings::getU32(), m_cache_abm_interval, m_cache_abm_time_budget, m_cache_active_block_mgmt_interval, m_cache_enable_shaders, m_cache_nodetimer_interval, m_time_of_day, and m_time_of_day_f.
◆ ~Environment()
virtual Environment::~Environment |
( |
| ) |
|
|
virtualdefault |
◆ continueRaycast()
Returns the next node or object the shootline meets.
- Parameters
-
state | current state of the raycast |
- Returns
- output, will contain the next pointed thing
References PointedThing::box_id, boxLineCollision(), BS, PointedThing::distanceSq, floatToInt(), voxalgo::VoxelLineIterator::getIndex(), getMap(), MapNode::getNeighbors(), Map::getNode(), Map::getNodeDefManager(), getSelectedActiveObjects(), MapNode::getSelectionBoxes(), NodeDefManager::getSelectionBoxIntUnion(), PointedThing::intersection_normal, PointedThing::intersection_point, intToFloat(), isPointableNode(), voxalgo::VoxelLineIterator::m_current_index, voxalgo::VoxelLineIterator::m_current_node_pos, RaycastState::m_found, RaycastState::m_initialization_needed, RaycastState::m_iterator, voxalgo::VoxelLineIterator::m_last_index, RaycastState::m_liquids_pointable, RaycastState::m_objects_pointable, RaycastState::m_pointabilities, RaycastState::m_previous_node, RaycastState::m_search_range, RaycastState::m_shootline, voxalgo::VoxelLineIterator::next(), PointedThing::node_abovesurface, PointedThing::node_real_undersurface, PointedThing::node_undersurface, PointedThing::pointability, POINTABLE_BLOCKING, POINTABLE_NOT, POINTEDTHING_NODE, POINTEDTHING_NOTHING, S16_MAX, and PointedThing::type.
Referenced by Game::updatePointedThing().
◆ DISABLE_CLASS_COPY()
◆ getDayCount()
u32 Environment::getDayCount |
( |
| ) |
|
◆ getDayNightRatio()
u32 Environment::getDayNightRatio |
( |
| ) |
|
References m_cache_enable_shaders, m_day_night_ratio_override, m_enable_day_night_ratio_override, m_time_lock, m_time_of_day_f, and time_to_daynight_ratio().
Referenced by SmokePuffCSO::SmokePuffCSO(), ClientEnvironment::addActiveObject(), GameGlobalShaderConstantSetter::onSetConstants(), ClientMap::renderMap(), ClientEnvironment::step(), and Particle::updateLight().
◆ getGameDef()
◆ getMap()
virtual Map & Environment::getMap |
( |
| ) |
|
|
pure virtual |
Implemented in ClientEnvironment, and ServerEnvironment.
Referenced by add_area_node_boxes(), continueRaycast(), LocalPlayer::getSlipFactor(), LocalPlayer::handleAutojump(), ModApiMapgen::l_create_schematic(), ModApiClient::l_get_meta(), line_of_sight(), LocalPlayer::move(), ScriptApiNode::node_on_receive_fields(), ScriptApiNodemeta::nodemeta_inventory_AllowMove(), ScriptApiNodemeta::nodemeta_inventory_AllowPut(), ScriptApiNodemeta::nodemeta_inventory_AllowTake(), ScriptApiNodemeta::nodemeta_inventory_OnMove(), ScriptApiNodemeta::nodemeta_inventory_OnPut(), ScriptApiNodemeta::nodemeta_inventory_OnTake(), LocalPlayer::old_move(), and LuaVoxelManip::packOut().
◆ getSelectedActiveObjects()
virtual void Environment::getSelectedActiveObjects |
( |
const core::line3d< f32 > & | shootline_on_map, |
|
|
std::vector< PointedThing > & | objects, |
|
|
const std::optional< Pointabilities > & | pointabilities ) |
|
pure virtual |
Gets the objects pointed by the shootline as pointed things. If this is a client environment, the local player won't be returned.
- Parameters
-
[in] | shootline_on_map | the shootline for the test in world coordinates |
[out] | objects | found objects |
Implemented in ClientEnvironment, and ServerEnvironment.
Referenced by continueRaycast().
◆ getTimeOfDay()
u32 Environment::getTimeOfDay |
( |
| ) |
|
◆ getTimeOfDayF()
float Environment::getTimeOfDayF |
( |
| ) |
|
◆ line_of_sight()
bool Environment::line_of_sight |
( |
v3f | pos1, |
|
|
v3f | pos2, |
|
|
v3s16 * | p = nullptr ) |
Returns false if the given line intersects with a non-air node, true otherwise.
- Parameters
-
pos1 | start of the line |
pos2 | end of the line |
p | output, position of the first non-air node the line intersects |
References BS, CONTENT_AIR, getMap(), Map::getNode(), voxalgo::VoxelLineIterator::m_current_index, voxalgo::VoxelLineIterator::m_current_node_pos, voxalgo::VoxelLineIterator::m_last_index, voxalgo::VoxelLineIterator::next(), p(), and MapNode::param0.
◆ setDayNightRatioOverride()
void Environment::setDayNightRatioOverride |
( |
bool | enable, |
|
|
u32 | value ) |
◆ setTimeOfDay()
void Environment::setTimeOfDay |
( |
u32 | time | ) |
|
|
virtual |
◆ setTimeOfDaySpeed()
void Environment::setTimeOfDaySpeed |
( |
float | speed | ) |
|
◆ step()
virtual void Environment::step |
( |
f32 | dtime | ) |
|
|
pure virtual |
◆ stepTimeOfDay()
void Environment::stepTimeOfDay |
( |
float | dtime | ) |
|
◆ m_added_objects
u32 Environment::m_added_objects |
◆ m_cache_abm_interval
float Environment::m_cache_abm_interval |
|
protected |
◆ m_cache_abm_time_budget
float Environment::m_cache_abm_time_budget |
|
protected |
◆ m_cache_active_block_mgmt_interval
float Environment::m_cache_active_block_mgmt_interval |
|
protected |
◆ m_cache_enable_shaders
bool Environment::m_cache_enable_shaders |
|
protected |
◆ m_cache_nodetimer_interval
float Environment::m_cache_nodetimer_interval |
|
protected |
◆ m_day_count
std::atomic<u32> Environment::m_day_count |
|
protected |
◆ m_day_night_ratio_override
u32 Environment::m_day_night_ratio_override = 0.0f |
|
protected |
◆ m_enable_day_night_ratio_override
bool Environment::m_enable_day_night_ratio_override = false |
|
protected |
◆ m_gamedef
◆ m_time_conversion_skew
float Environment::m_time_conversion_skew = 0.0f |
|
protected |
◆ m_time_lock
std::mutex Environment::m_time_lock |
|
private |
◆ m_time_of_day
u32 Environment::m_time_of_day |
|
protected |
◆ m_time_of_day_f
float Environment::m_time_of_day_f |
|
protected |
◆ m_time_of_day_speed
std::atomic<float> Environment::m_time_of_day_speed |
|
protected |
The documentation for this class was generated from the following files: