@@ -31,7 +31,7 @@ public class TP_InPlaneSlice : MonoBehaviour
3131 private int zoomLevel = 0 ;
3232 private float zoomFactor = 1f ;
3333
34- private RectTransform rect ;
34+ private RectTransform _rect ;
3535
3636 private Texture3D annotationDatasetGPUTexture ;
3737 private TaskCompletionSource < bool > gpuTextureLoadedSource ;
@@ -44,7 +44,7 @@ public class TP_InPlaneSlice : MonoBehaviour
4444
4545 private void Awake ( )
4646 {
47- rect = GetComponent < RectTransform > ( ) ;
47+ _rect = GetComponent < RectTransform > ( ) ;
4848
4949 gpuTextureLoadedSource = new TaskCompletionSource < bool > ( ) ;
5050 gpuTextureLoadedTask = gpuTextureLoadedSource . Task ;
@@ -116,7 +116,7 @@ public void UpdateInPlaneSlice()
116116 }
117117
118118 ( Vector3 startCoordWorld , Vector3 endCoordWorld ) = activeProbeManager . GetProbeController ( ) . GetRecordingRegionWorld ( ) ;
119- ( _ , Vector3 upWorld , Vector3 forwardWorld ) = activeProbeManager . GetProbeController ( ) . GetTipWorld ( ) ;
119+ ( _ , upWorld , forwardWorld ) = activeProbeManager . GetProbeController ( ) . GetTipWorld ( ) ;
120120
121121#if UNITY_EDITOR
122122 // debug statements
@@ -171,22 +171,20 @@ public void InPlaneSliceHover(Vector2 pointerData)
171171 private Vector3 CalculateInPlanePosition ( Vector2 pointerData )
172172 {
173173 Vector2 inPlanePosNorm = GetLocalRectPosNormalized ( pointerData ) * inPlaneScale / 2 ;
174-
175174 // Take the tip transform and go out according to the in plane percentage
176175 Vector3 inPlanePosition = recordingRegionCenterPosition + ( annotationDataset . CoordinateSpace . World2SpaceAxisChange ( forwardWorld ) * - inPlanePosNorm . x + annotationDataset . CoordinateSpace . World2SpaceAxisChange ( upWorld ) * inPlanePosNorm . y ) ;
177-
178176 return inPlanePosition ;
179177 }
180178
181179 // Return the position within the local UI rectangle scaled to [-1, 1] on each axis
182180 private Vector2 GetLocalRectPosNormalized ( Vector2 pointerData )
183181 {
184182 Vector2 inPlanePosNorm ;
185- RectTransformUtility . ScreenPointToLocalPointInRectangle ( rect , pointerData , Camera . main , out inPlanePosNorm ) ;
183+ RectTransformUtility . ScreenPointToLocalPointInRectangle ( _rect , pointerData , Camera . main , out inPlanePosNorm ) ;
186184
187- inPlanePosNorm += new Vector2 ( rect . rect . width , rect . rect . height / 2 ) ;
188- inPlanePosNorm . x = inPlanePosNorm . x / rect . rect . width * 2 - 1 ;
189- inPlanePosNorm . y = inPlanePosNorm . y / rect . rect . height * 2 - 1 ;
185+ inPlanePosNorm += new Vector2 ( _rect . rect . width , _rect . rect . height / 2 ) ;
186+ inPlanePosNorm . x = inPlanePosNorm . x / _rect . rect . width * 2 - 1 ;
187+ inPlanePosNorm . y = inPlanePosNorm . y / _rect . rect . height * 2 - 1 ;
190188 return inPlanePosNorm ;
191189 }
192190
0 commit comments