Skip to content
This repository was archived by the owner on Aug 11, 2024. It is now read-only.

Commit 2b02371

Browse files
Updated XRTK.Core (#10)
* Cherrypicked mouse speed changes * updated main configuration profile with new camera system settings * bumped version for breaking changes to camera settings in XRTK.Core 0.1.3 * forgot to update dependency * updated xrtk version
1 parent e2e2368 commit 2b02371

5 files changed

Lines changed: 26 additions & 11 deletions

File tree

XRTK.SDK/Assets/XRTK.SDK/DefaultProfiles/DefaultMixedRealityToolkitConfigurationProfile.asset

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ MonoBehaviour:
1313
m_Name: DefaultMixedRealityToolkitConfigurationProfile
1414
m_EditorClassIdentifier:
1515
isCustomProfile: 0
16-
enableCameraProfile: 1
16+
enableCameraSystem: 1
17+
cameraSystemType:
18+
reference: XRTK.Services.CameraSystem.MixedRealityCameraSystem, XRTK
1719
cameraProfile: {fileID: 11400000, guid: 2b0ab6f5348646cebf8585d46c3a3edc, type: 2}
1820
enableInputSystem: 1
1921
inputSystemProfile: {fileID: 11400000, guid: a176466fbf4e44a087639abca7e5ba47, type: 2}

XRTK.SDK/Assets/XRTK.SDK/Features/UX/Scripts/Pointers/MousePointer.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ public class MousePointer : BaseControllerPointer, IMixedRealityMousePointer
5050
/// <inheritdoc />
5151
float IMixedRealityMousePointer.HideTimeout => hideTimeout;
5252

53+
[SerializeField]
54+
[Range(0.1f, 1f)]
55+
[Tooltip("Mouse cursor speed that gets applied to the mouse delta.")]
56+
private float speed = 0.25f;
57+
58+
float IMixedRealityMousePointer.Speed => speed;
59+
5360
#endregion IMixedRealityMousePointer Implementation
5461

5562
#region IMixedRealityPointer Implementaiton
@@ -78,7 +85,7 @@ public override void OnPreRaycast()
7885
{
7986
transform.position = CameraCache.Main.transform.position;
8087

81-
if (TryGetPointingRay(out Ray pointingRay))
88+
if (TryGetPointingRay(out var pointingRay))
8289
{
8390
Rays[0].CopyRay(pointingRay, PointerExtent);
8491

@@ -236,9 +243,11 @@ private void Update()
236243
private void UpdateMousePosition(float mouseX, float mouseY)
237244
{
238245
var shouldUpdate = false;
246+
var scaledMouseX = mouseX * speed;
247+
var scaledMouseY = mouseY * speed;
239248

240-
if (Mathf.Abs(mouseX) >= movementThresholdToUnHide ||
241-
Mathf.Abs(mouseY) >= movementThresholdToUnHide)
249+
if (Mathf.Abs(scaledMouseX) >= movementThresholdToUnHide ||
250+
Mathf.Abs(scaledMouseY) >= movementThresholdToUnHide)
242251
{
243252
if (isDisabled)
244253
{
@@ -256,8 +265,8 @@ private void UpdateMousePosition(float mouseX, float mouseY)
256265
}
257266

258267
var newRotation = Vector3.zero;
259-
newRotation.x += mouseX;
260-
newRotation.y += mouseY;
268+
newRotation.x += scaledMouseX;
269+
newRotation.y += scaledMouseY;
261270
transform.Rotate(newRotation, Space.World);
262271
}
263272
}

XRTK.SDK/Assets/XRTK.SDK/Inspectors/UX/Pointers/MousePointerInspector.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class MousePointerInspector : BaseControllerPointerInspector
1212
private SerializedProperty hideCursorWhenInactive;
1313
private SerializedProperty hideTimeout;
1414
private SerializedProperty movementThresholdToUnHide;
15+
private SerializedProperty speed;
1516
private bool mousePointerFoldout = true;
1617

1718
protected override void OnEnable()
@@ -22,6 +23,7 @@ protected override void OnEnable()
2223
hideCursorWhenInactive = serializedObject.FindProperty("hideCursorWhenInactive");
2324
movementThresholdToUnHide = serializedObject.FindProperty("movementThresholdToUnHide");
2425
hideTimeout = serializedObject.FindProperty("hideTimeout");
26+
speed = serializedObject.FindProperty("speed");
2527
}
2628

2729
public override void OnInspectorGUI()
@@ -43,6 +45,8 @@ public override void OnInspectorGUI()
4345
}
4446

4547
EditorGUI.indentLevel--;
48+
49+
EditorGUILayout.PropertyField(speed);
4650
}
4751

4852
serializedObject.ApplyModifiedProperties();

XRTK.SDK/Assets/XRTK.SDK/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.xrtk.sdk",
33
"displayName": "XRTK.SDK",
44
"description": "The SDK for the Mixed Reality Toolkit",
5-
"version": "0.1.1",
5+
"version": "0.1.2",
66
"unity": "2018.3",
77
"license": "MIT",
88
"repository": {
@@ -12,6 +12,6 @@
1212
"src": "Assets/XRTK.Core",
1313
"author": "XRTK Team (https://github.com/XRTK)",
1414
"dependencies": {
15-
"com.xrtk.core": "0.1.2"
15+
"com.xrtk.core": "0.1.3"
1616
}
1717
}

XRTK.SDK/Packages/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"com.unity.package-manager-ui": "2.0.7",
55
"com.unity.textmeshpro": "1.3.0",
66
"com.unity.xr.oculus.standalone": "1.29.1",
7-
"com.xrtk.core": "https://github.com/XRTK/XRTK-Core.git#0.1.2",
7+
"com.xrtk.core": "https://github.com/XRTK/XRTK-Core.git#0.1.3",
88
"com.xrtk.upm-git-extension": "https://github.com/XRTK/UpmGitExtension.git#0.9.4",
99
"com.xrtk.wmr": "https://github.com/XRTK/WindowsMixedReality.git#0.1.1",
1010
"com.unity.modules.ai": "1.0.0",
@@ -44,8 +44,8 @@
4444
"revision": "0.9.4"
4545
},
4646
"com.xrtk.core": {
47-
"hash": "c3e3c8fc9ae3549a1a501d07bff5dc3d857e2c94",
48-
"revision": "0.1.2"
47+
"hash": "6b85982fd9d9f6f44d46074e8956b3d53ce2a48e",
48+
"revision": "0.1.3"
4949
},
5050
"com.xrtk.wmr": {
5151
"hash": "590a21635dff21d93fd8dd14e66fcdd0424cf63d",

0 commit comments

Comments
 (0)