Table of Contents

Class UserInput

Namespace
ValveResourceFormat.Renderer
Assembly
Renderer.dll

Handles keyboard and mouse input for camera movement and orbit controls.

public class UserInput

Inheritance

Inherited Members

Constructors

UserInput(Renderer)

public UserInput(Renderer renderer)

Parameters

renderer Renderer

Properties

Camera

public Camera Camera { get; }

Property Value

Camera

EnableMouseLook

public bool EnableMouseLook { get; set; }

Property Value

bool

ForceUpdate

Force an input update on the next tick.

public bool ForceUpdate { get; set; }

Property Value

bool

NoClip

public bool NoClip { get; }

Property Value

bool

OrbitDistance

public float OrbitDistance { get; }

Property Value

float

OrbitMode

public bool OrbitMode { get; }

Property Value

bool

OrbitModeAlways

public bool OrbitModeAlways { get; set; }

Property Value

bool

OrbitTarget

public Vector3? OrbitTarget { get; set; }

Property Value

Vector3?

OrbitTargetProvider

public Func<Vector3?>? OrbitTargetProvider { get; set; }

Property Value

Func<Vector3?>?

PhysicsWorld

public Rubikon? PhysicsWorld { get; set; }

Property Value

Rubikon?

Velocity

public Vector3 Velocity { get; }

Property Value

Vector3

Methods

Holding(TrackedKeys)

Checks if a key is currently being held down.

public bool Holding(TrackedKeys key)

Parameters

key TrackedKeys

Returns

bool

MoveCamera(Vector3, bool)

Moves the camera by the specified amounts in camera space.

public void MoveCamera(Vector3 delta, bool transition = false)

Parameters

delta Vector3
transition bool

OnMouseWheel(float)

public float OnMouseWheel(float delta)

Parameters

delta float

Returns

float

OrbitZoom(float)

public void OrbitZoom(float delta)

Parameters

delta float

Pressed(TrackedKeys)

Checks if a key was just pressed this frame (pressed now but not last frame).

public bool Pressed(TrackedKeys key)

Parameters

key TrackedKeys

Returns

bool

PressedSuccessive(TrackedKeys, float)

Checks if a key was pressed twice within a certain time interval.

public bool PressedSuccessive(TrackedKeys key, float maxInterval)

Parameters

key TrackedKeys
maxInterval float

Returns

bool

Released(TrackedKeys)

Checks if a key was just released this frame (not pressed now but was pressed last frame).

public bool Released(TrackedKeys key)

Parameters

key TrackedKeys

Returns

bool

SaveCameraForTransition(float)

public void SaveCameraForTransition(float transitionDuration = 1.5)

Parameters

transitionDuration float

Tick(float, TrackedKeys, Vector2, Camera)

public void Tick(float deltaTime, TrackedKeys keyboardState, Vector2 mouseDelta, Camera renderCamera)

Parameters

deltaTime float
keyboardState TrackedKeys
mouseDelta Vector2
renderCamera Camera