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.

GvrBasePointerRaycaster

This is an abstract class.

This script provides shared functionality used by all Gvr raycasters.

Summary

Inheritance

Inherits from: BaseRaycaster
Direct Known Subclasses:GvrPointerGraphicRaycaster, GvrPointerPhysicsRaycaster

Properties

CurrentRaycastModeForHybrid
Gets the mode used for raycasting.

Protected functions

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

Public functions

GetLastRay()
Gets the last ray created.
Raycast(PointerEventData eventData, List< RaycastResult > resultAppendList)
override void
Raycast against the scene.

Properties

CurrentRaycastModeForHybrid

GvrBasePointer.RaycastMode CurrentRaycastModeForHybrid

Gets the mode used for raycasting.

The mode used for raycasting.

Protected functions

GvrBasePointerRaycaster

 GvrBasePointerRaycaster()

Initializes a new instance of the GvrBasePointerRaycaster class.

PerformRaycast

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

Public functions

GetLastRay

GvrBasePointer.PointerRay GetLastRay()

Gets the last ray created.

Details
Returns
The last ray created.

Raycast

override void Raycast(
  PointerEventData eventData,
  List< RaycastResult > resultAppendList
)

Raycast against the scene.

Details
Parameters
eventData
The pointer event data.
resultAppendList
The result of the raycast is appended to this list.