Skip to content

Commit

Permalink
fix: preventing reference coordinate from starting at (0,0,0), correc…
Browse files Browse the repository at this point in the history
…tly defaults now to the default
  • Loading branch information
dbirman committed Feb 2, 2024
1 parent 556208c commit a515adf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
30 changes: 15 additions & 15 deletions Assets/Scenes/TrajectoryPlanner.unity
Original file line number Diff line number Diff line change
Expand Up @@ -3154,15 +3154,15 @@ PrefabInstance:
objectReference: {fileID: 1703646459}
- target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 169.88
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190943836276264, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_IsOn
Expand Down Expand Up @@ -3298,19 +3298,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 354.84
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -15
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944071593138, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMax.x
Expand Down Expand Up @@ -3590,19 +3590,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 384.91998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -15
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341190944411999430, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
propertyPath: m_AnchorMax.y
Expand Down Expand Up @@ -9378,7 +9378,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: RelativeCoordinateChangedEvent.m_PersistentCalls.m_Calls.Array.size
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: ShowAllProbePanelsChangedEvent.m_PersistentCalls.m_Calls.Array.size
Expand Down Expand Up @@ -9915,7 +9915,7 @@ PrefabInstance:
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: RelativeCoordinateChangedEvent.m_PersistentCalls.m_Calls.Array.data[3].m_Target
value:
objectReference: {fileID: 1452920056}
objectReference: {fileID: 2108153954}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: ShowAllProbePanelsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
Expand Down Expand Up @@ -10046,7 +10046,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: RelativeCoordinateChangedEvent.m_PersistentCalls.m_Calls.Array.data[3].m_MethodName
value: UpdateReferenceCoordinate
value: ResetReferenceCoordinate
objectReference: {fileID: 0}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: ShowAllProbePanelsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
Expand Down Expand Up @@ -10218,7 +10218,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: RelativeCoordinateChangedEvent.m_PersistentCalls.m_Calls.Array.data[3].m_TargetAssemblyTypeName
value: ReferenceCoordBehavior, pinpoint.brain
value: TrajectoryPlanner.TrajectoryPlannerManager, trajectoryplanner.core
objectReference: {fileID: 0}
- target: {fileID: 8016510558008620337, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
propertyPath: ShowAllProbePanelsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/Pinpoint/TrajectoryPlannerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,14 @@ public void ChangeBLRatio(float blRatio)

#region Misc

public void ResetReferenceCoordinate()
{
if (float.IsNaN(Settings.ReferenceCoord.x))
{
Settings.ReferenceCoord = Utils.BregmaDefaults[BrainAtlasManager.ActiveReferenceAtlas.Name];
}
}

public void LinkToVBLSite()
{
Application.OpenURL("https://virtualbrainlab.org");
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Pinpoint/Utilities/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public static int Slice3DDropdownOption
}
}

private readonly Vector3 RELCOORD_DEFAULT = new Vector3(0f, 0f ,0f);
private readonly Vector3 RELCOORD_DEFAULT = new Vector3(float.NaN, float.NaN, float.NaN);
public UnityEvent<Vector3> RelativeCoordinateChangedEvent;

public static Vector3 ReferenceCoord
Expand Down

0 comments on commit a515adf

Please sign in to comment.