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.
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
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()
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
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.
|
|
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\u003eGvrBasePointerRaycaster is an abstract class providing shared functionality for all Gvr raycasters, inheriting from BaseRaycaster.\u003c/p\u003e\n"],["\u003cp\u003eIt offers functionalities like performing raycasts on the scene, getting the last ray created, and determining the current raycasting mode.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize its \u003ccode\u003ePerformRaycast\u003c/code\u003e function to implement custom raycasting logic within their derived classes.\u003c/p\u003e\n"],["\u003cp\u003eThe class exposes properties like \u003ccode\u003eCurrentRaycastModeForHybrid\u003c/code\u003e to control the raycasting behavior.\u003c/p\u003e\n"],["\u003cp\u003eIt's the base class for GvrPointerGraphicRaycaster and GvrPointerPhysicsRaycaster, facilitating interactions with UI elements and physics objects respectively.\u003c/p\u003e\n"]]],["`GvrBasePointerRaycaster` is an abstract class for raycasting, inheriting from `BaseRaycaster`. Key actions include initializing the raycaster, performing raycasts, and retrieving the last created ray. `PerformRaycast` conducts raycasting with a specified ray, radius, event data, and a list to append results, returning a boolean indicating hits. `Raycast` performs scene raycasting and populates a list with results. `GetLastRay` fetches the last generated ray. It also features a property to get the mode used for raycasting.\n"],null,["# GvrBasePointerRaycaster Class Reference\n\nGvrBasePointerRaycaster\n=======================\n\n**This is an abstract class.** \n\nThis script provides shared functionality used by all Gvr raycasters.\n\nSummary\n-------\n\n### Inheritance\n\nInherits from: BaseRaycaster \nDirect Known Subclasses:[GvrPointerGraphicRaycaster](/vr/reference/unity/class/GvrPointerGraphicRaycaster), [GvrPointerPhysicsRaycaster](/vr/reference/unity/class/GvrPointerPhysicsRaycaster)\n\n| ### Properties ||\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CurrentRaycastModeForHybrid](#classGvrBasePointerRaycaster_1a9c9e3439ba814f049b385b28c7efb760) | [GvrBasePointer.RaycastMode](/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe) Gets the mode used for raycasting. |\n\n| ### Protected functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GvrBasePointerRaycaster](#classGvrBasePointerRaycaster_1a995723a818f34be673086bfa3858f3d1)`()` | ` ` ` `Initializes a new instance of the [GvrBasePointerRaycaster](/vr/reference/unity/class/GvrBasePointerRaycaster#classGvrBasePointerRaycaster) class. ` ` |\n| [PerformRaycast](#classGvrBasePointerRaycaster_1a37465d7b96d84970874d404916b0fb4e)`(`[GvrBasePointer.PointerRay](/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay)` pointerRay, float radius, PointerEventData eventData, List\u003c RaycastResult \u003e resultAppendList)` | `virtual abstract bool` Perform raycast on the scene. |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GetLastRay](#classGvrBasePointerRaycaster_1a5b697f9d854eb1e77eecc81451e2a891)`()` | [GvrBasePointer.PointerRay](/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay) Gets the last ray created. |\n| [Raycast](#classGvrBasePointerRaycaster_1a24012d583650dbd92a8edc8b36503df7)`(PointerEventData eventData, List\u003c RaycastResult \u003e resultAppendList)` | `override void` Raycast against the scene. |\n\nProperties\n----------\n\n### CurrentRaycastModeForHybrid\n\n```c#\nGvrBasePointer.RaycastMode CurrentRaycastModeForHybrid\n``` \nGets the mode used for raycasting.\n\nThe mode used for raycasting.\n\nProtected functions\n-------------------\n\n### GvrBasePointerRaycaster\n\n```c#\n GvrBasePointerRaycaster()\n``` \nInitializes a new instance of the [GvrBasePointerRaycaster](/vr/reference/unity/class/GvrBasePointerRaycaster#classGvrBasePointerRaycaster) class. \n\n### PerformRaycast\n\n```c#\nvirtual abstract 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. |\n\nPublic functions\n----------------\n\n### GetLastRay\n\n```c#\nGvrBasePointer.PointerRay GetLastRay()\n``` \nGets the last ray created.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-----------------------|\n| **Returns** | The last ray created. |\n\n### Raycast\n\n```c#\noverride void Raycast(\n PointerEventData eventData,\n List\u003c RaycastResult \u003e resultAppendList\n)\n``` \nRaycast against the scene.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------------|-----------------------------------------------------| | `eventData` | The pointer event data. | | `resultAppendList` | The result of the raycast is appended to this list. | |"]]