Class XRRig
(Deprecated) The XR Rig component is typically attached to the base object of the XR Rig, and stores the GameObject that will be manipulated via locomotion. It is also used for offsetting the camera.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("")]
[DisallowMultipleComponent]
[Obsolete("XRRig has been deprecated. Use the XROrigin component instead.")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.XRRig.html")]
public class XRRig : XROrigin
Properties
cameraFloorOffsetObject
(Deprecated) The GameObject to move to desired height off the floor (defaults to this object if none provided). This is used to transform the XR device from camera space to XR Origin space.
Declaration
[Obsolete("cameraFloorOffsetObject has been deprecated. Use CameraFloorOffsetObject instead.")]
public GameObject cameraFloorOffsetObject { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
cameraGameObject
(Deprecated) The GameObject that contains the camera, this is usually the "Head" of XR rigs.
Declaration
[Obsolete("cameraGameObject has been deprecated. Use Camera instead for similar functionality.")]
public GameObject cameraGameObject { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
cameraInRigSpaceHeight
(Deprecated) (Read Only) The camera's height relative to the rig.
Declaration
[Obsolete("cameraInRigSpaceHeight has been deprecated. Use CameraInOriginSpaceHeight instead.")]
public float cameraInRigSpaceHeight { get; }
Property Value
Type | Description |
---|---|
Single |
cameraInRigSpacePos
(Deprecated) (Read Only) The camera's local position in rig space.
Declaration
[Obsolete("cameraInRigSpacePos has been deprecated. Use CameraInOriginSpacePos instead.")]
public Vector3 cameraInRigSpacePos { get; }
Property Value
Type | Description |
---|---|
Vector3 |
cameraYOffset
(Deprecated) Camera height to be used when in Device
Tracking Origin Mode to define the height of the user from the floor.
This is the amount that the camera is offset from the floor when moving the CameraFloorOffsetObject.
Declaration
[Obsolete("cameraYOffset has been deprecated. Use CameraYOffset instead.")]
public float cameraYOffset { get; set; }
Property Value
Type | Description |
---|---|
Single |
currentTrackingOriginMode
(Deprecated) (Read Only) The Tracking Origin Mode of this XR Origin.
Declaration
[Obsolete("currentTrackingOriginMode has been deprecated. Use CurrentTrackingOriginMode instead.")]
public TrackingOriginModeFlags currentTrackingOriginMode { get; }
Property Value
Type | Description |
---|---|
TrackingOriginModeFlags |
See Also
requestedTrackingOriginMode
(Deprecated) The type of tracking origin to use for this XROrigin. Tracking origins identify where (0, 0, 0) is in the world of tracking. Not all devices support all tracking origin modes.
Declaration
[Obsolete("requestedTrackingOriginMode has been deprecated. Use RequestedTrackingOriginMode instead.")]
public XROrigin.TrackingOriginMode requestedTrackingOriginMode { get; set; }
Property Value
Type | Description |
---|---|
XROrigin.TrackingOriginMode |
See Also
rig
(Deprecated) The "Rig" GameObject is used to refer to the base of the XR Rig, by default it is this GameObject. This is the GameObject that will be manipulated via locomotion.
Declaration
[Obsolete("rig has been deprecated. Use Origin instead.")]
public GameObject rig { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
rigInCameraSpacePos
(Deprecated) (Read Only) The rig's local position in camera space.
Declaration
[Obsolete("rigInCameraSpacePos has been deprecated. Use OriginInCameraSpacePos instead.")]
public Vector3 rigInCameraSpacePos { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Methods
Awake()
See MonoBehaviour.Awake
.
Declaration
protected void Awake()
MatchRigUp(Vector3)
(Deprecated) This function will rotate the rig object such that the rig's up vector will match the provided vector.
Declaration
[Obsolete("MatchRigUp has been deprecated. Use MatchOriginUp instead.")]
public bool MatchRigUp(Vector3 destinationUp)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | destinationUp | the vector to which the rig object's up vector will be matched. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the rotation is performed or the vectors have already been matched. Otherwise, returns false. |
MatchRigUpCameraForward(Vector3, Vector3)
(Deprecated) This function will rotate the rig object around the camera object using the destinationUp
vector such that:
- The camera will look at the area in the direction of
destinationForward
- The projection of camera's forward vector on the plane with the normal
destinationUp
will be in the direction ofdestinationForward
- The up vector of the rig object will match the provided
destinationUp
vector (note that the camera's Up vector can not be manipulated)
Declaration
[Obsolete("MatchRigUpCameraForward has been deprecated. Use MatchOriginUpCameraForward instead.")]
public bool MatchRigUpCameraForward(Vector3 destinationUp, Vector3 destinationForward)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | destinationUp | The up vector that the rig's up vector will be matched to. |
Vector3 | destinationForward | The forward vector that will be matched to the projection of the camera's forward vector on the plane with the normal |
Returns
Type | Description |
---|---|
Boolean | Returns true if the rotation is performed. Otherwise, returns false. |
MatchRigUpRigForward(Vector3, Vector3)
(Deprecated) This function will rotate the rig object around the camera object using the destinationUp
vector such that:
- The forward vector of the rig object, which is the direction the player moves in Unity when walking forward in the physical world, will match the provided
destinationUp
vector - The up vector of the rig object will match the provided
destinationUp
vector
Declaration
[Obsolete("MatchRigUpRigForward has been deprecated. Use MatchOriginUpOriginForward instead.")]
public bool MatchRigUpRigForward(Vector3 destinationUp, Vector3 destinationForward)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | destinationUp | The up vector that the rig's up vector will be matched to. |
Vector3 | destinationForward | The forward vector that will be matched to the forward vector of the rig object, which is the direction the player moves in Unity when walking forward in the physical world. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the rotation is performed. Otherwise, returns false. |
RotateAroundCameraUsingRigUp(Single)
(Deprecated) Rotates the rig object around the camera object by the provided angleDegrees
.
This rotation only occurs around the rig's Up vector
Declaration
[Obsolete("RotateAroundCameraUsingRigUp has been deprecated. Use RotateAroundCameraUsingOriginUp instead.")]
public bool RotateAroundCameraUsingRigUp(float angleDegrees)
Parameters
Type | Name | Description |
---|---|---|
Single | angleDegrees | The amount of rotation in degrees. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the rotation is performed. Otherwise, returns false. |