@@ -30,12 +30,6 @@ public class PokePointer : BaseControllerPointer, IMixedRealityNearPointer
30
30
/// </summary>
31
31
private const int maximumTouchableVolumeSize = 1000 ;
32
32
33
- [ SerializeField ]
34
- protected LineRenderer line ;
35
-
36
- [ SerializeField ]
37
- protected GameObject visuals ;
38
-
39
33
[ SerializeField ]
40
34
[ Tooltip ( "Maximum distance a which a touchable surface can be interacted with." ) ]
41
35
protected float touchableDistance = 0.2f ;
@@ -96,6 +90,9 @@ public bool IgnoreCollidersNotInFOV
96
90
private float closestDistance = 0.0f ;
97
91
98
92
private Vector3 closestNormal = Vector3 . forward ;
93
+
94
+ private Vector3 endPoint ;
95
+
99
96
// previous frame pointer position
100
97
public Vector3 PreviousPosition { get ; private set ; } = Vector3 . zero ;
101
98
@@ -173,9 +170,6 @@ public override void OnPreSceneQuery()
173
170
Vector3 start = Position + lengthOfPointerRay * closestNormal ;
174
171
Vector3 end = Position - lengthOfPointerRay * closestNormal ;
175
172
Rays [ 0 ] . UpdateRayStep ( ref start , ref end ) ;
176
-
177
- line . SetPosition ( 0 , Position ) ;
178
- line . SetPosition ( 1 , end ) ;
179
173
}
180
174
181
175
// Check if the currently touched object is still part of the new touchable.
@@ -190,8 +184,6 @@ public override void OnPreSceneQuery()
190
184
// Set new touchable only now: If we have to raise a poke-up event for the previous touchable object,
191
185
// we need to do so using the previous touchable in TryRaisePokeUp().
192
186
closestProximityTouchable = newClosestTouchable ;
193
-
194
- visuals . SetActive ( IsActive ) ;
195
187
}
196
188
}
197
189
@@ -302,19 +294,6 @@ public override void OnPostSceneQuery()
302
294
}
303
295
}
304
296
305
- if ( ! IsNearObject )
306
- {
307
- line . endColor = line . startColor = new Color ( 1 , 1 , 1 , 0.25f ) ;
308
- }
309
- else if ( currentTouchableObjectDown == null )
310
- {
311
- line . endColor = line . startColor = new Color ( 1 , 1 , 1 , 0.75f ) ;
312
- }
313
- else
314
- {
315
- line . endColor = line . startColor = new Color ( 0 , 0 , 1 , 0.75f ) ;
316
- }
317
-
318
297
PreviousPosition = Position ;
319
298
}
320
299
}
@@ -492,9 +471,23 @@ protected override void OnEnable()
492
471
base . OnEnable ( ) ;
493
472
494
473
IsTargetPositionLockedOnFocusLock = false ;
474
+ }
475
+
476
+ private void OnDrawGizmos ( )
477
+ {
478
+ if ( ! IsNearObject )
479
+ {
480
+ return ;
481
+ }
482
+ else
483
+ {
484
+ Gizmos . color = Color . green ;
485
+ }
495
486
496
- Debug . Assert ( line != null , "No line renderer found in PokePointer." ) ;
497
- Debug . Assert ( visuals != null , "No visuals object found in PokePointer." ) ;
487
+ if ( closestProximityTouchable != null )
488
+ {
489
+ Gizmos . DrawLine ( transform . position , closestProximityTouchable . transform . position ) ;
490
+ }
498
491
}
499
492
}
500
493
}
0 commit comments