This site has been permanently archived. The content on this site was last updated in 2019.
Stay organized with collections
Save and categorize content based on your preferences.
GvrTrackedController
Represents an object tracked by controller input.
Summary
Manages the active status of the tracked controller based on controller connection status.
Fetches a GvrControllerInputDevice
for the configured GvrControllerHand
and propagates the device instance to all IGvrControllerInputDeviceReceiver
s underneath this object on Start and if the controller handedness changes. If the controller is not positionally tracked, position of the object is updated to approximate arm mechanics by using a GvrBaseArmModel
. GvrBaseArmModel
s are also propagated to all IGvrArmModelReceiver
s underneath this object.
Inheritance
Inherits from: MonoBehaviour
Properties
|
ArmModel
|
Gets or sets an arm model.
|
ControllerHand
|
GvrControllerHand
Gets or sets the controller hand used for this tracked object.
|
ControllerInputDevice
|
Gets the controller input device for this tracked object.
|
IsDeactivatedWhenDisconnected
|
bool
Gets or sets a value indicating whether the object's active status is determined by the controller connection status.
|
Properties
ArmModel
GvrBaseArmModel ArmModel
Gets or sets an arm model.
Used to control the pose (position and rotation) of the object and to propagate to children that implement IGvrArmModelReceiver
.
An arm model used to control the pose (position and rotation) of the object, and to propagate to children that implement IGvrArmModelReceiver
.
ControllerHand
GvrControllerHand ControllerHand
Gets or sets the controller hand used for this tracked object.
The controller hand used for this tracked object.
GvrControllerInputDevice ControllerInputDevice
Gets the controller input device for this tracked object.
The controller input device for this tracked object.
IsDeactivatedWhenDisconnected
bool IsDeactivatedWhenDisconnected
Gets or sets a value indicating whether the object's active status is determined by the controller connection status.
Value true
if the object's active status is determined by the controller connection status, false
otherwise.
Public functions
PropagateArmModel
void PropagateArmModel()
Propagates the arm model to all IGvrArmModelReceiver
s.
Should only called when ArmModel is instantiated or changed.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[null,null,["Last updated 2024-10-09 UTC."],[[["\u003cp\u003e\u003ccode\u003eGvrTrackedController\u003c/code\u003e represents a game object tracked by VR controller input, managing its active state based on the controller's connection.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes a \u003ccode\u003eGvrBaseArmModel\u003c/code\u003e to approximate arm movement if the controller lacks positional tracking and propagates it to relevant child objects.\u003c/p\u003e\n"],["\u003cp\u003eThe controller hand can be specified, and its input device is accessible through the \u003ccode\u003eControllerInputDevice\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThis class also propagates the device instance to all \u003ccode\u003eIGvrControllerInputDeviceReceiver\u003c/code\u003e components under it.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eArmModel\u003c/code\u003e property allows controlling the object's pose and propagating it to child objects implementing \u003ccode\u003eIGvrArmModelReceiver\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `GvrTrackedController` manages a tracked object's status based on controller connectivity. It fetches and provides a `GvrControllerInputDevice` to `IGvrControllerInputDeviceReceiver`s. If the controller lacks positional tracking, it uses a `GvrBaseArmModel` to approximate arm mechanics, also propagating this to `IGvrArmModelReceiver`s. It offers properties for `ArmModel`, `ControllerHand`, `ControllerInputDevice`, and connection status-based deactivation. The `PropagateArmModel` function updates all `IGvrArmModelReceiver`s with the current arm model.\n"],null,["# GvrTrackedController Class Reference\n\nGvrTrackedController\n====================\n\nRepresents an object tracked by controller input.\n\nSummary\n-------\n\nManages the active status of the tracked controller based on controller connection status.\n\nFetches a [GvrControllerInputDevice](/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice) for the configured `GvrControllerHand` and propagates the device instance to all [IGvrControllerInputDeviceReceiver](/vr/reference/unity/interface/IGvrControllerInputDeviceReceiver#interfaceIGvrControllerInputDeviceReceiver)s underneath this object on Start and if the controller handedness changes. If the controller is not positionally tracked, position of the object is updated to approximate arm mechanics by using a [GvrBaseArmModel](/vr/reference/unity/class/GvrBaseArmModel#classGvrBaseArmModel). [GvrBaseArmModel](/vr/reference/unity/class/GvrBaseArmModel#classGvrBaseArmModel)s are also propagated to all [IGvrArmModelReceiver](/vr/reference/unity/interface/IGvrArmModelReceiver#interfaceIGvrArmModelReceiver)s underneath this object.\n\n### Inheritance\n\nInherits from: MonoBehaviour\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ArmModel](#classGvrTrackedController_1a0d8b8e035ec00a38b7f315bfb5a1766b) | [GvrBaseArmModel](/vr/reference/unity/class/GvrBaseArmModel#classGvrBaseArmModel) Gets or sets an arm model. |\n| [ControllerHand](#classGvrTrackedController_1ad2401c057b484b21554eebc344e1b6cd) | `GvrControllerHand` Gets or sets the controller hand used for this tracked object. |\n| [ControllerInputDevice](#classGvrTrackedController_1af85f2ee3e55dcb9b1e6ca49d8b3b96ec) | [GvrControllerInputDevice](/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice) Gets the controller input device for this tracked object. |\n| [IsDeactivatedWhenDisconnected](#classGvrTrackedController_1ab3ecdf0f20d91277110806c562a9a29e) | `bool` Gets or sets a value indicating whether the object's active status is determined by the controller connection status. |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PropagateArmModel](#classGvrTrackedController_1a4546a3231312e8cd15a64cff256bbb68)`()` | `void` Propagates the arm model to all [IGvrArmModelReceiver](/vr/reference/unity/interface/IGvrArmModelReceiver#interfaceIGvrArmModelReceiver)s. |\n\nProperties\n----------\n\n### ArmModel\n\n```c#\nGvrBaseArmModel ArmModel\n``` \nGets or sets an arm model.\n\nUsed to control the pose (position and rotation) of the object and to propagate to children that implement [IGvrArmModelReceiver](/vr/reference/unity/interface/IGvrArmModelReceiver#interfaceIGvrArmModelReceiver).\n\nAn arm model used to control the pose (position and rotation) of the object, and to propagate to children that implement [IGvrArmModelReceiver](/vr/reference/unity/interface/IGvrArmModelReceiver#interfaceIGvrArmModelReceiver). \n\n### ControllerHand\n\n```c#\nGvrControllerHand ControllerHand\n``` \nGets or sets the controller hand used for this tracked object.\n\nThe controller hand used for this tracked object. \n\n### ControllerInputDevice\n\n```c#\nGvrControllerInputDevice ControllerInputDevice\n``` \nGets the controller input device for this tracked object.\n\nThe controller input device for this tracked object. \n\n### IsDeactivatedWhenDisconnected\n\n```c#\nbool IsDeactivatedWhenDisconnected\n``` \nGets or sets a value indicating whether the object's active status is determined by the controller connection status.\n\nValue `true` if the object's active status is determined by the controller connection status, `false` otherwise.\n\nPublic functions\n----------------\n\n### PropagateArmModel\n\n```c#\nvoid PropagateArmModel()\n``` \nPropagates the arm model to all [IGvrArmModelReceiver](/vr/reference/unity/interface/IGvrArmModelReceiver#interfaceIGvrArmModelReceiver)s.\n\nShould only called when ArmModel is instantiated or changed."]]