#include <localplayer.h>
|
| LocalPlayer (Client *client, const char *name) |
|
virtual | ~LocalPlayer ()=default |
|
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) |
|
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) |
|
| Player (const char *name, IItemDefManager *idef) |
|
virtual | ~Player ()=0 |
|
| DISABLE_CLASS_COPY (Player) |
|
const v3f & | getSpeed () const |
|
void | setSpeed (const v3f &speed) |
|
const char * | getName () const |
|
u32 | getFreeHudID () |
|
const PlayerControl & | getPlayerControl () |
|
PlayerSettings & | getPlayerSettings () |
|
ItemStack & | getWieldedItem (ItemStack *selected, ItemStack *hand) const |
|
void | setWieldIndex (u16 index) |
|
u16 | getWieldIndex () const |
|
void | setFov (const PlayerFovSpec &spec) |
|
const PlayerFovSpec & | getFov () const |
|
HudElement * | getHud (u32 id) |
|
u32 | addHud (HudElement *hud) |
|
HudElement * | removeHud (u32 id) |
|
void | clearHud () |
|
|
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 char * |
name |
|
) |
| |
◆ ~LocalPlayer()
virtual LocalPlayer::~LocalPlayer |
( |
| ) |
|
|
virtualdefault |
◆ accelerate()
void LocalPlayer::accelerate |
( |
const v3f & |
target_speed, |
|
|
const f32 |
max_increase_H, |
|
|
const f32 |
max_increase_V, |
|
|
const bool |
use_pitch |
|
) |
| |
|
private |
◆ addVelocity()
void LocalPlayer::addVelocity |
( |
const v3f & |
vel | ) |
|
|
inline |
◆ applyControl()
void LocalPlayer::applyControl |
( |
float |
dtime, |
|
|
Environment * |
env |
|
) |
| |
References accelerate(), PlayerSettings::always_fly_fast, PlayerControl::aux1, PlayerSettings::aux1_descends, BS, Client::checkLocalPrivilege(), Player::control, PlayerControl::down, PlayerSettings::fast_move, PlayerControl::forw_move_joystick_axis, PlayerSettings::free_move, Client::getEventManager(), getParent(), Player::getPlayerSettings(), getSlipFactor(), Player::getSpeed(), in_liquid, in_liquid_stable, is_climbing, PlayerControl::jump, PlayerControl::left, m_autojump, m_autojump_time, m_can_jump, m_client, m_disable_jump, Player::movement_acceleration_air, Player::movement_acceleration_default, Player::movement_acceleration_fast, Player::movement_speed_climb, Player::movement_speed_crouch, Player::movement_speed_fast, Player::movement_speed_jump, Player::movement_speed_walk, physics_override_jump, physics_override_speed, PlayerControl::pitch, PlayerSettings::pitch_move, MtEvent::PLAYER_JUMP, MtEventManager::put(), PlayerControl::right, setPitch(), Player::setSpeed(), setYaw(), PlayerControl::sidew_move_joystick_axis, PlayerControl::sneak, swimming_pitch, swimming_vertical, touching_ground, PlayerControl::up, 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 |
( |
| ) |
|
◆ getLightPosition()
v3s16 LocalPlayer::getLightPosition |
( |
| ) |
const |
◆ getParent()
◆ getPitch()
f32 LocalPlayer::getPitch |
( |
| ) |
const |
|
inline |
◆ getPosition()
v3f LocalPlayer::getPosition |
( |
| ) |
const |
|
inline |
References m_position.
Referenced by collisionMoveSimple(), Client::CSMClampPos(), Client::CSMClampRadius(), Client::CSMGetNode(), Hud::drawLuaElements(), getFootstepNodePos(), LuaLocalPlayer::l_get_pos(), move(), old_move(), Game::processPlayerInteraction(), Client::sendPlayerPos(), ParticleSpawner::spawnParticle(), GenericCAO::step(), GameUI::update(), Camera::update(), Game::updateFrame(), Particle::updateVertices(), 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, PlayerControl::down, floatToInt(), PlayerControl::forw_move_joystick_axis, NodeDefManager::get(), MapNode::getContent(), Environment::getGameDef(), Environment::getMap(), Map::getNode(), Player::getPlayerSettings(), PlayerControl::jump, m_autojump, m_autojump_time, m_can_jump, m_client, m_collisionbox, m_position, IGameDef::ndef(), PlayerControl::sneak, PlayerControl::up, 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 added_velocity, BS, camera_barely_in_ceiling, camera_impact, Client::checkLocalPrivilege(), ContentFeatures::climbable, COLLISION_AXIS_Y, COLLISION_NODE, collisionMoveSimple(), collisionMoveResult::collisions, CONTENT_IGNORE, Player::control, floatToInt(), PlayerSettings::free_move, NodeDefManager::get(), MapNode::getContent(), Client::getEventManager(), getEyePosition(), Environment::getMap(), Map::getNode(), getParent(), Player::getPlayerSettings(), GenericCAO::getPosition(), getPosition(), Player::getSpeed(), GenericCAO::getStepHeight(), ContentFeatures::groups, handleAutojump(), in_liquid, in_liquid_stable, intToFloat(), is_climbing, ContentFeatures::isLiquid(), itemgroup_get(), PlayerControl::jump, liquid_viscosity, ContentFeatures::liquid_viscosity, m_can_jump, m_cao, m_client, m_collisionbox, 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, Player::movement_speed_jump, IGameDef::ndef(), CollisionInfo::new_speed, PlayerSettings::noclip, CollisionInfo::node_p, old_move(), CollisionInfo::old_speed, physics_override_jump, physics_override_new_move, physics_override_sneak, physics_override_sneak_glitch, MtEvent::PLAYER_REGAIN_GROUND, MtEventManager::put(), rangelim, sanity_check, setPosition(), Player::setSpeed(), PlayerControl::sneak, ContentFeatures::solidness, collisionMoveResult::standing_on_object, touching_ground, collisionMoveResult::touching_ground, updateSneakNode(), and ContentFeatures::walkable.
◆ old_move()
void LocalPlayer::old_move |
( |
f32 |
dtime, |
|
|
Environment * |
env, |
|
|
f32 |
pos_max_d, |
|
|
std::vector< CollisionInfo > * |
collision_info |
|
) |
| |
References added_velocity, BS, camera_barely_in_ceiling, camera_impact, Client::checkLocalPrivilege(), ContentFeatures::climbable, collisionMoveSimple(), collisionMoveResult::collisions, CONTENT_IGNORE, Player::control, floatToInt(), PlayerSettings::free_move, NodeDefManager::get(), MapNode::getCollisionBoxes(), MapNode::getContent(), Client::getEventManager(), getEyePosition(), Environment::getMap(), Map::getNode(), getParent(), Player::getPlayerSettings(), GenericCAO::getPosition(), getPosition(), Player::getSpeed(), getStandingNodePos(), ContentFeatures::groups, handleAutojump(), in_liquid, in_liquid_stable, intToFloat(), is_climbing, ContentFeatures::isLiquid(), itemgroup_get(), PlayerControl::jump, liquid_viscosity, ContentFeatures::liquid_viscosity, m_can_jump, m_cao, m_client, m_collisionbox, 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, Player::movement_speed_jump, MYMAX, ContentFeatures::name, IGameDef::ndef(), PlayerSettings::noclip, p(), physics_override_jump, physics_override_sneak, physics_override_sneak_glitch, MtEvent::PLAYER_REGAIN_GROUND, MtEventManager::put(), rangelim, sanity_check, setPosition(), Player::setSpeed(), PlayerControl::sneak, ContentFeatures::solidness, collisionMoveResult::standing_on_object, touching_ground, collisionMoveResult::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(), physics_override_sneak_glitch, and ContentFeatures::walkable.
Referenced by move().
◆ added_velocity
v3f LocalPlayer::added_velocity = v3f(0.0f) |
|
private |
◆ camera_barely_in_ceiling
bool LocalPlayer::camera_barely_in_ceiling = false |
|
private |
◆ camera_impact
float LocalPlayer::camera_impact = 0.0f |
◆ 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
int LocalPlayer::last_animation = NO_ANIM |
◆ last_animation_speed
float LocalPlayer::last_animation_speed = 0.0f |
◆ last_camera_fov
u8 LocalPlayer::last_camera_fov = 0 |
◆ last_keyPressed
unsigned int LocalPlayer::last_keyPressed = 0 |
◆ 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) |
◆ liquid_viscosity
u8 LocalPlayer::liquid_viscosity = 0 |
◆ 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_jump
bool LocalPlayer::m_disable_jump = false |
|
private |
◆ m_eye_height
float LocalPlayer::m_eye_height = 1.625f |
|
private |
◆ 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_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 |
◆ physics_override_gravity
float LocalPlayer::physics_override_gravity = 1.0f |
◆ physics_override_jump
float LocalPlayer::physics_override_jump = 1.0f |
◆ physics_override_new_move
bool LocalPlayer::physics_override_new_move = true |
◆ physics_override_sneak
bool LocalPlayer::physics_override_sneak = true |
◆ physics_override_sneak_glitch
bool LocalPlayer::physics_override_sneak_glitch = false |
◆ physics_override_speed
float LocalPlayer::physics_override_speed = 1.0f |
◆ 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: