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.

There should only be one instance in the scene, and it should be attached to the GvrController.

Inheritance

Inherits from: MonoBehaviour

Public types

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

Properties

Instance
static GvrArmModel
Use the GvrController singleton to obtain a singleton for this class.
elbowPosition
Vector3
Vector to represent the elbow's location.
elbowRotation
Quaternion
Quaternion to represent the elbow's rotation.
pointerPosition
Vector3
Vector to represent the pointer's location.
pointerRotation
Quaternion
Quaternion to represent the pointer's rotation.
preferredAlpha
float
The suggested rendering alpha value of the controller.
shoulderPosition
Vector3
Vector to represent the shoulder's location.
shoulderRotation
Quaternion
Vector to represent the shoulder's location.
tooltipAlphaValue
float
The suggested rendering alpha value of the controller tooltips.
wristPosition
Vector3
Vector to represent the wrist's location.
wristRotation
Quaternion
Quaternion to represent the wrist's rotation.

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.
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.

Events

OnArmModelUpdate

Public functions

OnArmModelUpdateEvent()
delegate void
Event handler that occurs when the state of the ArmModel is updated.

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.

Properties

Instance

static GvrArmModel Instance

Use the GvrController singleton to obtain a singleton for this class.

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.

pointerPosition

Vector3 pointerPosition

Vector to represent the pointer's location.

NOTE: This is in meatspace coordinates.

pointerRotation

Quaternion pointerRotation

Quaternion to represent the pointer's rotation.

NOTE: This is in meatspace coordinates.

preferredAlpha

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.

shoulderPosition

Vector3 shoulderPosition

Vector to represent the shoulder's location.

NOTE: This is in meatspace coordinates.

shoulderRotation

Quaternion shoulderRotation

Vector to represent the shoulder's location.

NOTE: This is in meatspace coordinates.

tooltipAlphaValue

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.

wristPosition

Vector3 wristPosition

Vector to represent the wrist's location.

NOTE: This is in meatspace coordinates.

wristRotation

Quaternion wristRotation

Quaternion to represent the wrist's rotation.

NOTE: This is in meatspace coordinates.

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.

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.

Events

OnArmModelUpdate

OnArmModelUpdateEvent OnArmModelUpdate

Public functions

OnArmModelUpdateEvent

delegate void OnArmModelUpdateEvent()

Event handler that occurs when the state of the ArmModel is updated.