Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
PlayerControl Struct Reference

#include <player.h>

Public Member Functions

 PlayerControl ()=default
 
 PlayerControl (bool a_up, bool a_down, bool a_left, bool a_right, bool a_jump, bool a_aux1, bool a_sneak, bool a_zoom, bool a_dig, bool a_place, float a_pitch, float a_yaw, float a_movement_speed, float a_movement_direction)
 
void setMovementFromKeys ()
 
u32 getKeysPressed () const
 
bool isMoving () const
 
void unpackKeysPressed (u32 keypress_bits)
 
v2f getMovement () const
 

Public Attributes

u8 direction_keys = 0
 
bool jump = false
 
bool aux1 = false
 
bool sneak = false
 
bool zoom = false
 
bool dig = false
 
bool place = false
 
float pitch = 0.0f
 
float yaw = 0.0f
 
float movement_speed = 0.0f
 
float movement_direction = 0.0f
 

Constructor & Destructor Documentation

◆ PlayerControl() [1/2]

PlayerControl::PlayerControl ( )
default

◆ PlayerControl() [2/2]

PlayerControl::PlayerControl ( bool a_up,
bool a_down,
bool a_left,
bool a_right,
bool a_jump,
bool a_aux1,
bool a_sneak,
bool a_zoom,
bool a_dig,
bool a_place,
float a_pitch,
float a_yaw,
float a_movement_speed,
float a_movement_direction )
inline

Member Function Documentation

◆ getKeysPressed()

u32 PlayerControl::getKeysPressed ( ) const

References aux1, dig, direction_keys, isMoving(), jump, movement_direction, place, sneak, and zoom.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMovement()

v2f PlayerControl::getMovement ( ) const

References movement_direction, and movement_speed.

Referenced by LuaLocalPlayer::l_get_control(), and ObjectRef::l_get_player_control().

+ Here is the caller graph for this function:

◆ isMoving()

bool PlayerControl::isMoving ( ) const
inline

References movement_speed.

Referenced by getKeysPressed(), and LocalPlayer::handleAutojump().

+ Here is the caller graph for this function:

◆ setMovementFromKeys()

void PlayerControl::setMovementFromKeys ( )

References direction_keys, movement_direction, and movement_speed.

Referenced by Server::process_PlayerPos(), and Game::updatePlayerControl().

+ Here is the caller graph for this function:

◆ unpackKeysPressed()

void PlayerControl::unpackKeysPressed ( u32 keypress_bits)

References aux1, dig, direction_keys, jump, place, sneak, and zoom.

Referenced by Server::process_PlayerPos().

+ Here is the caller graph for this function:

Member Data Documentation

◆ aux1

◆ dig

◆ direction_keys

◆ jump

◆ movement_direction

◆ movement_speed

◆ pitch

float PlayerControl::pitch = 0.0f

◆ place

◆ sneak

◆ yaw

float PlayerControl::yaw = 0.0f

◆ zoom


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