Skip to content

Commit 3d4c89b

Browse files
committed
feat: 599 support drop on dvdepth for pathfinder manipulators (#612)
* Bump versions * Drop to surface on DV * Pull raw pos, need to compute difference * Revert "Pull raw pos, need to compute difference" This reverts commit 44293d8. * Compute dv vs depth
1 parent e37cac8 commit 3d4c89b

File tree

9 files changed

+28
-166
lines changed

9 files changed

+28
-166
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,5 @@ Assets/Unisave/Resources/UnisavePreferencesFile.asset.meta
170170
Assets/Resources.meta
171171
**/HelloSGLX-win/*
172172
.gitconfig
173+
174+
Library/com.unity.addressables/AddressablesBuildTEP.json

Assets/Scenes/TrajectoryPlanner.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.44824904, g: 0.49827605, b: 0.5755831, a: 1}
41+
m_IndirectSpecularColor: {r: 0.44912726, g: 0.49919963, b: 0.5757154, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:

Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,29 @@ private void EchoPosition(Vector4 pos)
348348
{
349349
_probeController.SetProbeAngles(new Vector3(angles.x, 90 - angles.y, angles.z));
350350

351+
// If only the DV axis moved, then we drop on DV. Otherwise, we drop on depth.
352+
if (Math.Abs(pos.z - _lastManipulatorPosition.z) > 0.0001)
353+
IsSetToDropToSurfaceWithDepth = Math.Abs(pos.x - _lastManipulatorPosition.x) > 0.0001 ||
354+
Math.Abs(pos.y - _lastManipulatorPosition.y) > 0.0001;
355+
356+
// Copy in new 3-axis position into saved 4-axis position
357+
_lastManipulatorPosition = new Vector4(pos.x, pos.y, pos.z, _lastManipulatorPosition.w);
358+
359+
// Apply brain surface offset on correct axis
360+
var brainSurfaceAdjustment = float.IsNaN(BrainSurfaceOffset) ? 0 : BrainSurfaceOffset;
361+
if (IsSetToDropToSurfaceWithDepth)
362+
_lastManipulatorPosition.w -= brainSurfaceAdjustment;
363+
else
364+
_lastManipulatorPosition.z -= brainSurfaceAdjustment;
365+
351366
// Convert Pathfinder space coordinates into active atlas space
352-
_probeController.SetProbePosition(
353-
_probeController.Insertion.World2T_Vector(CoordinateSpace.Space2World_Vector(pos)));
367+
var convertedPos =
368+
_probeController.Insertion.World2T_Vector(
369+
CoordinateSpace.Space2World_Vector(_lastManipulatorPosition));
370+
371+
// Copy and add 4th axis back in
372+
_probeController.SetProbePosition(new Vector4(convertedPos.x, convertedPos.y, convertedPos.z,
373+
_lastManipulatorPosition.w));
354374
});
355375
}
356376
else

Assets/StreamingAssets/copilot_demo.json

Lines changed: 0 additions & 148 deletions
This file was deleted.

Assets/StreamingAssets/copilot_demo.json.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

Library/com.unity.addressables/AddressablesBuildTEP.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"com.unity.addressables": "1.21.18",
44
"com.unity.ai.navigation": "1.1.5",
55
"com.unity.animation.rigging": "1.2.1",
6-
"com.unity.ide.rider": "3.0.26",
6+
"com.unity.ide.rider": "3.0.27",
77
"com.unity.ide.visualstudio": "2.0.21",
88
"com.unity.ide.vscode": "1.2.5",
99
"com.unity.inputsystem": "1.7.0",

Packages/packages-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"url": "https://packages.unity.com"
5858
},
5959
"com.unity.ide.rider": {
60-
"version": "3.0.26",
60+
"version": "3.0.27",
6161
"depth": 0,
6262
"source": "registry",
6363
"dependencies": {

ProjectSettings/ProjectSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ PlayerSettings:
136136
vulkanEnableLateAcquireNextImage: 0
137137
vulkanEnableCommandBufferRecycling: 1
138138
loadStoreDebugModeEnabled: 0
139-
bundleVersion: 1.0.3
139+
bundleVersion: 1.1.0
140140
preloadedAssets:
141141
- {fileID: 11400000, guid: 6057f25234ce83a4bbb3ae618a501907, type: 2}
142142
metroInputSource: 0

0 commit comments

Comments
 (0)