November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

Pose3D

Encapsulates a rotation and a translation.

Summary

This is a convenience class that allows construction and value access either by Matrix4x4 or Quaternion + Vector3 types.

Inheritance

Direct Known Subclasses:MutablePose3D

Constructors and Destructors

Pose3D()
Initializes a new instance of the Pose3D class.
Pose3D(Vector3 position, Quaternion orientation)
Initializes a new instance of the Pose3D class.
Pose3D(Matrix4x4 matrix)
Initializes a new instance of the Pose3D class.

Public static attributes

FLIP_Z = Matrix4x4.Scale(new Vector3(1, 1, -1))
readonly Matrix4x4
Right-handed to left-handed matrix converter (and vice versa).

Properties

Matrix
Matrix4x4
Gets or sets the pose as a matrix in Unity gameobject convention.
Orientation
Quaternion
Gets or sets the rotation component of the pose.
Position
Vector3
Gets or sets the translation component of the pose.
RightHandedMatrix
Matrix4x4
Gets the pose as a matrix in right-handed coordinates.

Public static functions

FlipHandedness(Matrix4x4 matrix)
Matrix4x4
Flip the handedness of a matrix.

Protected functions

Set(Vector3 position, Quaternion orientation)
void
Sets a Pose3D according to the provided values.
Set(Matrix4x4 matrix)
void
Sets a Pose3D according to the provided values.

Public static attributes

FLIP_Z

readonly Matrix4x4 FLIP_Z = Matrix4x4.Scale(new Vector3(1, 1, -1))

Right-handed to left-handed matrix converter (and vice versa).

Properties

Matrix

Matrix4x4 Matrix

Gets or sets the pose as a matrix in Unity gameobject convention.

GVR contention is right-handed, while Unity convention is left-handed.

The pose as a matrix in Unity gameobject convention.

Orientation

Quaternion Orientation

Gets or sets the rotation component of the pose.

The rotation component of the pose.

Position

Vector3 Position

Gets or sets the translation component of the pose.

The translation component of the pose.

RightHandedMatrix

Matrix4x4 RightHandedMatrix

Gets the pose as a matrix in right-handed coordinates.

The pose as a matrix in right-handed coordinates.

Public functions

Pose3D

 Pose3D()

Initializes a new instance of the Pose3D class.

Initializes position to the origin and orientation to the identity rotation.

Pose3D

 Pose3D(
  Vector3 position,
  Quaternion orientation
)

Initializes a new instance of the Pose3D class.

Details
Parameters
position
The position to initialize.
orientation
The orientation to initialize.

Pose3D

 Pose3D(
  Matrix4x4 matrix
)

Initializes a new instance of the Pose3D class.

Details
Parameters
matrix
The matrix to initialize.

Public static functions

FlipHandedness

Matrix4x4 FlipHandedness(
  Matrix4x4 matrix
)

Flip the handedness of a matrix.

Details
Parameters
matrix
The Matrix4x4 to flip.
Returns
A handedness-flipped Matrix4x4.

Protected functions

Set

void Set(
  Vector3 position,
  Quaternion orientation
)

Sets a Pose3D according to the provided values.

Details
Parameters
position
The position to set.
orientation
The orientation to set.

Set

void Set(
  Matrix4x4 matrix
)

Sets a Pose3D according to the provided values.

Details
Parameters
matrix
The matrix to set.