Struct RaycastQuery
Represents a raycast query.
Implements
Inherited Members
Namespace: UnityEngine .XR.MagicLeap
Assembly: UnityEngine.XR.MagicLeap.dll
Syntax
public struct RaycastQuery : IEquatable<RaycastQuery>
Constructors
RaycastQuery(Ray, bool)
Declaration
public RaycastQuery(Ray ray, bool collideWithUnobserved = false)
Parameters
Type | Name | Description |
---|---|---|
Ray | ray | The ray, in session space, to cast. |
bool | collideWithUnobserved | If |
RaycastQuery(Ray, Vector3, int, int, float, bool)
Constructs a raycast query.
Declaration
public RaycastQuery(Ray ray, Vector3 up, int width, int height, float horizontalFov, bool collideWithUnobserved)
Parameters
Type | Name | Description |
---|---|---|
Ray | ray | The ray, in session space, to cast. |
Vector3 | up | If multiple rays are to be fired (i.e., |
int | width | The number of horizontal rays to cast. Must be at least 1. |
int | height | The number of vertical rays to cast. Must be at least 1. |
float | horizontalFov | The horizontal field of view, in degrees. When
|
bool | collideWithUnobserved | If |
Remarks
If width
or height
are greater than 1,
width * height
rays are cast from the ray
origin within a frustum defined
by horizontalFov
and up
.
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |
Argument |
Thrown if |
Argument |
Thrown if |
Argument |
Thrown if |
Properties
collideWithUnobserved
If true
, a ray will temrinate when encountering an
unobserved area and return a surface or the ray will continue until
it ends or hits an observed surface.
Declaration
public readonly bool collideWithUnobserved { get; }
Property Value
Type | Description |
---|---|
bool |
height
The number of vertical rays to cast.
Declaration
public readonly int height { get; }
Property Value
Type | Description |
---|---|
int |
horizontalFov
The horizontal field of view, in degrees. When width or height are greater than 1, this is used to determine the frustum in which to cast multiple rays.
Declaration
public readonly float horizontalFov { get; }
Property Value
Type | Description |
---|---|
float |
ray
A Ray
, in session space.
Declaration
public readonly Ray ray { get; }
Property Value
Type | Description |
---|---|
Ray |
up
If multiple rays are to be fired (i.e., width or height are greater than 1), this is used to determine the coordinate system used to calculate the directions of those rays; therefore must be orthogonal to the direction vector. This parameter is has no effect on a single-point raycast.
Declaration
public readonly Vector3 up { get; }
Property Value
Type | Description |
---|---|
Vector3 |
width
The number of horizontal rays to cast.
Declaration
public readonly int width { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Equals(object)
IEquatable interface. Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare for equality. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Equals(RaycastQuery)
IEquatable interface. Comapres for equality.
Declaration
public bool Equals(RaycastQuery other)
Parameters
Type | Name | Description |
---|---|---|
Raycast |
other | The Raycast |
Returns
Type | Description |
---|---|
bool |
|
GetHashCode()
Computes a hash code suitable for use in a Dictionary
or HashSet
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code suitable for use in a |
Overrides
Operators
operator ==(RaycastQuery, RaycastQuery)
Comapres for equality. Same as Equals(Raycast
Declaration
public static bool operator ==(RaycastQuery lhs, RaycastQuery rhs)
Parameters
Type | Name | Description |
---|---|---|
Raycast |
lhs | The left-hand side of the comparison. |
Raycast |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(RaycastQuery, RaycastQuery)
Comapres for inequality. Same as !
Equals(Raycast
Declaration
public static bool operator !=(RaycastQuery lhs, RaycastQuery rhs)
Parameters
Type | Name | Description |
---|---|---|
Raycast |
lhs | The left-hand side of the comparison. |
Raycast |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|