Class UserInput
Namespace: ValveResourceFormat.Renderer.Input
Assembly: Renderer.dll
Handles keyboard and mouse input for camera movement and orbit controls.
public class UserInputInheritance
Constructors
UserInput(Renderer)
Initializes a new attached to the given renderer.
public UserInput(Renderer renderer)Parameters
renderer Renderer
The renderer providing uptime and context for camera and physics setup.
Properties
Camera
Gets the internal camera whose location and angles are updated by input processing.
public Camera Camera { get; }Property Value
EnableMouseLook
Gets or sets a value indicating whether mouse movement affects camera look direction.
public bool EnableMouseLook { get; set; }Property Value
ForceUpdate
Force an input update on the next tick.
public bool ForceUpdate { get; set; }Property Value
NoClip
Gets a value indicating whether the camera is in noclip (free-flight) mode rather than FPS movement mode.
public bool NoClip { get; }Property Value
OrbitDistance
Gets the current distance from the camera to the orbit target.
public float OrbitDistance { get; }Property Value
OrbitMode
Gets a value indicating whether the camera is currently in orbit mode.
public bool OrbitMode { get; }Property Value
OrbitModeAlways
Gets or sets a value indicating whether orbit mode is always active regardless of the Alt key.
public bool OrbitModeAlways { get; set; }Property Value
OrbitTarget
Gets or sets the world-space point the camera orbits around; setting this also updates .
public Vector3? OrbitTarget { get; set; }Property Value
OrbitTargetProvider
Gets or sets an optional callback that provides a world-space orbit target point.
public Func<Vector3?>? OrbitTargetProvider { get; set; }Property Value
PhysicsWorld
Gets or sets the physics world used for orbit-target and player-movement ray traces.
public Rubikon? PhysicsWorld { get; set; }Property Value
Velocity
Gets the current camera velocity in world units per second.
public Vector3 Velocity { get; }Property Value
Methods
Holding(TrackedKeys)
Checks if a key is currently being held down.
public bool Holding(TrackedKeys key)Parameters
key TrackedKeys
Returns
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)
Handles a mouse wheel event, adjusting orbit zoom or free-flight speed modifier.
public float OnMouseWheel(float delta)Parameters
delta float
Positive for scroll-up, negative for scroll-down.
Returns
The new orbit distance in orbit mode, or the new speed modifier in free-flight mode.
OrbitZoom(float)
Adjusts the orbit distance by a relative delta and begins a short transition animation. Has no effect when not in orbit mode.
public void OrbitZoom(float delta)Parameters
delta float
Fractional zoom delta; positive zooms out, negative zooms in.
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
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
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
SaveCameraForTransition(float)
Switches to noclip mode and begins a smooth camera transition from the current position.
public void SaveCameraForTransition(float transitionDuration = 1.5)Parameters
transitionDuration float
Duration of the transition animation in seconds.
Tick(float, TrackedKeys, Vector2, Camera)
Processes one input frame: updates camera position/rotation based on keyboard and mouse input.
public void Tick(float deltaTime, TrackedKeys keyboardState, Vector2 mouseDelta, Camera renderCamera)Parameters
deltaTime float
Elapsed time in seconds since the last frame.
keyboardState TrackedKeys
The current keyboard and mouse button state.
mouseDelta Vector2
Mouse movement delta in pixels since the last frame.
renderCamera Camera
The camera to write the final interpolated result to.

