November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

GvrPointerGraphicRaycaster

This script provides a raycaster for use with the GvrPointerInputModule.

Summary

This behaves similarly to the standards Graphic raycaster, except that it utilize raycast modes specifically for Gvr.

See GvrBasePointerRaycaster.cs and GvrPointerInputModule.cs for more details.

Inheritance

Inherits from: GvrBasePointerRaycaster

Public types

BlockingObjects{
  None = 0,
  TwoD = 1,
  ThreeD = 2,
  All = 3
}
enum
Types of blocking objects this object's raycasts can hit.

Public attributes

blockingMask = NO_EVENT_MASK_SET
LayerMask
The blocking layer mask to use when raycasting.
blockingObjects = BlockingObjects.ThreeD
The type of objects which can block raycasts.
ignoreReversedGraphics = true
bool
Flag for ignoring reversed graphics direction.

Properties

eventCamera
override Camera
Gets the event Camera used for gaze-based raycasts.

Protected functions

GvrPointerGraphicRaycaster()
Initializes a new instance of the GvrPointerGraphicRaycaster class.
PerformRaycast(GvrBasePointer.PointerRay pointerRay, float radius, PointerEventData eventData, List< RaycastResult > resultAppendList)
virtual override bool
Perform raycast on the scene.

Public types

BlockingObjects

 BlockingObjects

Types of blocking objects this object's raycasts can hit.

Properties
All

This can hit all objects.

None

This cannot hit any objects.

ThreeD

This can hit only 3D objects.

TwoD

This can hit only 2D objects.

Public attributes

blockingMask

LayerMask blockingMask = NO_EVENT_MASK_SET

The blocking layer mask to use when raycasting.

blockingObjects

BlockingObjects blockingObjects = BlockingObjects.ThreeD

The type of objects which can block raycasts.

ignoreReversedGraphics

bool ignoreReversedGraphics = true

Flag for ignoring reversed graphics direction.

Properties

eventCamera

override Camera eventCamera

Gets the event Camera used for gaze-based raycasts.

The event camera.

Protected functions

GvrPointerGraphicRaycaster

 GvrPointerGraphicRaycaster()

Initializes a new instance of the GvrPointerGraphicRaycaster class.

PerformRaycast

virtual override bool PerformRaycast(
  GvrBasePointer.PointerRay pointerRay,
  float radius,
  PointerEventData eventData,
  List< RaycastResult > resultAppendList
)

Perform raycast on the scene.

Details
Parameters
pointerRay
The ray to use for the operation.
radius
The radius of the ray to use when testing for hits.
eventData
The event data triggered by any resultant Raycast hits.
resultAppendList
The results are appended to this list.
Returns
Returns true if the Raycast has at least one hit, false otherwise.