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
maxPointerDistance = 20.0f
float
overrideCameraRayIntersectionDistance
float

Properties

CameraRayIntersectionDistance
override float
LaserVisual
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 raycastResultResult, bool isInteractive)
virtual override void
Called every frame the user is still pointing at a valid GameObject.

Protected functions

Start()
virtual override void

Public attributes

defaultReticleDistance

float defaultReticleDistance = 20.0f

maxPointerDistance

float maxPointerDistance = 20.0f

overrideCameraRayIntersectionDistance

float overrideCameraRayIntersectionDistance

Properties

CameraRayIntersectionDistance

override float CameraRayIntersectionDistance

LaserVisual

GvrLaserVisual LaserVisual

MaxPointerDistance

override float MaxPointerDistance

Public functions

GetPointerRadius

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

Return the radius of the pointer.

It is used by GvrPointerPhysicsRaycaster when searching for valid pointer targets. If a radius is 0, then a ray is used to find a valid pointer target. Otherwise it will use a SphereCast. The enterRadius is used for finding new targets while the exitRadius is used to see if you are still nearby the object currently pointed at to avoid a flickering effect when just at the border of the intersection.

NOTE: This is only works with GvrPointerPhysicsRaycaster. To use it with uGUI, add 3D colliders to your canvas elements.

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.

This can be a 3D or UI element.

raycastResult is the hit detection result for the object being pointed at. isInteractive is true if the object being pointed at is interactive.

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.

This is also called just before OnInputModuleDisabled previousObject will be null in this case.

previousObject is the object that was being pointed at the previous frame.

OnPointerHover

virtual override void OnPointerHover(
  RaycastResult raycastResultResult,
  bool isInteractive
)

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

This can be a 3D or UI element.

raycastResult is the hit detection result for the object being pointed at. isInteractive is true if the object being pointed at is interactive.

Protected functions

Start

virtual override void Start()