Skip to content

Latest commit

 

History

History
124 lines (57 loc) · 3.83 KB

File metadata and controls

124 lines (57 loc) · 3.83 KB

Wand

Summary

Represents the user's wand (the controller that isn't the brush controller)

Class Properties

NameReturn TypeDescription
positionVector3
Read-only
The 3D position of the Wand Controller
rotationRotation
Read-only
The 3D orientation of the Wand
directionVector3
Read-only
The vector representing the forward direction of the wand controller
pressurenumber
Read-only
How far the trigger on the wand contrller is pressed in
speedVector3
Read-only
How fast the wand controller is currently moving
triggerIsPressedboolean
Read-only
Check whether the wand trigger is currently pressed
triggerPressedThisFrameboolean
Read-only
Check whether the wand trigger was pressed during the current frame
triggerReleasedThisFrameboolean
Read-only
Check whether the wand trigger was released during the current frame
timeSincePressednumber
Read-only
Time in seconds since the wand trigger was last pressed
timeSinceReleasednumber
Read-only
Time in seconds since the wand trigger was last released
distanceMovednumber
Read-only
The distance moved by the wand
distanceDrawnnumber
Read-only
The distance drawn by the wand (i.e. distance since the trigger was last pressed)

Class Methods

Wand:ResizeHistory(size)

Clears the history and sets it's size

Returns: nil

Parameters:

NameTypeDefaultDescription
sizenumberThe size of the history buffer

Example

Wand.ResizeHistory(100)

Wand:SetHistorySize(size)

Sets the size of the history. Only clears it if the size has changed

Returns: nil

Parameters:

NameTypeDefaultDescription
sizenumberThe size of the history buffer

Example

Wand.SetHistorySize(100)

Wand:PastPosition(back)

Recalls previous positions of the Wand from the history buffer

Returns: Vector3

Parameters:

NameTypeDefaultDescription
backnumberHow far back in the history to get the position from

Example

myPosition = Wand.PastPosition(5)

Wand:PastRotation(back)

Recalls previous orientations of the Wand from the history buffer

Returns: Rotation

Parameters:

NameTypeDefaultDescription
backnumberHow far back in the history to get the rotation from

Example

myRotation = Wand.PastRotation(5)