7 #ifndef CAFU_GAMESYS_COMPONENT_PLAYER_PHYSICS_HPP_INCLUDED
8 #define CAFU_GAMESYS_COMPONENT_PLAYER_PHYSICS_HPP_INCLUDED
10 #include "CompBase.hpp"
11 #include "ClipSys/TraceSolid.hpp"
14 namespace cf {
namespace ClipSys {
class ClipModelT; } }
15 namespace cf {
namespace ClipSys {
class ClipWorldT; } }
53 const char*
GetName()
const {
return "PlayerPhysics"; }
66 static int MoveHuman(lua_State* LuaState);
67 static int toString(lua_State* LuaState);
70 static const char* DocClass;
77 enum PosCatT { InAir, OnSolid };
79 PosCatT CategorizePosition()
const;
80 void ApplyFriction(
double FrameTime, PosCatT PosCat);
81 void ApplyAcceleration(
double FrameTime, PosCatT PosCat,
const Vector3dT& WishVelocity);
82 void ApplyGravity(
double FrameTime, PosCatT PosCat);
83 void FlyMove(
double TimeLeft);
84 void GroundMove(
double FrameTime);
void MoveHuman(float FrameTime, const Vector3fT &WishVelocity, const Vector3fT &WishVelLadder, bool WishJump)
This is the main method of this component: It advances the entity's origin according to the laws of s...
Definition: CompPlayerPhysics.cpp:84
A clip model represents an object in the world against which clipping queries can be performed...
Definition: ClipModel.hpp:31
const Vector3dT & GetVelocity() const
Returns the current velocity.
Definition: CompPlayerPhysics.hpp:49
ComponentPlayerPhysicsT()
The constructor.
Definition: CompPlayerPhysics.cpp:46
const char * GetName() const
Returns the name of this component.
Definition: CompPlayerPhysics.hpp:53
This class represents game entities, which are the basic elements of a world.
Definition: Entity.hpp:53
This is a "wrapper" around a normal C++ variable.
Definition: SetCompVar.hpp:15
This class represents a convex solid in the shape of a (bounding-)box.
Definition: TraceSolid.hpp:105
static const luaL_Reg MethodsList[]
The list of Lua methods for this class.
Definition: CompPlayerPhysics.hpp:69
The clip world manages all the clip models that exist in a world (their "union"). ...
Definition: ClipWorld.hpp:27
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
void UpdateDependencies(EntityT *Entity)
This method is called whenever something "external" to this component has changed: ...
Definition: CompPlayerPhysics.cpp:112
ComponentPlayerPhysicsT * Clone() const
The virtual copy constructor.
Definition: CompPlayerPhysics.cpp:106
Definition: TypeSys.hpp:68
This is the base class for the components that an entity is composed/aggregated of.
Definition: CompBase.hpp:54
This component implements human player physics for its entity.
Definition: CompPlayerPhysics.hpp:27