Interface IPlayerController ​
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
The physical state of a player, as much of it as the entity world needs: where they stand, how fast, how big, and how to move them somewhere else.
public interface IPlayerControllerRemarks ​
Declared next to its consumer so the entity world does not depend on whatever drives the player. The player moves per rendered frame rather than on the entity tick, so reads an implementation of this instead of owning the state.
Properties ​
EyePosition ​
Gets where the view sits, which is what entity logic traces from.
Vector3 EyePosition { get; }Property Value ​
GroundEntity ​
Gets the entity the player stands on, or null in the air.
BaseEntity? GroundEntity { get; }Property Value ​
HullHalfExtents ​
Gets the half-extents of the player's collision hull, which shrink when ducking.
Vector3 HullHalfExtents { get; }Property Value ​
IsActive ​
Gets whether the player is being simulated: standing in the world rather than a free camera.
bool IsActive { get; }Property Value ​
PendingPush ​
Gets the reserved push the controller has not walked yet. A rider's carry is computed at
plus this, so each tick targets the exact carried trajectory and thewalk-off lag cannot accumulate into drift.
Vector3 PendingPush { get; }Property Value ​
Position ​
Gets the position of the player's feet, which is the entity origin.
Vector3 Position { get; }Property Value ​
Velocity ​
Gets the current velocity in units per second.
Vector3 Velocity { get; }Property Value ​
ViewForward ​
Gets the direction the player is looking.
Vector3 ViewForward { get; }Property Value ​
Methods ​
ConsumeButtons() ​
Takes the buttons seen since the last call, reporting them against the state the previous call left. Called once per tick, by the player entity.
PlayerButtonState ConsumeButtons()Returns ​
What is held, and what changed, for the tick collecting it.
Push(Vector3, bool) ​
Shoves the player by a world-space delta, stopped early by the static world. The pusher physics calls this on the entity tick. A ride carry is reserved and applied as motion spread over the tick interval, so riding stays smooth; a depenetrating shove is immediate, so the hull never stays inside the pusher and its faces stay plainly solid.
Vector3 Push(Vector3 delta, bool immediate = false)Parameters ​
delta Vector3
immediate bool
Returns ​
The part of the delta the controller took.
Teleport(Vector3, Vector3?) ​
Moves the player somewhere else outright, keeping their velocity. Null angles keep the current ones.
void Teleport(Vector3 feetPosition, Vector3? angles)Parameters ​
feetPosition Vector3
angles Vector3?

