Cafu Engine
PlayerCommand.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_PLAYERCOMMAND_HPP_INCLUDED
8 #define CAFU_PLAYERCOMMAND_HPP_INCLUDED
9 
10 
11 // Player command key flags
12 const unsigned long PCK_MoveForward =0x00000001;
13 const unsigned long PCK_MoveBackward=0x00000002;
14 const unsigned long PCK_TurnLeft =0x00000004;
15 const unsigned long PCK_TurnRight =0x00000008;
16 const unsigned long PCK_StrafeLeft =0x00000010;
17 const unsigned long PCK_StrafeRight =0x00000020;
18 const unsigned long PCK_LookUp =0x00000040;
19 const unsigned long PCK_LookDown =0x00000080;
20 const unsigned long PCK_CenterView =0x00000100;
21 const unsigned long PCK_Jump =0x00000200; // Jump
22 const unsigned long PCK_Duck =0x00000400; // Duck
23 const unsigned long PCK_Walk =0x00000800; // Walk (slower than normal)
24 const unsigned long PCK_Fire1 =0x00001000; // Primary Fire (also used e.g. for "Respawn")
25 const unsigned long PCK_Fire2 =0x00002000; // Secondary Fire
26 const unsigned long PCK_Use =0x00004000; // Use
27 // Bits 28-31 are reserved for selecting the weapon slot!
28 
29 
30 /// This struct represents per-frame player inputs for controlling human player entities.
31 /// Player commands are acquired on the clients and send to the server.
33 {
34  float FrameTime;
35  unsigned long Keys;
36  unsigned short DeltaHeading;
37  unsigned short DeltaPitch;
38  unsigned short DeltaBank;
39 
40  PlayerCommandT(float FrameTime_=0, unsigned long Keys_=0, unsigned short DeltaHeading_=0, unsigned short DeltaPitch_=0, unsigned short DeltaBank_=0)
41  : FrameTime(FrameTime_), Keys(Keys_), DeltaHeading(DeltaHeading_), DeltaPitch(DeltaPitch_), DeltaBank(DeltaBank_) { }
42 };
43 
44 #endif
This struct represents per-frame player inputs for controlling human player entities.
Definition: PlayerCommand.hpp:32