This component implements human player physics for its entity. More...
Public Member Functions | |
MoveHuman (number FrameTime, Vector3T WishVelocity, Vector3T WishVelLadder, bool WishJump) | |
This is the main method of this component: It advances the entity's origin according to the laws of simple physics and the given state and parameters. More... | |
Public Member Functions inherited from ComponentBaseT | |
any | get (string var_name) |
Returns the value of an attribute (a member variable) of this class. More... | |
set (string var_name, any new_value) | |
Sets an attribute (a member variable) of this class to a new value. More... | |
string | GetExtraMessage (string var_name) |
Returns the result of VarBaseT::GetExtraMessage() for the given member variable. More... | |
interpolate (string var_name, number start_value, number end_value, number time) | |
Schedules a value for interpolation between a start and end value over a given period of time. More... | |
EntityT | GetEntity () |
Returns the entity that this component is a part of (or nil if the component is currently "stand-alone", not a part of any entity). More... | |
InitClientApprox (string VarName) | |
Registers the given attribute (a member variable) of this class for interpolation over client frames in order to bridge the larger intervals between server frames. More... | |
OnInit () | |
This method is called for each component of each entity as the last step of initializing a newly loaded map. More... | |
OnClientFrame (number t) | |
This method is called for each component of each entity before the client renders the next frame. More... | |
Public Attributes | |
tuple | Velocity |
The current velocity of the entity. More... | |
tuple | Dimensions |
The bounding box of the entity (relative to the origin). More... | |
number | StepHeight |
The maximum height that the entity can climb in one step. More... | |
boolean | OldWishJump |
Only jump if the jump key was not pressed in the previous frame. More... | |
This component implements human player physics for its entity.
It updates the entity's origin according to the laws of simple physics that are appropriate for player movement. The component does not act on its own in a server's Think() step, but is only a helper to other C++ or script code that must drive it explicitly.
Note that the variables of this class (also referred to as "Public Attributes" or "Member Data") must be used with the get() and set() methods at this time – see get() and set() for details.
If you would like to create a new component of this type explicitly (those defined in the CaWE Map Editor are instantiated automatically), use WorldT::new():
MoveHuman | ( | number | FrameTime, |
Vector3T | WishVelocity, | ||
Vector3T | WishVelLadder, | ||
bool | WishJump | ||
) |
This is the main method of this component: It advances the entity's origin according to the laws of simple physics and the given state and parameters.
Other C++ or script code of the entity typically calls this method on each clock-tick (frame) of the server.
FrameTime | The time across which the entity is to be advanced. |
WishVelocity | The desired velocity of the entity as per user input. |
WishVelLadder | The desired velocity on a ladder as per user input. |
WishJump | Does the user want the entity to jump? |
tuple Dimensions |
The bounding box of the entity (relative to the origin).
BoundingBox3dT
boolean OldWishJump |
Only jump if the jump key was not pressed in the previous frame.
bool
number StepHeight |
The maximum height that the entity can climb in one step.
double
tuple Velocity |
The current velocity of the entity.
Vector3dT