This site has been permanently archived. The content on this site was last updated in 2019.
Stay organized with collections
Save and categorize content based on your preferences.
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 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.
|
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()
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.
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGvrPointerGraphicRaycaster\u003c/code\u003e script provides a raycaster for use with the \u003ccode\u003eGvrPointerInputModule\u003c/code\u003e, enabling gaze-based interactions in VR.\u003c/p\u003e\n"],["\u003cp\u003eIt functions similarly to the standard Graphic Raycaster but uses raycast modes specifically designed for Google VR.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can configure the raycaster to interact with different types of objects, including 2D, 3D, or both, and control which layers are considered for raycast hits.\u003c/p\u003e\n"],["\u003cp\u003eThe script offers properties to adjust settings like the blocking mask, blocking objects, and whether to ignore reversed graphics directions.\u003c/p\u003e\n"],["\u003cp\u003eFor detailed implementation and usage, refer to the \u003ccode\u003eGvrBasePointerRaycaster.cs\u003c/code\u003e and \u003ccode\u003eGvrPointerInputModule.cs\u003c/code\u003e scripts.\u003c/p\u003e\n"]]],["The `GvrPointerGraphicRaycaster` script, designed for use with `GvrPointerInputModule`, enables raycasting specifically for Gvr. Key actions include performing raycasts (`PerformRaycast`) and defining which objects block raycasts via `blockingObjects` (None, TwoD, ThreeD, All) and `blockingMask`. It also allows to ignore reversed graphics direction (`ignoreReversedGraphics`). The `eventCamera` property retrieves the camera used for gaze-based raycasts. The `GvrPointerGraphicRaycaster` class can be initialized with specific configurations.\n"],null,["# GvrPointerGraphicRaycaster Class Reference\n\nGvrPointerGraphicRaycaster\n==========================\n\nThis script provides a raycaster for use with the [GvrPointerInputModule](/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule).\n\nSummary\n-------\n\nThis behaves similarly to the standards Graphic raycaster, except that it utilize raycast modes specifically for Gvr.\n\nSee `GvrBasePointerRaycaster.cs` and `GvrPointerInputModule.cs` for more details.\n\n### Inheritance\n\nInherits from: [GvrBasePointerRaycaster](/vr/reference/unity/class/GvrBasePointerRaycaster)\n\n| ### Public types ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| [BlockingObjects](#classGvrPointerGraphicRaycaster_1a9a381d0946cb409ff44032570e3806c3)`{` ` `[None](#classGvrPointerGraphicRaycaster_1a9a381d0946cb409ff44032570e3806c3a6adf97f83acf6453d4a6a4b1070f3754)` = 0,` ` `[TwoD](#classGvrPointerGraphicRaycaster_1a9a381d0946cb409ff44032570e3806c3a7fec533aaab2dc4c675964c8ff8a747b)` = 1,` ` `[ThreeD](#classGvrPointerGraphicRaycaster_1a9a381d0946cb409ff44032570e3806c3a31a45a851a6939edcdc88b6533deec13)` = 2,` ` `[All](#classGvrPointerGraphicRaycaster_1a9a381d0946cb409ff44032570e3806c3ab1c94ca2fbc3e78fc30069c8d0f01680)` = 3` `}` | enum Types of blocking objects this object's raycasts can hit. |\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [blockingMask](#classGvrPointerGraphicRaycaster_1a6ffc12382c07b53de292e55ac74ea52e)` = NO_EVENT_MASK_SET` | `LayerMask` The blocking layer mask to use when raycasting. |\n| [blockingObjects](#classGvrPointerGraphicRaycaster_1a2511ad46ae7f37db69484a537bb36aca)` = BlockingObjects.ThreeD` | [BlockingObjects](/vr/reference/unity/class/GvrPointerGraphicRaycaster#classGvrPointerGraphicRaycaster_1a9a381d0946cb409ff44032570e3806c3) The type of objects which can block raycasts. |\n| [ignoreReversedGraphics](#classGvrPointerGraphicRaycaster_1a026d61ff3545fc5b212dd4e40a844ccb)` = true` | `bool` Flag for ignoring reversed graphics direction. |\n\n| ### Properties ||\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [eventCamera](#classGvrPointerGraphicRaycaster_1a5cfbadbd00cc51b30f3c8649ad251aa5) | `override Camera` Gets the event Camera used for gaze-based raycasts. |\n\n| ### Protected functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GvrPointerGraphicRaycaster](#classGvrPointerGraphicRaycaster_1a474a4a9575d415969414e14fce2708c3)`()` | ` ` ` `Initializes a new instance of the [GvrPointerGraphicRaycaster](/vr/reference/unity/class/GvrPointerGraphicRaycaster#classGvrPointerGraphicRaycaster) class. ` ` |\n| [PerformRaycast](#classGvrPointerGraphicRaycaster_1a9e88ea20acff6a47ebd7a9b700ffbf8a)`(`[GvrBasePointer.PointerRay](/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay)` pointerRay, float radius, PointerEventData eventData, List\u003c RaycastResult \u003e resultAppendList)` | `virtual override bool` Perform raycast on the scene. |\n\nPublic types\n------------\n\n### BlockingObjects\n\n```c#\n BlockingObjects\n``` \nTypes of blocking objects this object's raycasts can hit.\n\n| Properties ||\n|----------|-------------------------------|\n| `All` | This can hit all objects. |\n| `None` | This cannot hit any objects. |\n| `ThreeD` | This can hit only 3D objects. |\n| `TwoD` | This can hit only 2D objects. |\n\nPublic attributes\n-----------------\n\n### blockingMask\n\n```c#\nLayerMask blockingMask = NO_EVENT_MASK_SET\n``` \nThe blocking layer mask to use when raycasting. \n\n### blockingObjects\n\n```c#\nBlockingObjects blockingObjects = BlockingObjects.ThreeD\n``` \nThe type of objects which can block raycasts. \n\n### ignoreReversedGraphics\n\n```c#\nbool ignoreReversedGraphics = true\n``` \nFlag for ignoring reversed graphics direction.\n\nProperties\n----------\n\n### eventCamera\n\n```c#\noverride Camera eventCamera\n``` \nGets the event Camera used for gaze-based raycasts.\n\nThe event camera.\n\nProtected functions\n-------------------\n\n### GvrPointerGraphicRaycaster\n\n```c#\n GvrPointerGraphicRaycaster()\n``` \nInitializes a new instance of the [GvrPointerGraphicRaycaster](/vr/reference/unity/class/GvrPointerGraphicRaycaster#classGvrPointerGraphicRaycaster) class. \n\n### PerformRaycast\n\n```c#\nvirtual override bool PerformRaycast(\n GvrBasePointer.PointerRay pointerRay,\n float radius,\n PointerEventData eventData,\n List\u003c RaycastResult \u003e resultAppendList\n)\n``` \nPerform raycast on the scene.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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. | |\n| **Returns** | Returns `true` if the Raycast has at least one hit, `false` otherwise. |"]]