#include <localplayer.h>
|
| LocalPlayer (Client *client, const std::string &name) |
|
virtual | ~LocalPlayer () |
|
void | move (f32 dtime, Environment *env, f32 pos_max_d) |
|
void | move (f32 dtime, Environment *env, f32 pos_max_d, std::vector< CollisionInfo > *collision_info) |
|
void | old_move (f32 dtime, Environment *env, f32 pos_max_d, std::vector< CollisionInfo > *collision_info) |
|
void | applyControl (float dtime, Environment *env) |
|
v3s16 | getStandingNodePos () |
|
v3s16 | getFootstepNodePos () |
|
GenericCAO * | getCAO () const |
|
ClientActiveObject * | getParent () const |
|
void | setCAO (GenericCAO *toset) |
|
u32 | maxHudId () const |
|
u16 | getBreath () const |
|
void | setBreath (u16 breath) |
|
v3s16 | getLightPosition () const |
|
void | setYaw (f32 yaw) |
|
f32 | getYaw () const |
|
void | setPitch (f32 pitch) |
|
f32 | getPitch () const |
|
void | setPosition (const v3f &position) |
|
void | addPosition (const v3f &added_pos) |
|
v3f | getPosition () const |
|
v3f | getEyePosition () const |
|
v3f | getEyeOffset () const |
|
void | setEyeHeight (float eye_height) |
|
void | setCollisionbox (const aabb3f &box) |
|
const aabb3f & | getCollisionbox () const |
|
float | getZoomFOV () const |
|
void | setZoomFOV (float zoom_fov) |
|
bool | getAutojump () const |
|
bool | isDead () const |
|
void | addVelocity (const v3f &vel) |
|
Lighting & | getLighting () |
|
PlayerSettings & | getPlayerSettings () |
|
| Player (const std::string &name, IItemDefManager *idef) |
|
virtual | ~Player ()=0 |
|
| DISABLE_CLASS_COPY (Player) |
|
void | setSpeed (v3f speed) |
|
v3f | getSpeed () const |
|
const std::string & | getName () const |
|
u32 | getFreeHudID () |
|
const PlayerControl & | getPlayerControl () |
|
ItemStack & | getWieldedItem (ItemStack *selected, ItemStack *hand) const |
|
void | setWieldIndex (u16 index) |
|
u16 | getWieldIndex () |
|
bool | setFov (const PlayerFovSpec &spec) |
|
const PlayerFovSpec & | getFov () const |
|
HudElement * | getHud (u32 id) |
|
void | hudApply (std::function< void(const std::vector< HudElement * > &)> f) |
|
u32 | addHud (HudElement *hud) |
|
HudElement * | removeHud (u32 id) |
|
void | clearHud () |
|
u16 | getMaxHotbarItemcount () |
|
|
void | accelerate (const v3f &target_speed, const f32 max_increase_H, const f32 max_increase_V, const bool use_pitch) |
|
bool | updateSneakNode (Map *map, const v3f &position, const v3f &sneak_max) |
|
float | getSlipFactor (Environment *env, const v3f &speedH) |
|
void | handleAutojump (f32 dtime, Environment *env, const collisionMoveResult &result, const v3f &position_before_move, const v3f &speed_before_move, f32 pos_max_d) |
|
◆ LocalPlayer()
LocalPlayer::LocalPlayer |
( |
Client * | client, |
|
|
const std::string & | name ) |
◆ ~LocalPlayer()
LocalPlayer::~LocalPlayer |
( |
| ) |
|
|
virtual |
◆ accelerate()
void LocalPlayer::accelerate |
( |
const v3f & | target_speed, |
|
|
const f32 | max_increase_H, |
|
|
const f32 | max_increase_V, |
|
|
const bool | use_pitch ) |
|
private |
◆ addPosition()
void LocalPlayer::addPosition |
( |
const v3f & | added_pos | ) |
|
|
inline |
◆ addVelocity()
void LocalPlayer::addVelocity |
( |
const v3f & | vel | ) |
|
|
inline |
◆ applyControl()
void LocalPlayer::applyControl |
( |
float | dtime, |
|
|
Environment * | env ) |
References accelerate(), PlayerPhysicsOverride::acceleration_air, PlayerPhysicsOverride::acceleration_default, PlayerPhysicsOverride::acceleration_fast, PlayerSettings::always_fly_fast, PlayerControl::aux1, PlayerSettings::aux1_descends, BS, Client::checkLocalPrivilege(), Player::control, PlayerSettings::fast_move, PlayerSettings::free_move, Client::getEventManager(), getParent(), getPlayerSettings(), getSlipFactor(), Player::getSpeed(), in_liquid, in_liquid_stable, is_climbing, PlayerControl::jump, PlayerPhysicsOverride::jump, m_autojump, m_autojump_time, m_can_jump, m_client, m_disable_descend, m_disable_jump, Player::movement_acceleration_air, Player::movement_acceleration_default, Player::movement_acceleration_fast, PlayerControl::movement_direction, PlayerControl::movement_speed, Player::movement_speed_climb, Player::movement_speed_crouch, Player::movement_speed_fast, Player::movement_speed_jump, Player::movement_speed_walk, Player::physics_override, PlayerControl::pitch, PlayerSettings::pitch_move, MtEvent::PLAYER_JUMP, MtEventManager::put(), setPitch(), Player::setSpeed(), setYaw(), PlayerControl::sneak, PlayerPhysicsOverride::speed, PlayerPhysicsOverride::speed_climb, PlayerPhysicsOverride::speed_crouch, PlayerPhysicsOverride::speed_fast, PlayerPhysicsOverride::speed_walk, swimming_pitch, swimming_vertical, touching_ground, and PlayerControl::yaw.
Referenced by ClientEnvironment::step().
◆ getAutojump()
bool LocalPlayer::getAutojump |
( |
| ) |
const |
|
inline |
◆ getBreath()
u16 LocalPlayer::getBreath |
( |
| ) |
const |
|
inline |
◆ getCAO()
◆ getCollisionbox()
const aabb3f & LocalPlayer::getCollisionbox |
( |
| ) |
const |
|
inline |
◆ getEyeOffset()
v3f LocalPlayer::getEyeOffset |
( |
| ) |
const |
◆ getEyePosition()
v3f LocalPlayer::getEyePosition |
( |
| ) |
const |
|
inline |
◆ getFootstepNodePos()
v3s16 LocalPlayer::getFootstepNodePos |
( |
| ) |
|
◆ getLighting()
◆ getLightPosition()
v3s16 LocalPlayer::getLightPosition |
( |
| ) |
const |
◆ getParent()
◆ getPitch()
f32 LocalPlayer::getPitch |
( |
| ) |
const |
|
inline |
◆ getPlayerSettings()
◆ getPosition()
v3f LocalPlayer::getPosition |
( |
| ) |
const |
|
inline |
References m_position.
Referenced by add_object_boxes(), Client::CSMClampPos(), Client::CSMClampRadius(), Client::CSMGetNode(), Hud::drawLuaElements(), getFootstepNodePos(), LuaLocalPlayer::l_get_pos(), move(), old_move(), Game::processPlayerInteraction(), Client::sendPlayerPos(), ParticleSpawner::spawnParticle(), GenericCAO::step(), Camera::update(), GameUI::update(), Game::updateFrame(), and writePlayerPos().
◆ getSlipFactor()
float LocalPlayer::getSlipFactor |
( |
Environment * | env, |
|
|
const v3f & | speedH ) |
|
private |
◆ getStandingNodePos()
v3s16 LocalPlayer::getStandingNodePos |
( |
| ) |
|
◆ getYaw()
f32 LocalPlayer::getYaw |
( |
| ) |
const |
|
inline |
◆ getZoomFOV()
float LocalPlayer::getZoomFOV |
( |
| ) |
const |
|
inline |
◆ handleAutojump()
void LocalPlayer::handleAutojump |
( |
f32 | dtime, |
|
|
Environment * | env, |
|
|
const collisionMoveResult & | result, |
|
|
const v3f & | position_before_move, |
|
|
const v3f & | speed_before_move, |
|
|
f32 | pos_max_d ) |
|
private |
References PlayerSettings::autojump, BS, COLLISION_NODE, collisionMoveSimple(), collisionMoveResult::collisions, CONTENT_IGNORE, Player::control, floatToInt(), NodeDefManager::get(), MapNode::getContent(), Environment::getGameDef(), Environment::getMap(), Map::getNode(), getPlayerSettings(), gravity, PlayerControl::isMoving(), PlayerControl::jump, PlayerPhysicsOverride::jump, m_autojump, m_autojump_time, m_can_jump, m_cao, m_client, m_collisionbox, m_position, Player::movement_speed_jump, IGameDef::ndef(), Player::physics_override, PlayerControl::sneak, and ContentFeatures::walkable.
Referenced by move(), and old_move().
◆ isDead()
bool LocalPlayer::isDead |
( |
| ) |
const |
◆ maxHudId()
u32 LocalPlayer::maxHudId |
( |
| ) |
const |
|
inline |
◆ move() [1/2]
void LocalPlayer::move |
( |
f32 | dtime, |
|
|
Environment * | env, |
|
|
f32 | pos_max_d ) |
|
virtual |
◆ move() [2/2]
Reimplemented from Player.
References BS, camera_impact, Client::checkLocalPrivilege(), ContentFeatures::climbable, collisionMoveResult::collides, COLLISION_AXIS_Y, collision_check_intersection(), COLLISION_NODE, collisionMoveSimple(), collisionMoveResult::collisions, Player::control, floatToInt(), PlayerSettings::free_move, NodeDefManager::get(), MapNode::getContent(), Client::getEventManager(), Environment::getMap(), Map::getNode(), getParent(), getPlayerSettings(), GenericCAO::getPosition(), getPosition(), Player::getSpeed(), GenericCAO::getStepHeight(), gravity, ContentFeatures::groups, handleAutojump(), in_liquid, in_liquid_stable, intToFloat(), is_climbing, itemgroup_get(), PlayerControl::jump, PlayerPhysicsOverride::jump, ContentFeatures::liquid_move_physics, m_added_velocity, m_can_jump, m_cao, m_client, m_collisionbox, m_disable_descend, m_disable_jump, m_position, m_sneak_ladder_detected, m_sneak_node, m_sneak_node_bb_top, m_sneak_node_exists, Player::m_speed, m_standing_node, ContentFeatures::move_resistance, move_resistance, Player::movement_speed_jump, IGameDef::ndef(), PlayerPhysicsOverride::new_move, CollisionInfo::new_speed, PlayerSettings::noclip, CollisionInfo::node_p, old_move(), CollisionInfo::old_speed, Player::physics_override, MtEvent::PLAYER_REGAIN_GROUND, MtEventManager::put(), rangelim, sanity_check, setPosition(), Player::setSpeed(), PlayerControl::sneak, PlayerPhysicsOverride::sneak, PlayerPhysicsOverride::sneak_glitch, collisionMoveResult::standing_on_object, collisionMoveResult::touching_ground, touching_ground, and updateSneakNode().
◆ old_move()
void LocalPlayer::old_move |
( |
f32 | dtime, |
|
|
Environment * | env, |
|
|
f32 | pos_max_d, |
|
|
std::vector< CollisionInfo > * | collision_info ) |
References BS, camera_impact, Client::checkLocalPrivilege(), ContentFeatures::climbable, collisionMoveResult::collides, COLLISION_AXIS_Y, collisionMoveSimple(), collisionMoveResult::collisions, Player::control, floatToInt(), PlayerSettings::free_move, NodeDefManager::get(), MapNode::getCollisionBoxes(), MapNode::getContent(), Client::getEventManager(), Environment::getMap(), Map::getNode(), getParent(), getPlayerSettings(), GenericCAO::getPosition(), getPosition(), Player::getSpeed(), getStandingNodePos(), gravity, ContentFeatures::groups, handleAutojump(), in_liquid, in_liquid_stable, intToFloat(), is_climbing, itemgroup_get(), PlayerControl::jump, PlayerPhysicsOverride::jump, ContentFeatures::liquid_move_physics, m_added_velocity, m_can_jump, m_cao, m_client, m_collisionbox, m_disable_descend, m_disable_jump, m_need_to_get_new_sneak_node, m_old_node_below, m_old_node_below_type, m_position, m_sneak_node, m_sneak_node_bb_ymax, m_sneak_node_exists, Player::m_speed, m_standing_node, ContentFeatures::move_resistance, move_resistance, Player::movement_speed_jump, MYMAX, ContentFeatures::name, IGameDef::ndef(), PlayerSettings::noclip, p(), Player::physics_override, MtEvent::PLAYER_REGAIN_GROUND, MtEventManager::put(), rangelim, sanity_check, setPosition(), Player::setSpeed(), PlayerControl::sneak, PlayerPhysicsOverride::sneak, PlayerPhysicsOverride::sneak_glitch, collisionMoveResult::standing_on_object, collisionMoveResult::touching_ground, touching_ground, and ContentFeatures::walkable.
Referenced by move().
◆ setBreath()
void LocalPlayer::setBreath |
( |
u16 | breath | ) |
|
|
inline |
◆ setCAO()
◆ setCollisionbox()
void LocalPlayer::setCollisionbox |
( |
const aabb3f & | box | ) |
|
|
inline |
◆ setEyeHeight()
void LocalPlayer::setEyeHeight |
( |
float | eye_height | ) |
|
|
inline |
◆ setPitch()
void LocalPlayer::setPitch |
( |
f32 | pitch | ) |
|
|
inline |
◆ setPosition()
void LocalPlayer::setPosition |
( |
const v3f & | position | ) |
|
|
inline |
◆ setYaw()
void LocalPlayer::setYaw |
( |
f32 | yaw | ) |
|
|
inline |
◆ setZoomFOV()
void LocalPlayer::setZoomFOV |
( |
float | zoom_fov | ) |
|
|
inline |
◆ updateSneakNode()
bool LocalPlayer::updateSneakNode |
( |
Map * | map, |
|
|
const v3f & | position, |
|
|
const v3f & | sneak_max ) |
|
private |
References BS, floatToInt(), NodeDefManager::get(), MapNode::getCollisionBoxes(), Map::getNode(), getNodeBoundingBox(), intToFloat(), m_client, m_collisionbox, m_sneak_ladder_detected, m_sneak_node, m_sneak_node_bb_top, m_sneak_node_exists, IGameDef::ndef(), p(), Player::physics_override, PlayerPhysicsOverride::sneak_glitch, and ContentFeatures::walkable.
Referenced by move().
◆ camera_impact
float LocalPlayer::camera_impact = 0.0f |
◆ gravity
f32 LocalPlayer::gravity = 0 |
◆ hotbar_image
std::string LocalPlayer::hotbar_image = "" |
◆ hotbar_selected_image
std::string LocalPlayer::hotbar_selected_image = "" |
◆ hp
◆ hurt_tilt_strength
float LocalPlayer::hurt_tilt_strength = 0.0f |
◆ hurt_tilt_timer
float LocalPlayer::hurt_tilt_timer = 0.0f |
◆ in_liquid
bool LocalPlayer::in_liquid = false |
◆ in_liquid_stable
bool LocalPlayer::in_liquid_stable = false |
◆ is_climbing
bool LocalPlayer::is_climbing = false |
◆ last_animation
◆ last_animation_speed
float LocalPlayer::last_animation_speed = 0.0f |
◆ last_camera_fov
u8 LocalPlayer::last_camera_fov = 0 |
◆ last_camera_inverted
bool LocalPlayer::last_camera_inverted = false |
◆ last_keyPressed
u32 LocalPlayer::last_keyPressed = 0 |
◆ last_movement_dir
f32 LocalPlayer::last_movement_dir = 0.0f |
◆ last_movement_speed
f32 LocalPlayer::last_movement_speed = 0.0f |
◆ last_pitch
float LocalPlayer::last_pitch = 0.0f |
◆ last_position
v3f LocalPlayer::last_position |
◆ last_speed
v3f LocalPlayer::last_speed |
◆ last_wanted_range
u8 LocalPlayer::last_wanted_range = 0 |
◆ last_yaw
float LocalPlayer::last_yaw = 0.0f |
◆ light_color
video::SColor LocalPlayer::light_color = video::SColor(255, 255, 255, 255) |
◆ m_added_velocity
v3f LocalPlayer::m_added_velocity = v3f(0.0f) |
|
private |
◆ m_autojump
bool LocalPlayer::m_autojump = false |
|
private |
◆ m_autojump_time
float LocalPlayer::m_autojump_time = 0.0f |
|
private |
◆ m_breath
◆ m_can_jump
bool LocalPlayer::m_can_jump = false |
|
private |
◆ m_cao
◆ m_client
◆ m_collisionbox
aabb3f LocalPlayer::m_collisionbox |
|
private |
◆ m_disable_descend
bool LocalPlayer::m_disable_descend = false |
|
private |
◆ m_disable_jump
bool LocalPlayer::m_disable_jump = false |
|
private |
◆ m_eye_height
float LocalPlayer::m_eye_height = 1.625f |
|
private |
◆ m_lighting
◆ m_need_to_get_new_sneak_node
bool LocalPlayer::m_need_to_get_new_sneak_node = true |
|
private |
◆ m_old_node_below
v3s16 LocalPlayer::m_old_node_below = v3s16(32767, 32767, 32767) |
|
private |
◆ m_old_node_below_type
std::string LocalPlayer::m_old_node_below_type = "air" |
|
private |
◆ m_pitch
f32 LocalPlayer::m_pitch = 0.0f |
|
private |
◆ m_player_settings
◆ m_position
v3f LocalPlayer::m_position |
|
private |
◆ m_sneak_ladder_detected
bool LocalPlayer::m_sneak_ladder_detected = false |
|
private |
◆ m_sneak_node
v3s16 LocalPlayer::m_sneak_node = v3s16(32767, 32767, 32767) |
|
private |
◆ m_sneak_node_bb_top
aabb3f LocalPlayer::m_sneak_node_bb_top = aabb3f(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f) |
|
private |
◆ m_sneak_node_bb_ymax
f32 LocalPlayer::m_sneak_node_bb_ymax = 0.0f |
|
private |
◆ m_sneak_node_exists
bool LocalPlayer::m_sneak_node_exists = false |
|
private |
◆ m_standing_node
v3s16 LocalPlayer::m_standing_node |
|
private |
◆ m_yaw
f32 LocalPlayer::m_yaw = 0.0f |
|
private |
◆ m_zoom_fov
float LocalPlayer::m_zoom_fov = 0.0f |
|
private |
◆ makes_footstep_sound
bool LocalPlayer::makes_footstep_sound = true |
◆ move_resistance
u8 LocalPlayer::move_resistance = 0 |
◆ swimming_pitch
bool LocalPlayer::swimming_pitch = false |
◆ swimming_vertical
bool LocalPlayer::swimming_vertical = false |
◆ touching_ground
bool LocalPlayer::touching_ground = false |
The documentation for this class was generated from the following files: