Struct XrPosef
A construct representing a position and orientation within a space, with position expressed in meters, and orientation represented as a unit quaternion. OpenXR Spec
Implements
Inherited Members
Namespace: UnityEngine.XR.OpenXR.NativeTypes
Assembly: Unity.XR.OpenXR.dll
Syntax
public struct XrPosef : IEquatable<XrPosef>
Constructors
XrPosef(Pose)
Construct an instance from a pose
in Unity space relative to your XR Origin.
Declaration
public XrPosef(Pose pose)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose in Unity space relative to your XR Origin. |
Remarks
Important
This constructor negates the position z
value and the rotation x
and y
values to convert from
Unity's left-handed coordinate system to the right-handed system used by OpenXR.
XrPosef(Vector3, Quaternion)
Construct an instance from a position and rotation in Unity space relative to your XR Origin.
Declaration
public XrPosef(Vector3 vec3, Quaternion quaternion)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vec3 | The position in Unity space relative to your XR Origin. |
Quaternion | quaternion | The rotation in Unity space relative to your XR Origin. |
Remarks
Important
This constructor negates the position z
value and the rotation x
and y
values to convert from
Unity's left-handed coordinate system to the right-handed system used by OpenXR.
Fields
Orientation
The orientation/rotation of the pose.
Declaration
public XrQuaternionf Orientation
Field Value
Type | Description |
---|---|
XrQuaternionf |
Position
The position of the pose.
Declaration
public XrVector3f Position
Field Value
Type | Description |
---|---|
XrVector3f |
Methods
Equals(object)
Compares for equality.
Two instances are equal if their bits are exactly identical for the Orientation
and Position
fields.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The other object. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Equals(XrPosef)
Compares for equality.
Two instances are equal if their bits are exactly identical for the Orientation
and Position
fields.
Declaration
public bool Equals(XrPosef other)
Parameters
Type | Name | Description |
---|---|---|
XrPosef | other | The other instance. |
Returns
Type | Description |
---|---|
bool |
|
FromSessionSpaceCoordinates(Pose)
Construct an instance from a pose in session space. This method applies no transformations to the input values.
Declaration
public static XrPosef FromSessionSpaceCoordinates(Pose pose)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose in session space. |
Returns
Type | Description |
---|---|
XrPosef | The instance. |
FromSessionSpaceCoordinates(Vector3, Quaternion)
Construct an instance from a position and rotation in session space. This method applies no transformations to the input values.
Declaration
public static XrPosef FromSessionSpaceCoordinates(Vector3 position, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position in session space. |
Quaternion | rotation | The rotation in session space. |
Returns
Type | Description |
---|---|
XrPosef | The instance. |
GetHashCode()
Generates a unique hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code. |
Overrides
ToSessionSpacePose()
Convert this instance to a Unity Pose
. This method applies no transformation to
Position or Orientation.
Declaration
public Pose ToSessionSpacePose()
Returns
Type | Description |
---|---|
Pose | The |