API ReferenceSandbox.VR

VRControllerclass

Represents a VR controller, along with its transform, velocity, and inputs.

objectTrackedObjectVRController
Namespace
Sandbox.VR
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.VR.VRController : Sandbox.VR.TrackedObject

Methods11

Showing 11 methods

public float GetFingerCurl(int index)PUBLIC

Get the skeletal value (from 0 to 1) of a specified finger curl index.

ParameterTypeDescription
indexint
Returns:float

public float GetFingerSplay(int index)PUBLIC

Get the skeletal value (from 0 to 1) of a specified finger splay index.

ParameterTypeDescription
indexint
Returns:float

public float GetFingerValue(Sandbox.VR.FingerValue value)PUBLIC

Get the skeletal value (from 0 to 1) of a specified `Sandbox.VR.FingerValue` - includes curl and splay.

ParameterTypeDescription
valueFingerValue
Returns:float

public System.Collections.Generic.List`1<Sandbox.VR.VRHandJointData> GetJointData()PUBLICOBSOLETE

Obsolete: Please use GetJoints()

Returns:List<VRHandJointData>

public Sandbox.VR.VRHandJointData[] GetJoints(Sandbox.VR.MotionRange motionRange = 0)PUBLIC

Returns joint data for a specific motion range.

ParameterTypeDescription
motionRange = 0MotionRangeWhether the joints returned represent a raw hand pose, or one that represents the hand wrapping around the controller.
Returns:VRHandJointData[]

public Sandbox.Model GetModel()PUBLIC

Retrieves or creates a cached model that can be used to render this controller.

Returns:Model

public void StopAllHaptics()PUBLIC

Stops all rumble and haptic events on this controller.

Returns:void

public void StopAllVibrations()PUBLIC

Stop all vibration events on this controller.

Returns:void

public void TriggerHaptics(Sandbox.HapticEffect effect, float lengthScale = 1, float frequencyScale = 1, float amplitudeScale = 1)PUBLIC

Trigger a vibration based on a predefined `Sandbox.HapticPattern`. All `Sandbox.HapticPattern`s are normalized (start at 0, peak at 1).

ParameterTypeDescription
effectHapticEffectThe pattern to use
lengthScale = 1floatThe amount to scale the pattern's length by.
frequencyScale = 1floatThe amount to scale the pattern's frequency by.
amplitudeScale = 1floatThe amount to scale the pattern's amplitude by.
Returns:void

public void TriggerHapticVibration(float duration, float frequency, float amplitude)PUBLICOBSOLETE

Triggers a haptic vibration event on the controller for this hand.

Obsolete: Use TriggerHaptics instead

Note

If a haptic event is already running it will be interrupted immediately.

ParameterTypeDescription
durationfloatHow long the haptic action should last (in seconds - can be 0 to "pulse" it)
frequencyfloatHow often the haptic motor should bounce (0 - 320 in hz. The lower end being more useful)
amplitudefloatHow intense the haptic should be (0 - 1)
Returns:void

Properties9

Showing 9 properties

public virtual Transform Sandbox.VR.VRController.AimTransform { get; set; }PUBLICVIRTUALGETSET

The aim pose transform in world space (pointing forward).

Returns:Transform

public bool Sandbox.VR.VRController.IsHandTracked { get; set; }PUBLICGETSET

Is this controller currently being represented using full hand tracking?

Returns:bool

On this page