API ReferenceSandbox.Movement

MoveModeclass

A move mode for this character

objectComponentMoveMode
Namespace
Sandbox.Movement
Assembly
Sandbox.Engine
Declaration
public abstract class Sandbox.Movement.MoveMode : Sandbox.Component

Constructors1

Showing 1 constructors

protected MoveMode()PROTECTEDCONSTRUCTOR

Methods19

Showing 19 methods

public virtual void AddVelocity()PUBLICVIRTUAL

Returns:void

public virtual Transform CalculateEyeTransform()PUBLICVIRTUAL

Get the position of the player's eye

Returns:Transform

public virtual bool IsStandableSurace(Sandbox.SceneTraceResult& modreq(System.Runtime.InteropServices.InAttribute) result)PUBLICVIRTUAL

ParameterTypeDescription
resultSceneTraceResult& modreq(InAttribute)
Returns:bool

public virtual bool IsStandableSurface(Sandbox.SceneTraceResult& modreq(System.Runtime.InteropServices.InAttribute) result)PUBLICVIRTUAL

ParameterTypeDescription
resultSceneTraceResult& modreq(InAttribute)
Returns:bool

public virtual void OnModeBegin()PUBLICVIRTUAL

This mode has just started

Returns:void

public virtual void OnModeEnd(Sandbox.Movement.MoveMode next)PUBLICVIRTUAL

This mode has stopped. We're swapping to another move mode.

ParameterTypeDescription
nextMoveMode
Returns:void

protected virtual void OnRotateRenderBody(Sandbox.SkinnedModelRenderer renderer)PROTECTEDVIRTUAL

Updates the `Sandbox.Component.WorldRotation` of `renderer`.

ParameterTypeDescription
rendererSkinnedModelRenderer
Returns:void

protected virtual void OnUpdateAnimatorLookDirection(Sandbox.SkinnedModelRenderer renderer)PROTECTEDVIRTUALPER-FRAME

Set animation parameters on `renderer` to look towards `Sandbox.Movement.MoveMode.CalculateEyeTransform`.

ParameterTypeDescription
rendererSkinnedModelRenderer
Returns:void

protected virtual void OnUpdateAnimatorState(Sandbox.SkinnedModelRenderer renderer)PROTECTEDVIRTUALPER-FRAME

Sets animation parameters on `renderer` describing the movement style, like swimming, falling, or ducking.

ParameterTypeDescription
rendererSkinnedModelRenderer
Returns:void

protected virtual void OnUpdateAnimatorVelocity(Sandbox.SkinnedModelRenderer renderer)PROTECTEDVIRTUALPER-FRAME

Sets animation parameters on `renderer` based on the current `Sandbox.PlayerController.Velocity` and `Sandbox.PlayerController.WishVelocity`.

ParameterTypeDescription
rendererSkinnedModelRenderer
Returns:void

public virtual void PostPhysicsStep()PUBLICVIRTUAL

Called after the physics step is run

Returns:void

public virtual void PrePhysicsStep()PUBLICVIRTUAL

Called before the physics step is run

Returns:void

public virtual int Score(Sandbox.PlayerController controller)PUBLICVIRTUAL

Highest number becomes the new control mode

ParameterTypeDescription
controllerPlayerController
Returns:int

protected void StickToGround(float maxDistance)PROTECTED

If we're on the ground, make sure we stay there by falling to the ground

ParameterTypeDescription
maxDistancefloat
Returns:void

protected void TrySteppingUp(float maxDistance)PROTECTED

If we're approaching a step, step up if possible

ParameterTypeDescription
maxDistancefloat
Returns:void

public virtual void UpdateAnimator(Sandbox.SkinnedModelRenderer renderer)PUBLICVIRTUALPER-FRAME

Update the animator which is available at Controller.Renderer.

ParameterTypeDescription
rendererSkinnedModelRenderer
Returns:void

public void UpdateCamera(Sandbox.CameraComponent cam)PUBLICPER-FRAME

Called to update the camera each frame

ParameterTypeDescription
camCameraComponent
Returns:void

public virtual void UpdateRigidBody(Sandbox.Rigidbody body)PUBLICVIRTUALPER-FRAME

ParameterTypeDescription
bodyRigidbody
Returns:void

Properties3

Showing 3 properties

public virtual bool Sandbox.Movement.MoveMode.AllowFalling { get; set; }PUBLICVIRTUALGETSET

Returns:bool

public virtual bool Sandbox.Movement.MoveMode.AllowGrounding { get; set; }PUBLICVIRTUALGETSET

Returns:bool

On this page

Constructorsprotected MoveMode()Methodspublic virtual System.Void AddVelocity()public virtual Transform CalculateEyeTransform()public virtual System.Boolean IsStandableSurace(Sandbox.SceneTraceResult& modreq(System.Runtime.InteropServices.InAttribute) result)public virtual System.Boolean IsStandableSurface(Sandbox.SceneTraceResult& modreq(System.Runtime.InteropServices.InAttribute) result)public virtual System.Void OnModeBegin()public virtual System.Void OnModeEnd(Sandbox.Movement.MoveMode next)protected virtual System.Void OnRotateRenderBody(Sandbox.SkinnedModelRenderer renderer)protected virtual System.Void OnUpdateAnimatorLookDirection(Sandbox.SkinnedModelRenderer renderer)protected virtual System.Void OnUpdateAnimatorState(Sandbox.SkinnedModelRenderer renderer)protected virtual System.Void OnUpdateAnimatorVelocity(Sandbox.SkinnedModelRenderer renderer)public virtual System.Void PostPhysicsStep()public virtual System.Void PrePhysicsStep()public virtual System.Int32 Score(Sandbox.PlayerController controller)protected System.Void StickToGround(System.Single maxDistance)protected System.Void TrySteppingUp(System.Single maxDistance)public virtual System.Void UpdateAnimator(Sandbox.SkinnedModelRenderer renderer)public System.Void UpdateCamera(Sandbox.CameraComponent cam)public virtual Vector3 UpdateMove(Rotation eyes, Vector3 input)public virtual System.Void UpdateRigidBody(Sandbox.Rigidbody body)Propertiespublic virtual System.Boolean Sandbox.Movement.MoveMode.AllowFalling { get; set; }public virtual System.Boolean Sandbox.Movement.MoveMode.AllowGrounding { get; set; }public Sandbox.PlayerController Sandbox.Movement.MoveMode.Controller { get; set; }Metadata