Class TwoHandedGrabMoveProvider
Allows the user to combine two GrabMoveProvider instances for locomotion. This allows the user to translate, scale, and rotate themselves counter to transformations of the line segment between both hands.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[DefaultExecutionOrder(-209)]
[AddComponentMenu("XR/Locomotion/Two-Handed Grab Move Provider", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@2.4/api/UnityEngine.XR.Interaction.Toolkit.TwoHandedGrabMoveProvider.html")]
public class TwoHandedGrabMoveProvider : ConstrainedMoveProvider
Properties
enableRotation
Controls whether to enable yaw rotation of the user.
Declaration
public bool enableRotation { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
enableScaling
Controls whether to enable uniform scaling of the user.
Declaration
public bool enableScaling { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
leftGrabMoveProvider
The left hand grab move instance which will be used as one half of two-handed locomotion.
Declaration
public GrabMoveProvider leftGrabMoveProvider { get; set; }
Property Value
| Type | Description |
|---|---|
| GrabMoveProvider |
maximumScale
The maximum user scale allowed.
Declaration
public float maximumScale { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
minimumScale
The minimum user scale allowed.
Declaration
public float minimumScale { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
moveFactor
The ratio of actual movement distance to controller movement distance.
Declaration
public float moveFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
overrideSharedSettingsOnInit
Controls whether to override the settings for individual handed providers with this provider's settings on initialization.
Declaration
public bool overrideSharedSettingsOnInit { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
requireTwoHandsForTranslation
Controls whether translation requires both grab move inputs to be active.
Declaration
public bool requireTwoHandsForTranslation { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
rightGrabMoveProvider
The right hand grab move instance which will be used as one half of two-handed locomotion.
Declaration
public GrabMoveProvider rightGrabMoveProvider { get; set; }
Property Value
| Type | Description |
|---|---|
| GrabMoveProvider |
Methods
ComputeDesiredMove(out Boolean)
Determines how much to move the rig.
Declaration
protected override Vector3 ComputeDesiredMove(out bool attemptingMove)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | attemptingMove | Whether the provider is attempting to move. |
Returns
| Type | Description |
|---|---|
| Vector3 | Returns the translation amount in world space to move the rig. |
Overrides
OnDisable()
See MonoBehaviour.
Declaration
protected void OnDisable()
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()