Api Sandbox VR VRController
class

VRController

public sealed class VRController : TrackedObject

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

Properties

Name Type Description
Transform virtual Transform The grip pose transform in world space (centered on palm/grip).
AimTransform virtual Transform The aim pose transform in world space (pointing forward).
IsHandTracked Boolean Is this controller currently being represented using full hand tracking?
Trigger AnalogInput The trigger input on this controller
Grip AnalogInput The grip input on this controller
Joystick AnalogInput2D The primary joystick input on this controller
JoystickPress DigitalInput The primary joystick press on this controller
ButtonA DigitalInput The primary button on this controller (Usually A, can be X for Oculus Touch)
ButtonB DigitalInput The secondary button on this controller (Usually B, can be Y for Oculus Touch)

Methods

Model GetModel()

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

Void TriggerHapticVibration(Single duration, Single frequency, Single amplitude)

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

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)
Void StopAllVibrations()

Stop all vibration events on this controller.

Void TriggerHaptics(HapticEffect effect, Single lengthScale = 1, Single frequencyScale = 1, Single amplitudeScale = 1)

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

effect — The pattern to use
lengthScale — The amount to scale the pattern's length by.
frequencyScale — The amount to scale the pattern's frequency by.
amplitudeScale — The amount to scale the pattern's amplitude by.
Void StopAllHaptics()

Stops all rumble and haptic events on this controller.

VRHandJointData[] GetJoints(MotionRange motionRange = 0)

Returns joint data for a specific motion range.

motionRange — Whether the joints returned represent a raw hand pose, or one that represents the hand wrapping around the controller.
Single GetFingerValue(FingerValue value)

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

Single GetFingerCurl(Int32 index)

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

Single GetFingerSplay(Int32 index)

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

List<VRHandJointData> GetJointData()
virtual override VRController <Clone>$()
Assembly: Sandbox.Engine Namespace: Sandbox.VR Full Name: Sandbox.VR.VRController