You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Artificial Rotator is a simulated rotator that uses no Unity
physics to rotate an object. It utilises the Rotate Transform Grab
Mechanic and simulates as much as the Physics Rotator control as
possible but without the need for joints or rigidbodies.
* `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
6655
+
6656
+
**Script Usage:**
6657
+
* Create a rotator container GameObject and set the GameObject that is to become the rotator as a child of the newly created container GameObject.
6658
+
* Place the `VRTK_ArtificialRotator` script onto the GameObject that is to become the rotatable object and ensure the Transform rotation is `0, 0, 0`.
6659
+
* Create a nested GameObject under the rotator GameObject and position it where the hinge should operate.
6660
+
* Apply the nested hinge GameObject to the `Hinge Point` parameter on the Artificial Rotator script.
6661
+
6662
+
> The rotator GameObject must not be at the root level and needs to have the Transform rotation set to `0,0,0`. This is the reason for the container GameObject requirement. Any positioning of the rotator must be set on the parent container GameObject.
6663
+
> The Artificial Rotator script GameObject will become the child of a runtime created GameObject that determines the rotational offset for the rotator.
6664
+
6665
+
### Inspector Parameters
6666
+
6667
+
* **Hinge Point:** A Transform that denotes the position where the rotator will rotate around.
6668
+
* **Minimum Angle:** The minimum angle the rotator can rotate to.
6669
+
* **Maximum Angle:** The maximum angle the rotator can rotate to.
6670
+
* **Min Max Threshold Angle:** The angle at which the rotator rotation can be within the minimum or maximum angle before the minimum or maximum angles are considered reached.
6671
+
* **Resting Angle:** The angle at which will be considered as the resting position of the rotator.
6672
+
* **Force Resting Angle Threshold:** The threshold angle from the `Resting Angle` that the current angle of the rotator needs to be within to snap the rotator back to the `Resting Angle`.
6673
+
* **Is Locked:** If this is checked then the rotator Rigidbody will have all rotations frozen.
6674
+
* **Step Value Range:** The minimum `(x)` and the maximum `(y)` step values for the rotator to register along the `Operate Axis`.
6675
+
* **Step Size:** The increments the rotator value will change in between the `Step Value Range`.
6676
+
* **Use Step As Value:** If this is checked then the value for the rotator will be the step value and not the absolute rotation of the rotator Transform.
6677
+
* **Snap To Step:** If this is checked then the rotator will snap to the angle of the nearest step along the value range.
6678
+
* **Snap Force:** The speed in which the rotator will snap to the relevant angle along the `Operate Axis`
6679
+
* **Precision Grab:** If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.
6680
+
* **Detach Distance:** The maximum distance the grabbing object is away from the rotator before it is automatically released.
6681
+
* **Rotation Action:** Determines how the rotation of the object is calculated based on the action of the grabbing object.
6682
+
* **Grabbed Friction:** The simulated friction when the rotator is grabbed.
6683
+
* **Released Friction:** The simulated friction when the rotator is released.
6684
+
* **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the rotator can be interacted with.
6685
+
6686
+
### Class Methods
6687
+
6688
+
#### GetValue/0
6689
+
6690
+
> `public override float GetValue()`
6691
+
6692
+
* Parameters
6693
+
* _none_
6694
+
* Returns
6695
+
* `float` - The actual rotation of the rotator.
6696
+
6697
+
The GetValue method returns the current rotation value of the rotator.
6698
+
6699
+
#### GetNormalizedValue/0
6700
+
6701
+
> `public override float GetNormalizedValue()`
6702
+
6703
+
* Parameters
6704
+
* _none_
6705
+
* Returns
6706
+
* `float` - The normalized rotation of the rotator.
6707
+
6708
+
The GetNormalizedValue method returns the current rotation value of the rotator normalized between `0f` and `1f`.
6709
+
6710
+
#### GetContainer/0
6711
+
6712
+
> `public virtual GameObject GetContainer()`
6713
+
6714
+
* Parameters
6715
+
* _none_
6716
+
* Returns
6717
+
* `GameObject` - The GameObject container of the rotator control.
6718
+
6719
+
The GetContainer method returns the GameObject that is generated to hold the rotator control.
@@ -7679,41 +7833,6 @@ It is possible to supply a third game object which is the root of the contents i
7679
7833
7680
7834
---
7681
7835
7682
-
## Wheel (VRTK_Wheel)
7683
-
> extends [VRTK_Control](#control-vrtk_control)
7684
-
7685
-
### Overview
7686
-
7687
-
Attaching the script to a game object will allow the user to interact with it as if it were a spinnable wheel.
7688
-
7689
-
The script will instantiate the required Rigidbody and Interactable components automatically in case they do not exist yet.
7690
-
7691
-
### Inspector Parameters
7692
-
7693
-
* **Connected To:** An optional game object to which the wheel will be connected. If the game object moves the wheel will follow along.
7694
-
* **Grab Type:** The grab attach mechanic to use. Track Object allows for rotations of the controller, Rotator Track allows for grabbing the wheel and spinning it.
7695
-
* **Detatch Distance:** The maximum distance the grabbing controller is away from the wheel before it is automatically released.
7696
-
* **Minimum Value:** The minimum value the wheel can be set to.
7697
-
* **Maximum Value:** The maximum value the wheel can be set to.
7698
-
* **Step Size:** The increments in which values can change.
7699
-
* **Snap To Step:** If this is checked then when the wheel is released, it will snap to the step rotation.
7700
-
* **Grabbed Friction:** The amount of friction the wheel will have when it is grabbed.
7701
-
* **Released Friction:** The amount of friction the wheel will have when it is released.
7702
-
* **Max Angle:** The maximum angle the wheel has to be turned to reach it's maximum value.
7703
-
* **Lock At Limits:** If this is checked then the wheel cannot be turned beyond the minimum and maximum value.
7704
-
7705
-
### Class Variables
7706
-
7707
-
* `public enum GrabTypes` - The grab attach mechanic to use.
7708
-
* `TrackObject` - Utilise the track object grab mechanic.
7709
-
* `RotatorTrack` - Utilise the rotator track grab mechanic.
7710
-
7711
-
### Example
7712
-
7713
-
`VRTK/Examples/025_Controls_Overview` has a collection of wheels that can be rotated by grabbing with the controller and then rotating the controller in the desired direction.
0 commit comments