Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
13b8539
FIX: Corrected behaviour of TrackedPoseDriver when no device is conne…
ekcoh Jan 29, 2024
726b6ff
Updated CHANGELOG.md
ekcoh Jan 29, 2024
de77ca0
Merge branch 'develop' into isxb-699-trackedposedriver-fix
ekcoh Jan 30, 2024
6719109
modified suggested fix
smnwttbr Oct 31, 2024
4be0fee
Merge branch 'develop' into isxb-699-trackedposedriver-fix
smnwttbr Oct 31, 2024
62f8fef
format fix
smnwttbr Nov 5, 2024
fa06189
Updated CHANGELOG.md
ekcoh Jan 29, 2024
d6647bd
Merge branch 'develop' into isxb-699-trackedposedriver-fix
smnwttbr Nov 7, 2024
e625ed9
Merge branch 'develop' into isxb-699-trackedposedriver-fix
ekcoh Feb 17, 2025
70d7db9
Update CHANGELOG.md
ekcoh Feb 17, 2025
639ea04
Merge branch 'develop' into isxb-699-trackedposedriver-fix
ekcoh Feb 20, 2025
afcd5c6
Fixed typo in CHANGELOG
ekcoh Feb 20, 2025
6e51bf9
Removed TODO, simplified logic evaluations by using locals
ekcoh Feb 20, 2025
e4ad3d7
Corrected a typo in comment
ekcoh Feb 20, 2025
c0b3418
Fixed formatting
ekcoh Feb 20, 2025
48485d3
Modified solution to only enable position and/or rotation in tracking…
ekcoh Feb 21, 2025
fa2b8f1
Changed test name and comments
ekcoh Feb 21, 2025
7260a9b
Removed redundant check
ekcoh Feb 25, 2025
6b5c6a2
Addressed review feedback and changed formatting for increased readab…
ekcoh Feb 27, 2025
8e9109b
Merge branch 'develop' into isxb-699-trackedposedriver-fix
ekcoh Feb 27, 2025
450c546
Update Assets/Tests/InputSystem/Plugins/XRTests.cs
ekcoh Feb 28, 2025
cd71e2d
Update Assets/Tests/InputSystem/Plugins/XRTests.cs
ekcoh Feb 28, 2025
13c37e0
Update Assets/Tests/InputSystem/Plugins/XRTests.cs
ekcoh Feb 28, 2025
b4999b3
Merge branch 'develop' into isxb-699-trackedposedriver-fix
ekcoh Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Assets/Tests/InputSystem/Plugins/XRTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,35 @@ public void Components_TrackedPoseDriver_RetainsPoseWhenTrackedDeviceRemoved()
}
}

[Test]
[Category("Components")]
public void Components_TrackedPoseDriver_RetainsPoseWhenNoTrackedDeviceIsConnected()
{
// Tests/reproduces the scenario described in https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-699
// i.e. that rotation and/or position is not updated if device is not connected and track state isn't ignored.

var position = new Vector3(1f, 2f, 3f);
var rotation = new Quaternion(0.09853293f, 0.09853293f, 0.09853293f, 0.9853293f);

var go = new GameObject();
go.transform.position = position;
go.transform.rotation = rotation;

var tpd = go.AddComponent<TrackedPoseDriver>();
tpd.updateType = TrackedPoseDriver.UpdateType.Update;
tpd.trackingType = TrackedPoseDriver.TrackingType.RotationAndPosition;
tpd.ignoreTrackingState = false;
var transform = tpd.transform;

Assert.That(transform.position, Is.EqualTo(position));
Assert.That(transform.rotation, Is.EqualTo(rotation));

InputSystem.Update(InputUpdateType.Dynamic);

Assert.That(transform.position, Is.EqualTo(position));
Assert.That(transform.rotation, Is.EqualTo(rotation));
}

[Test]
[Category("Layouts")]
public void Layouts_PoseControlsCanBeCreatedBySubcontrols()
Expand Down
2 changes: 2 additions & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ however, it has to be formatted properly to pass verification tests.
- Fixed pointerId staying the same when simultaneously releasing and then pressing in the same frame on mobile using touch. [ISXB-1006](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-845)
- Fixed ISubmitHandler.OnSubmit event processing when operating in Manual Update mode (ISXB-1141)
- Fixed Rename mode is not entered and name is autocompleted to default when creating a new Action Map on 2022.3. [ISXB-1151](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1151)
- Fixed a bug that would case `TrackedBasedDriver` to update position and rotation when no HMD device is connected [ISXB-699](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-699) instead of keeping it unchanged.
- Fixed unexpected control scheme switch when using `OnScreenControl` and pointer based schemes which registed "Cancel" event on every frame.[ISXB-656](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-656)
- Fixed an issue with The "Add Control Scheme..." popup window so that it now persists until any changes are explicitly Saved or Cancelled [case ISXB-1131](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1131)

Expand Down Expand Up @@ -245,6 +246,7 @@ however, it has to be formatted properly to pass verification tests.
- Fixed incorrect documentation in InputSystem.actions and InputSystem.onActionsChanged property API contract.
- Fixed an issue where `InputSystem.actions` could be incorrectly evaluated if the associated asset was deleted.


## [1.8.0-pre.2] - 2023-11-09

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,27 @@ void ReadTrackingState()
{
// Treat an Input Action Reference with no reference the same as
// an enabled Input Action with no authored bindings, and allow driving the Transform pose.
m_CurrentTrackingState = TrackingStates.Position | TrackingStates.Rotation;
// TODO Remove if suggested fix seems valid. m_CurrentTrackingState = TrackingStates.Position | TrackingStates.Rotation;

// Check if we have transform and rotation controls to drive the pose.
var positionInputAction = m_PositionInput.action;
var rotationInputAction = m_RotationInput.action;
if (positionInputAction != null && positionInputAction.m_BindingsCount > 0 && rotationInputAction != null && rotationInputAction.m_BindingsCount > 0)
{
m_CurrentTrackingState = TrackingStates.Position | TrackingStates.Rotation;
}
else if (positionInputAction != null && positionInputAction.m_BindingsCount > 0)
{
m_CurrentTrackingState = TrackingStates.Position;
}
else if (rotationInputAction != null && rotationInputAction.m_BindingsCount > 0)
{
m_CurrentTrackingState = TrackingStates.Rotation;
}
else
{
m_CurrentTrackingState = TrackingStates.None;
}
return;
}

Expand Down