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

#include <player.h>

Public Member Functions

 PlayerControl ()=default
 PlayerControl (float a_up, float a_down, float a_left, float 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)
void setMovementFromKeys ()
u32 getKeysPressed () const
bool isMoving () const
void unpackKeysPressed (u32 keypress_bits)
v2f getMovement () const

Public Attributes

float up = 0
float down = 0
float left = 0
float right = 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 ( float a_up,
float a_down,
float a_left,
float 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 )
inline

References aux1, dig, down, jump, left, pitch, place, right, sneak, up, yaw, and zoom.

Member Function Documentation

◆ getKeysPressed()

u32 PlayerControl::getKeysPressed ( ) const

References aux1, dig, down, jump, left, place, right, sneak, up, and zoom.

◆ 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.

◆ setMovementFromKeys()

void PlayerControl::setMovementFromKeys ( )

References down, left, movement_direction, movement_speed, right, up, x, and y.

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, down, jump, left, place, right, sneak, up, and zoom.

Referenced by Server::process_PlayerPos().

Here is the caller graph for this function:

Member Data Documentation

◆ aux1

◆ dig

◆ down

◆ jump

◆ left

◆ movement_direction

float PlayerControl::movement_direction = 0.0f

◆ movement_speed

◆ pitch

float PlayerControl::pitch = 0.0f

Referenced by PlayerControl().

◆ place

◆ right

◆ sneak

◆ up

◆ yaw

float PlayerControl::yaw = 0.0f

Referenced by PlayerControl().

◆ zoom


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