GvrLaserPointer

Implementation of GvrBasePointer for a laser pointer visual.

Summary

This script should be attached to the controller object. The laser visual is important to help users locate their cursor when its not directly in their field of view.

Inheritance

Inherits from: GvrBasePointer

Public attributes

defaultReticleDistance = 20.0f
float
Distance from the pointer that the reticle will be drawn at when hitting nothing.
maxPointerDistance = 20.0f
float
Maximum distance from the pointer that raycast hits will be detected.
overrideCameraRayIntersectionDistance
float
By default, the length of the laser is used as the CameraRayIntersectionDistance.

Properties

CameraRayIntersectionDistance
override float
LaserVisual
Gets the visual object for the laser beam.
MaxPointerDistance
override float

Public functions

GetPointerRadius(out float enterRadius, out float exitRadius)
virtual override void
Return the radius of the pointer.
OnPointerClickDown()
virtual override void
Called when a click is initiated.
OnPointerClickUp()
virtual override void
Called when click is finished.
OnPointerEnter(RaycastResult raycastResult, bool isInteractive)
virtual override void
Called when the pointer is facing a valid GameObject.
OnPointerExit(GameObject previousObject)
virtual override void
Called when the pointer no longer faces an object previously intersected with a ray projected from the camera.
OnPointerHover(RaycastResult raycastResult, bool isInteractive)
virtual override void
Called every frame the user is still pointing at a valid GameObject.

Public attributes

defaultReticleDistance

float defaultReticleDistance = 20.0f

Distance from the pointer that the reticle will be drawn at when hitting nothing.

maxPointerDistance

float maxPointerDistance = 20.0f

Maximum distance from the pointer that raycast hits will be detected.

overrideCameraRayIntersectionDistance

float overrideCameraRayIntersectionDistance

By default, the length of the laser is used as the CameraRayIntersectionDistance.

Set this field to a non-zero value to override it.

Properties

CameraRayIntersectionDistance

override float CameraRayIntersectionDistance

LaserVisual

GvrLaserVisual LaserVisual

Gets the visual object for the laser beam.

The visual object for the laser beam.

MaxPointerDistance

override float MaxPointerDistance

Public functions

GetPointerRadius

virtual override void GetPointerRadius(
  out float enterRadius,
  out float exitRadius
)

Return the radius of the pointer.

OnPointerClickDown

virtual override void OnPointerClickDown()

Called when a click is initiated.

OnPointerClickUp

virtual override void OnPointerClickUp()

Called when click is finished.

OnPointerEnter

virtual override void OnPointerEnter(
  RaycastResult raycastResult,
  bool isInteractive
)

Called when the pointer is facing a valid GameObject.

OnPointerExit

virtual override void OnPointerExit(
  GameObject previousObject
)

Called when the pointer no longer faces an object previously intersected with a ray projected from the camera.

OnPointerHover

virtual override void OnPointerHover(
  RaycastResult raycastResult,
  bool isInteractive
)

Called every frame the user is still pointing at a valid GameObject.