Struct RaycastQuery
Represents a raycast query.
Namespace: UnityEngine.XR.MagicLeap
Syntax
public struct RaycastQuery : IEquatable<RaycastQuery>
Constructors
RaycastQuery(Ray, Boolean)
Constructs a "single-point" raycast query, i.e.,
width
and height
are both 1.
Declaration
public RaycastQuery(Ray ray, bool collideWithUnobserved = false)
Parameters
Type | Name | Description |
---|---|---|
Ray | ray | The ray, in session space, to cast. |
Boolean | collideWithUnobserved | If |
RaycastQuery(Ray, Vector3, Int32, Int32, Single, Boolean)
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., |
Int32 | width | The number of horizontal rays to cast. Must be at least 1. |
Int32 | height | The number of vertical rays to cast. Must be at least 1. |
Single | horizontalFov | The horizontal field of view, in degrees. When
|
Boolean | 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 |
---|---|
ArgumentOutOfRangeException | Thrown if |
ArgumentOutOfRangeException | Thrown if |
ArgumentException | Thrown if |
ArgumentException | 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 bool collideWithUnobserved { get; }
Property Value
Type | Description |
---|---|
Boolean |
height
The number of vertical rays to cast.
Declaration
public int height { get; }
Property Value
Type | Description |
---|---|
Int32 |
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 float horizontalFov { get; }
Property Value
Type | Description |
---|---|
Single |
ray
A Ray
, in session space.
Declaration
public 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 Vector3 up { get; }
Property Value
Type | Description |
---|---|
Vector3 |
width
The number of horizontal rays to cast.
Declaration
public int width { get; }
Property Value
Type | Description |
---|---|
Int32 |
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 |
---|---|
Boolean |
|
Overrides
Equals(RaycastQuery)
IEquatable interface. Comapres for equality.
Declaration
public bool Equals(RaycastQuery other)
Parameters
Type | Name | Description |
---|---|---|
RaycastQuery | other | The RaycastQuery to compare against. |
Returns
Type | Description |
---|---|
Boolean |
|
GetHashCode()
Computes a hash code suitable for use in a Dictionary
or HashSet
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code suitable for use in a |
Overrides
Operators
Equality(RaycastQuery, RaycastQuery)
Comapres for equality. Same as Equals(RaycastQuery).
Declaration
public static bool operator ==(RaycastQuery lhs, RaycastQuery rhs)
Parameters
Type | Name | Description |
---|---|---|
RaycastQuery | lhs | The left-hand side of the comparison. |
RaycastQuery | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(RaycastQuery, RaycastQuery)
Comapres for inequality. Same as !
Equals(RaycastQuery).
Declaration
public static bool operator !=(RaycastQuery lhs, RaycastQuery rhs)
Parameters
Type | Name | Description |
---|---|---|
RaycastQuery | lhs | The left-hand side of the comparison. |
RaycastQuery | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean |
|