Rubber Hand VR  V1.0
Toolkit for developing VR neuroplasticity experiments relying on the leap motion hand tracker
HandVR.HandModifierManager Class Reference

Used for controlling parameters for hand modifiers - basically a collection of variables and static methods More...

Inheritance diagram for HandVR.HandModifierManager:
Collaboration diagram for HandVR.HandModifierManager:

Public Types

enum  Axis { Axis.x, Axis.y, Axis.z, Axis.none }
 

Public Member Functions

void ActivateDisplacementHands (float displacement)
 Activates the displacementPostProcessProvider and sets its displacement to the value More...
 
void DeactivateDisplacementHands ()
 Truns off displacement post process provider More...
 
IEnumerator LerpCameraProvider (float xTilt, float yOffset, float zOffset, float time)
 Alternate method for setting displacement - sets camera offset to given values More...
 
IEnumerator LerpCameraProvider (Vector3 targetPosition, float time)
 Alternate method for setting displacement - sets camera offset to given values More...
 

Static Public Member Functions

static IEnumerator LerpSize (GameObject go, float targetSize, float time, Axis axis=Axis.none)
 Changes the size of the given gameobject over a set time More...
 
static IEnumerator LerpPosition (GameObject go, Vector3 targetPosition, float time)
 Changes the position of the given gameobject over a set time More...
 
static Vector3 XRProviderOffsetToVector3 (Leap.Unity.LeapXRServiceProvider camProv)
 Utility function to return the offset of the given camera provider as a vector3 More...
 
static void Vector3ToXRProvider (Leap.Unity.LeapXRServiceProvider camProv, Vector3 target)
 Utility function to set the offset for the given camera provider from the given Vector More...
 

Static Public Attributes

static HandModifierManager instance = null
 

Properties

bool IsDisplacementReset [get]
 Returns true if displacement is off More...
 
bool IsDisplacementFinished [get]
 Returns true if displacment is at the target value More...
 
float ScaleFactor [get]
 
Axis AxisToScale [get]
 
Vector3 InitCameraOffset [get]
 

Detailed Description

Used for controlling parameters for hand modifiers - basically a collection of variables and static methods

Definition at line 9 of file HandModifierManager.cs.

Member Enumeration Documentation

◆ Axis

Enumerator
none 

Definition at line 237 of file HandModifierManager.cs.

Member Function Documentation

◆ ActivateDisplacementHands()

void HandVR.HandModifierManager.ActivateDisplacementHands ( float  displacement)

Activates the displacementPostProcessProvider and sets its displacement to the value

Parameters
displacementValue to set displacement to

Definition at line 89 of file HandModifierManager.cs.

◆ DeactivateDisplacementHands()

void HandVR.HandModifierManager.DeactivateDisplacementHands ( )

Truns off displacement post process provider

Definition at line 99 of file HandModifierManager.cs.

◆ LerpCameraProvider() [1/2]

IEnumerator HandVR.HandModifierManager.LerpCameraProvider ( float  xTilt,
float  yOffset,
float  zOffset,
float  time 
)

Alternate method for setting displacement - sets camera offset to given values

Parameters
xTiltX rotation offset
yOffsetY offset for displacement
zOffsetZ offset for displacement
timeTime to set displacement
Returns

Definition at line 175 of file HandModifierManager.cs.

◆ LerpCameraProvider() [2/2]

IEnumerator HandVR.HandModifierManager.LerpCameraProvider ( Vector3  targetPosition,
float  time 
)

Alternate method for setting displacement - sets camera offset to given values

Parameters
targetPositionTarget position for camera offset
timeTime to set displacement
Returns

Definition at line 187 of file HandModifierManager.cs.

Here is the call graph for this function:

◆ LerpPosition()

static IEnumerator HandVR.HandModifierManager.LerpPosition ( GameObject  go,
Vector3  targetPosition,
float  time 
)
static

Changes the position of the given gameobject over a set time

Parameters
goGameObject to adjust
targetPositionSize to eventually reach - Note that this adjsuts localPosition, not global
timeTime to move gameobject
Returns

Definition at line 152 of file HandModifierManager.cs.

◆ LerpSize()

static IEnumerator HandVR.HandModifierManager.LerpSize ( GameObject  go,
float  targetSize,
float  time,
Axis  axis = Axis.none 
)
static

Changes the size of the given gameobject over a set time

Parameters
goGameObject to adjust
targetSizeSize to eventually reach
timeTime to scale gameobject
axisOptional axis to scale along - leave empty for uniform scaling
Returns

Definition at line 112 of file HandModifierManager.cs.

◆ Vector3ToXRProvider()

static void HandVR.HandModifierManager.Vector3ToXRProvider ( Leap.Unity.LeapXRServiceProvider  camProv,
Vector3  target 
)
static

Utility function to set the offset for the given camera provider from the given Vector

Parameters
camProvCamera provider to set offset
targettarget offset as vector

Definition at line 226 of file HandModifierManager.cs.

Here is the caller graph for this function:

◆ XRProviderOffsetToVector3()

static Vector3 HandVR.HandModifierManager.XRProviderOffsetToVector3 ( Leap.Unity.LeapXRServiceProvider  camProv)
static

Utility function to return the offset of the given camera provider as a vector3

Parameters
camProvCamera provider to get offset
Returns
Camera provider offset as a vector

Definition at line 216 of file HandModifierManager.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ instance

HandModifierManager HandVR.HandModifierManager.instance = null
static

Definition at line 11 of file HandModifierManager.cs.

Property Documentation

◆ AxisToScale

Axis HandVR.HandModifierManager.AxisToScale
get

Definition at line 62 of file HandModifierManager.cs.

◆ InitCameraOffset

Vector3 HandVR.HandModifierManager.InitCameraOffset
get

Definition at line 64 of file HandModifierManager.cs.

◆ IsDisplacementFinished

bool HandVR.HandModifierManager.IsDisplacementFinished
get

Returns true if displacment is at the target value

Definition at line 48 of file HandModifierManager.cs.

◆ IsDisplacementReset

bool HandVR.HandModifierManager.IsDisplacementReset
get

Returns true if displacement is off

Definition at line 30 of file HandModifierManager.cs.

◆ ScaleFactor

float HandVR.HandModifierManager.ScaleFactor
get

Definition at line 61 of file HandModifierManager.cs.


The documentation for this class was generated from the following file: