Skip to content

Commit 5e79358

Browse files
committed
fix: fixing some bugs on drop to surface but not all
1 parent 4f27113 commit 5e79358

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

Assets/Scenes/TrajectoryPlanner.unity

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3130,15 +3130,15 @@ PrefabInstance:
31303130
objectReference: {fileID: 1703646459}
31313131
- target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
31323132
propertyPath: m_AnchorMax.y
3133-
value: 0
3133+
value: 1
31343134
objectReference: {fileID: 0}
31353135
- target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
31363136
propertyPath: m_AnchorMin.y
3137-
value: 0
3137+
value: 1
31383138
objectReference: {fileID: 0}
31393139
- target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
31403140
propertyPath: m_AnchoredPosition.x
3141-
value: 0
3141+
value: 169.88
31423142
objectReference: {fileID: 0}
31433143
- target: {fileID: 341190943836276264, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
31443144
propertyPath: m_IsOn
@@ -3274,19 +3274,19 @@ PrefabInstance:
32743274
objectReference: {fileID: 0}
32753275
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
32763276
propertyPath: m_AnchorMax.y
3277-
value: 0
3277+
value: 1
32783278
objectReference: {fileID: 0}
32793279
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
32803280
propertyPath: m_AnchorMin.y
3281-
value: 0
3281+
value: 1
32823282
objectReference: {fileID: 0}
32833283
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
32843284
propertyPath: m_AnchoredPosition.x
3285-
value: 0
3285+
value: 354.84
32863286
objectReference: {fileID: 0}
32873287
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
32883288
propertyPath: m_AnchoredPosition.y
3289-
value: 0
3289+
value: -15
32903290
objectReference: {fileID: 0}
32913291
- target: {fileID: 341190944071593138, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
32923292
propertyPath: m_AnchorMax.x
@@ -3566,19 +3566,19 @@ PrefabInstance:
35663566
objectReference: {fileID: 0}
35673567
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
35683568
propertyPath: m_AnchorMax.y
3569-
value: 0
3569+
value: 1
35703570
objectReference: {fileID: 0}
35713571
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
35723572
propertyPath: m_AnchorMin.y
3573-
value: 0
3573+
value: 1
35743574
objectReference: {fileID: 0}
35753575
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
35763576
propertyPath: m_AnchoredPosition.x
3577-
value: 0
3577+
value: 384.91998
35783578
objectReference: {fileID: 0}
35793579
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
35803580
propertyPath: m_AnchoredPosition.y
3581-
value: 0
3581+
value: -15
35823582
objectReference: {fileID: 0}
35833583
- target: {fileID: 341190944411999430, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
35843584
propertyPath: m_AnchorMax.y

Assets/Scripts/Pinpoint/Probes/ProbeManager.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ public static string[] GetAllChannelAnnotationData()
100100
#endregion
101101

102102
// Probe position data
103-
private Vector3 _recRegionBaseCoordU;
104-
private Vector3 _recRegionTopCoordU;
103+
private Vector3 _recRegionBaseCoordWorldU;
104+
private Vector3 _recRegionTopCoordWorldU;
105105

106-
public (Vector3 tipCoordU, Vector3 endCoordU) RecRegionCoordWorldU { get { return (_recRegionBaseCoordU, _recRegionTopCoordU); } }
106+
public (Vector3 tipCoordU, Vector3 endCoordU) RecRegionCoordWorldU { get { return (_recRegionBaseCoordWorldU, _recRegionTopCoordWorldU); } }
107107

108108
// Text
109109
private const float minYaw = -180;
@@ -382,8 +382,8 @@ public void ProbeMoved()
382382
// Update the world coordinates for the tip position
383383
Vector3 startCoordWorldT = _probeController.ProbeTipT.position + -_probeController.ProbeTipT.forward * channelCoords.startPosmm;
384384
Vector3 endCoordWorldT = _probeController.ProbeTipT.position + -_probeController.ProbeTipT.forward * channelCoords.endPosmm;
385-
_recRegionBaseCoordU = BrainAtlasManager.WorldT2WorldU(startCoordWorldT);
386-
_recRegionTopCoordU = BrainAtlasManager.WorldT2WorldU(endCoordWorldT);
385+
_recRegionBaseCoordWorldU = BrainAtlasManager.WorldT2WorldU(startCoordWorldT);
386+
_recRegionTopCoordWorldU = BrainAtlasManager.WorldT2WorldU(endCoordWorldT);
387387
}
388388

389389
#region Channel map
@@ -770,8 +770,12 @@ public void DropProbeToBrainSurface()
770770
return;
771771
}
772772

773-
var entryCoordAtlasT = BrainAtlasManager.ActiveAtlasTransform.U2T(
774-
BrainAtlasManager.ActiveReferenceAtlas.Idx2Atlas(entryCoordAtlasIdx));
773+
Debug.Log(entryCoordAtlasIdx);
774+
775+
Vector3 w = BrainAtlasManager.ActiveReferenceAtlas.AtlasIdx2World(entryCoordAtlasIdx);
776+
Vector3 a = BrainAtlasManager.ActiveReferenceAtlas.World2Atlas(w);
777+
778+
var entryCoordAtlasT = BrainAtlasManager.ActiveAtlasTransform.U2T(a);
775779

776780
_probeController.SetProbePosition(entryCoordAtlasT);
777781
}
@@ -850,6 +854,7 @@ public void UpdateSurfacePosition()
850854
if (!done)
851855
{
852856
Debug.LogWarning("Impossible to find brain surface from here");
857+
Debug.Log(tipInBrain);
853858
return (new Vector3(float.NaN, float.NaN, float.NaN), false);
854859
}
855860
}

0 commit comments

Comments
 (0)