Skip to content

Commit

Permalink
feat(prefab): provide dominant controller alias
Browse files Browse the repository at this point in the history
The dominant controller alias is now part of the TrackedAlias Aliases
collection and will track the position/orientation of whatever the
current dominant controller is.

This can be used to set up tracking objects to whatever the dominant
controller is rather than having to always use the left/right
controller.

There are also new events that are raised when the left/right
controller become dominant or when the headset becomes the dominant
controller.

Additional Facade properties for dominant controller data has also
been added for completeness.
  • Loading branch information
thestonefox committed Mar 22, 2022
1 parent 965943b commit 71ddef5
Show file tree
Hide file tree
Showing 5 changed files with 1,182 additions and 112 deletions.
52 changes: 52 additions & 0 deletions Documentation/API/TrackedAliasConfigurator.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Sets up the Tracked Alias Prefab based on the provided user settings.
* [RightControllerTrackingBegunEventHandler]
* [RightControllerTrackingTypeChangedEventHandler]
* [Properties]
* [DominantController]
* [DominantControllerVelocityTrackers]
* [Facade]
* [Headset]
* [HeadsetOrigin]
Expand All @@ -57,8 +59,10 @@ Sets up the Tracked Alias Prefab based on the provided user settings.
* [NotifyLeftControllerTrackingBegun()]
* [NotifyRightControllerTrackingBegun()]
* [NotifyTrackedAliasChanged(GameObject)]
* [OnDisable()]
* [OnEnable()]
* [SetUpCameraRigsConfiguration()]
* [SetUpDominantTracking(DeviceDetailsRecord)]
* [SubscribeToDetailsEvents()]
* [UnsubscribeToDetailsEvents()]

Expand Down Expand Up @@ -353,6 +357,26 @@ protected UnityAction<DeviceDetailsRecord.SpatialTrackingType> RightControllerTr

### Properties

#### DominantController

The ObjectFollower component for the current Dominant Controller.

##### Declaration

```
public ObjectFollower DominantController { get; protected set; }
```

#### DominantControllerVelocityTrackers

The VelocityTrackerProcessor component containing the current Dominant Controller Velocity Trackers.

##### Declaration

```
public VelocityTrackerProcessor DominantControllerVelocityTrackers { get; protected set; }
```

#### Facade

The public facade.
Expand Down Expand Up @@ -625,6 +649,14 @@ public virtual void NotifyTrackedAliasChanged(GameObject _)
| --- | --- | --- |
| GameObject | \_ | n/a |

#### OnDisable()

##### Declaration

```
protected virtual void OnDisable()
```

#### OnEnable()

##### Declaration
Expand All @@ -643,6 +675,22 @@ Sets up the TrackedAlias prefab with the specified settings.
public virtual void SetUpCameraRigsConfiguration()
```

#### SetUpDominantTracking(DeviceDetailsRecord)

Sets up the dominant controller alias tracking.

##### Declaration

```
public virtual void SetUpDominantTracking(DeviceDetailsRecord dominantRecord)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| DeviceDetailsRecord | dominantRecord | The current dominant controller record. |

#### SubscribeToDetailsEvents()

Subscribe to the events of each DeviceDetailsRecord.
Expand Down Expand Up @@ -698,6 +746,8 @@ protected virtual void UnsubscribeToDetailsEvents()
[RightControllerTrackingBegunEventHandler]: #RightControllerTrackingBegunEventHandler
[RightControllerTrackingTypeChangedEventHandler]: #RightControllerTrackingTypeChangedEventHandler
[Properties]: #Properties
[DominantController]: #DominantController
[DominantControllerVelocityTrackers]: #DominantControllerVelocityTrackers
[Facade]: #Facade
[Headset]: #Headset
[HeadsetOrigin]: #HeadsetOrigin
Expand All @@ -719,7 +769,9 @@ protected virtual void UnsubscribeToDetailsEvents()
[NotifyLeftControllerTrackingBegun()]: #NotifyLeftControllerTrackingBegun
[NotifyRightControllerTrackingBegun()]: #NotifyRightControllerTrackingBegun
[NotifyTrackedAliasChanged(GameObject)]: #NotifyTrackedAliasChangedGameObject
[OnDisable()]: #OnDisable
[OnEnable()]: #OnEnable
[SetUpCameraRigsConfiguration()]: #SetUpCameraRigsConfiguration
[SetUpDominantTracking(DeviceDetailsRecord)]: #SetUpDominantTrackingDeviceDetailsRecord
[SubscribeToDetailsEvents()]: #SubscribeToDetailsEvents
[UnsubscribeToDetailsEvents()]: #UnsubscribeToDetailsEvents
Loading

0 comments on commit 71ddef5

Please sign in to comment.