7 #ifndef CAFU_GAMESYS_COMPONENT_HUMAN_PLAYER_HPP_INCLUDED
8 #define CAFU_GAMESYS_COMPONENT_HUMAN_PLAYER_HPP_INCLUDED
10 #include "CompBase.hpp"
11 #include "../../Games/PlayerCommand.hpp"
12 #include "GuiSys/GuiImpl.hpp"
22 class ComponentCarriedWeaponT;
57 void CheckGUIs(
bool ThinkingOnServerSide,
bool HaveButtonClick)
const;
81 void SelectWeapon(uint8_t NextWeaponNr,
bool Force =
false);
109 const char*
GetName()
const override {
return "HumanPlayer"; }
111 void PostRender(
bool FirstPersonView)
override;
128 static int FireRay(lua_State* LuaState);
129 static int GetRandom(lua_State* LuaState);
130 static int SpawnWeaponChild(lua_State* LuaState);
131 static int RegisterParticle(lua_State* LuaState);
132 static int toString(lua_State* LuaState);
135 static const char* DocClass;
142 void FillMemberVars();
143 bool IsPlayerPrototype()
const;
Vector3dT GetCameraOriginWS() const
Returns the origin of the entity's camera, in world-space.
Definition: CompHumanPlayer.cpp:257
void DoServerFrame(float t) override
Derived classes override this method in order to implement the real work proposed by OnServerFrame()...
Definition: CompHumanPlayer.cpp:963
This class implements smart (reference-counted) pointers.
Definition: Pointer.hpp:43
ArrayT< PlayerCommandT > & GetPlayerCommands()
A temporary method for compatibility with old code.
Definition: CompHumanPlayer.hpp:42
Vector3dT GetCameraViewDirWS(double Random=0.0) const
Returns the view (forward) vector of the entity's camera, in world space, optionally deviated by some...
Definition: CompHumanPlayer.cpp:270
void DoClientFrame(float t) override
Derived classes override this method in order to implement the real work proposed by OnClientFrame()...
Definition: CompHumanPlayer.cpp:1032
bool TraceCameraRay(const Vector3dT &Dir, Vector3dT &HitPoint, ComponentBaseT *&HitComp) const
Traces a ray that originates at the player camera's origin in the given direction through the world...
Definition: CompHumanPlayer.cpp:298
This struct represents per-frame player inputs for controlling human player entities.
Definition: PlayerCommand.hpp:32
This class represents a set of (render-)materials.
Definition: ParticleEngineMS.hpp:60
Vector3dT GetPlayerVelocity() const
Returns the player's current velocity (as learned from its PlayerPhysics component).
Definition: CompHumanPlayer.cpp:242
void Think(const PlayerCommandT &PlayerCommand, bool ThinkingOnServerSide)
A helper method (that does the actual work) for DoServerFrame() and the (re-)prediction in the client...
Definition: CompHumanPlayer.cpp:472
void SelectWeapon(uint8_t NextWeaponNr, bool Force=false)
This method initiates the holstering of the currently active weapon and the subsequent drawing of the...
Definition: CompHumanPlayer.cpp:812
double GetRandom()
Returns a pseudo-random double in range [0.0, 1.0] (inclusive).
Definition: CompHumanPlayer.cpp:917
const char * GetName() const override
Returns the name of this component.
Definition: CompHumanPlayer.hpp:109
void SelectNextWeapon()
This method draws the next weapon as previously prepared by SelectWeapon().
Definition: CompHumanPlayer.cpp:860
void CheckGUIs(bool ThinkingOnServerSide, bool HaveButtonClick) const
A helper function for Think().
Definition: CompHumanPlayer.cpp:338
static const luaL_Reg MethodsList[]
The list of Lua methods for this class.
Definition: CompHumanPlayer.hpp:134
ComponentHumanPlayerT()
The constructor.
Definition: CompHumanPlayer.cpp:73
IntrusivePtrT< ComponentCarriedWeaponT > GetActiveWeapon() const
Returns the ComponentCarriedWeaponT component of the currently active weapon, or NULL if currently no...
Definition: CompHumanPlayer.cpp:798
void PostRender(bool FirstPersonView) override
This method provides an opportunity for another render pass.
Definition: CompHumanPlayer.cpp:940
ComponentHumanPlayerT * Clone() const override
The virtual copy constructor.
Definition: CompHumanPlayer.cpp:332
BoundingBox3fT GetCullingBB() const override
This method returns a bounding-box that encloses the visual representation of this component...
Definition: CompHumanPlayer.cpp:929
Definition: TypeSys.hpp:52
Definition: TypeSys.hpp:57
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79
~ComponentHumanPlayerT()
The destructor.
Definition: CompHumanPlayer.cpp:131
Entities with this component are associated with a client connection at whose ends is a human player ...
Definition: CompHumanPlayer.hpp:27
Definition: TypeSys.hpp:68
This is the base class for the components that an entity is composed/aggregated of.
Definition: CompBase.hpp:54