Struct AsyncRaycastResult
Represents a Magic Leap asynchronous raycast result. The result must be created using AsyncRaycast(RaycastQuery). This API may be used from other threads.
Namespace: UnityEngine.XR.MagicLeap
Syntax
public struct AsyncRaycastResult : IEquatable<AsyncRaycastResult>
Properties
confidence
The confidence of the result in the range 0..1, where 0 indicates low confidence and 1 is high confidence.
Declaration
public float confidence { get; }
Property Value
Type | Description |
---|---|
Single |
pose
The pose of the raycast. The normal of the surface that was hit can be computed with pose.up
.
Only valid if state is SuccessHitObserved or SuccessHitUnobserved.
Declaration
public Pose pose { get; }
Property Value
Type | Description |
---|---|
Pose |
state
The state of the raycasts, e.g. whether it was successful, pending, or incountered an error. If the state is anything other than SuccessHitObserved or SuccessHitUnobserved, then the other values in this struct are meaningless.
Declaration
public RaycastResultState state { get; }
Property Value
Type | Description |
---|---|
RaycastResultState |
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(AsyncRaycastResult)
IEquatable interface. Comapres for equality.
Declaration
public bool Equals(AsyncRaycastResult other)
Parameters
Type | Name | Description |
---|---|---|
AsyncRaycastResult | other | The AsyncRaycastResult 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
ToString()
Generates a string representation of the raycast result of the form "{state}: pose {pose} with confidence {confidence}"
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representation of the raycast result of the form "{state}: pose {pose} with confidence {confidence}" |
Overrides
Operators
Equality(AsyncRaycastResult, AsyncRaycastResult)
Comapres for equality. Same as Equals(AsyncRaycastResult).
Declaration
public static bool operator ==(AsyncRaycastResult lhs, AsyncRaycastResult rhs)
Parameters
Type | Name | Description |
---|---|---|
AsyncRaycastResult | lhs | The left-hand side of the comparison. |
AsyncRaycastResult | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(AsyncRaycastResult, AsyncRaycastResult)
Comapres for inequality. Same as !
Equals(AsyncRaycastResult).
Declaration
public static bool operator !=(AsyncRaycastResult lhs, AsyncRaycastResult rhs)
Parameters
Type | Name | Description |
---|---|---|
AsyncRaycastResult | lhs | The left-hand side of the comparison. |
AsyncRaycastResult | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean |
|