s&box docs
API ReferenceSandbox.VR

public sealed class Sandbox.VR.VRController : Sandbox.VR.TrackedObject

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

Methods

Showing 11 methods

public float GetFingerCurl(int index)

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

public float GetFingerSplay(int index)

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

public float GetFingerValue(Sandbox.VR.FingerValue value)

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

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

Obsolete: Please use GetJoints()

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

Returns joint data for a specific motion range.

Parameters

  • motionRange: Whether the joints returned represent a raw hand pose, or one that represents the hand wrapping around the controller. Default: 0

public Sandbox.Model GetModel()

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

public void StopAllHaptics()

Stops all rumble and haptic events on this controller.

public void StopAllVibrations()

Stop all vibration events on this controller.

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

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

Parameters

  • effect: The pattern to use
  • lengthScale: The amount to scale the pattern's length by. Default: 1
  • frequencyScale: The amount to scale the pattern's frequency by. Default: 1
  • amplitudeScale: The amount to scale the pattern's amplitude by. Default: 1

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

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.

Parameters

  • duration: How long the haptic action should last (in seconds - can be 0 to "pulse" it)
  • frequency: How often the haptic motor should bounce (0 - 320 in hz. The lower end being more useful)
  • amplitude: How intense the haptic should be (0 - 1)

Properties

Showing 9 properties

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

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

public Sandbox.VR.DigitalInput Sandbox.VR.VRController.ButtonA { get; set; }

The primary button on this controller (Usually A, can be X for Oculus Touch)

public Sandbox.VR.DigitalInput Sandbox.VR.VRController.ButtonB { get; set; }

The secondary button on this controller (Usually B, can be Y for Oculus Touch)

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

Is this controller currently being represented using full hand tracking?

Metadata

FieldValue
NamespaceSandbox.VR
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.VR.VRController

On this page