Class ImmersiveRaycastUtility
This is a static utility class which which handles raycasting out into an immersive scene and finding the object that was hit. There are methods for both 2D and 3D raycasting. Additionally these methods take into accound ImmersiveInputPriority components on the objects that are hit. This allows you to prioritize which object is hit when multiple objects are in the raycast path.
Inheritance
System.Object
ImmersiveRaycastUtility
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Immersive.Input
Assembly: cs.temp.dll.dll
Syntax
public static class ImmersiveRaycastUtility
Methods
Raycast2D(UnityEngine.Camera, Vector2, out RaycastHit2D)
Declaration
public static bool Raycast2D(UnityEngine.Camera camera, Vector2 viewportPosition, out RaycastHit2D hit2D)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Camera | camera | |
| Vector2 | viewportPosition | |
| RaycastHit2D | hit2D |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Raycast3D(UnityEngine.Camera, Vector2, out RaycastHit, Single)
Declaration
public static bool Raycast3D(UnityEngine.Camera camera, Vector2 viewportPosition, out RaycastHit hit, float maxDistance = default(float))
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Camera | camera | |
| Vector2 | viewportPosition | |
| RaycastHit | hit | |
| System.Single | maxDistance |
Returns
| Type | Description |
|---|---|
| System.Boolean |