GvrArmModel

The GvrArmModel is a standard interface to interact with a scene with the controller.

Summary

It is responsible for:

  • Determining the orientation and location of the controller.
  • Predict the location of the shoulder, elbow, wrist, and pointer.

Inheritance

Inherits from: GvrBaseArmModel

Public types

GazeBehavior{
  DuringMotion,
  Always
}
enum
Represents when gaze-following behavior should occur.

Public attributes

addedElbowDepth = 0.0f
float
Depth of the elbow (m).
addedElbowHeight = 0.0f
float
Height of the elbow (m).
fadeDistanceFromFace = 0.32f
float
Controller distance from the face after which the controller disappears (meters).
followGaze = GazeBehavior.DuringMotion
Determines if the shoulder should follow the gaze.
isLockedToHead = false
bool
pointerTiltAngle = 15.0f
float
The Downward tilt or pitch of the laser pointer relative to the controller (degrees).
tooltipMaxAngleFromCamera = 80
int
When the angle (degrees) between the controller and the head is larger than this value, the tooltips disappear.
tooltipMinDistanceFromFace = 0.45f
float
Controller distance from face after which the tooltips appear (meters).
useAccelerometer = false
bool
Determines if the accelerometer should be used.

Properties

ControllerPositionFromHead
override Vector3
Vector to represent the controller's location relative to the user's head position.
ControllerRotationFromHead
override Quaternion
Quaternion to represent the controller's rotation relative to the user's head position.
ElbowPosition
Vector3
Vector to represent the elbow's location.
ElbowRotation
Quaternion
Quaternion to represent the elbow's rotation.
HeadPosition
Vector3
Vector to represent the head's location.
PointerPositionFromController
override Vector3
Vector to represent the pointer's location relative to the controller.
PointerRotationFromController
override Quaternion
Quaternion to represent the pointer's rotation relative to the controller.
PreferredAlpha
override float
The suggested rendering alpha value of the controller.
ShoulderRotation
Quaternion
Quaternion to represent the shoulder's rotation.
TooltipAlphaValue
override float
The suggested rendering alpha value of the controller tooltips.

Public types

GazeBehavior

 GazeBehavior

Represents when gaze-following behavior should occur.

Properties
Always

The shoulder will follow the gaze during controller motion.

The shoulder will always follow the gaze.

DuringMotion

The shoulder will never follow the gaze.

Public attributes

addedElbowDepth

float addedElbowDepth = 0.0f

Depth of the elbow (m).

addedElbowHeight

float addedElbowHeight = 0.0f

Height of the elbow (m).

fadeDistanceFromFace

float fadeDistanceFromFace = 0.32f

Controller distance from the face after which the controller disappears (meters).

followGaze

GazeBehavior followGaze = GazeBehavior.DuringMotion

Determines if the shoulder should follow the gaze.

isLockedToHead

bool isLockedToHead = false

pointerTiltAngle

float pointerTiltAngle = 15.0f

The Downward tilt or pitch of the laser pointer relative to the controller (degrees).

tooltipMaxAngleFromCamera

int tooltipMaxAngleFromCamera = 80

When the angle (degrees) between the controller and the head is larger than this value, the tooltips disappear.

If the value is 180, then the tooltips are always shown. If the value is 90, the tooltips are only shown when they are facing the camera.

tooltipMinDistanceFromFace

float tooltipMinDistanceFromFace = 0.45f

Controller distance from face after which the tooltips appear (meters).

useAccelerometer

bool useAccelerometer = false

Determines if the accelerometer should be used.

Properties

ControllerPositionFromHead

override Vector3 ControllerPositionFromHead

Vector to represent the controller's location relative to the user's head position.

ControllerRotationFromHead

override Quaternion ControllerRotationFromHead

Quaternion to represent the controller's rotation relative to the user's head position.

ElbowPosition

Vector3 ElbowPosition

Vector to represent the elbow's location.

NOTE: This is in meatspace coordinates.

ElbowRotation

Quaternion ElbowRotation

Quaternion to represent the elbow's rotation.

NOTE: This is in meatspace coordinates.

HeadPosition

Vector3 HeadPosition

Vector to represent the head's location.

NOTE: This is in meatspace coordinates.

PointerPositionFromController

override Vector3 PointerPositionFromController

Vector to represent the pointer's location relative to the controller.

PointerRotationFromController

override Quaternion PointerRotationFromController

Quaternion to represent the pointer's rotation relative to the controller.

PreferredAlpha

override float PreferredAlpha

The suggested rendering alpha value of the controller.

This is to prevent the controller from intersecting the face. The range is always 0 - 1 but can be scaled by individual objects when using the GvrBaseControllerVisual script.

ShoulderRotation

Quaternion ShoulderRotation

Quaternion to represent the shoulder's rotation.

NOTE: This is in meatspace coordinates.

TooltipAlphaValue

override float TooltipAlphaValue

The suggested rendering alpha value of the controller tooltips.

This is to only display the tooltips when the player is looking at the controller, and also to prevent the tooltips from intersecting the player's face.