Skip to content

Commit 15f5266

Browse files
committed
chore(Pointer): rename world pointer to base pointer for consistency
All other base abstract classes are named `Base_`. It is more appropriate for the World Pointer to be called Base Pointer as this is more consistent with other scripts.
1 parent 9ea0acf commit 15f5266

File tree

13 files changed

+46
-43
lines changed

13 files changed

+46
-43
lines changed

Assets/VRTK/Examples/Resources/Scripts/Setup_Scene_031.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private void Update()
2121
var pointer = headset.gameObject.AddComponent<VRTK_BezierPointer>();
2222

2323
pointer.controller = VRTK_DeviceFinder.GetControllerRightHand().GetComponent<VRTK_ControllerEvents>();
24-
pointer.pointerVisibility = VRTK_WorldPointer.pointerVisibilityStates.Always_Off;
24+
pointer.pointerVisibility = VRTK_BasePointer.pointerVisibilityStates.Always_Off;
2525
pointer.pointerLength = 7f;
2626
pointer.pointerDensity = 1;
2727
pointer.pointerCursorRadius = 0.3f;

Assets/VRTK/Examples/Resources/Scripts/Setup_Scene_034.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private void Update()
2020

2121
pointer.controller = controllerEvents;
2222
pointer.enableTeleport = false;
23-
pointer.pointerVisibility = VRTK_WorldPointer.pointerVisibilityStates.Always_Off;
23+
pointer.pointerVisibility = VRTK_BasePointer.pointerVisibilityStates.Always_Off;
2424
pointer.pointerLength = 100f;
2525
pointer.showPointerTip = true;
2626
}

Assets/VRTK/Scripts/Interactions/VRTK_InteractableObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public enum ValidDropTypes
9999
public bool holdButtonToUse = true;
100100
[Tooltip("If this is checked the object can be used only if it is currently being grabbed.")]
101101
public bool useOnlyIfGrabbed = false;
102-
[Tooltip("If this is checked then when a World Pointer beam (projected from the controller) hits the interactable object, if the object has `Hold Button To Use` unchecked then whilst the pointer is over the object it will run it's `Using` method. If `Hold Button To Use` is unchecked then the `Using` method will be run when the pointer is deactivated. The world pointer will not throw the `Destination Set` event if it is affecting an interactable object with this setting checked as this prevents unwanted teleporting from happening when using an object with a pointer.")]
102+
[Tooltip("If this is checked then when a Base Pointer beam (projected from the controller) hits the interactable object, if the object has `Hold Button To Use` unchecked then whilst the pointer is over the object it will run it's `Using` method. If `Hold Button To Use` is unchecked then the `Using` method will be run when the pointer is deactivated. The world pointer will not throw the `Destination Set` event if it is affecting an interactable object with this setting checked as this prevents unwanted teleporting from happening when using an object with a pointer.")]
103103
public bool pointerActivatesUseAction = false;
104104
[Tooltip("If this is set to `Undefined` then the global use alias button will use the object, setting it to any other button will ensure the override button is used to use this specific interactable object.")]
105105
public VRTK_ControllerEvents.ButtonAlias useOverrideButton = VRTK_ControllerEvents.ButtonAlias.Undefined;

Assets/VRTK/Scripts/Locomotion/VRTK_BasicTeleport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace VRTK
1212
public delegate void TeleportEventHandler(object sender, DestinationMarkerEventArgs e);
1313

1414
/// <summary>
15-
/// The basic teleporter updates the `[CameraRig]` x/z position in the game world to the position of a World Pointer's tip location which is set via the `WorldPointerDestinationSet` event. The y position is never altered so the basic teleporter cannot be used to move up and down game objects as it only allows for travel across a flat plane.
15+
/// The basic teleporter updates the `[CameraRig]` x/z position in the game world to the position of a Base Pointer's tip location which is set via the `DestinationMarkerSet` event. The y position is never altered so the basic teleporter cannot be used to move up and down game objects as it only allows for travel across a flat plane.
1616
/// </summary>
1717
/// <remarks>
1818
/// The Basic Teleport script is attached to the `[CameraRig]` prefab.

Assets/VRTK/Scripts/Locomotion/VRTK_DashTeleport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct DashTeleportEventArgs
2424
/// The dash teleporter extends the height adjust teleporter and allows to have the `[CameraRig]` dashing to a new teleport location.
2525
/// </summary>
2626
/// <remarks>
27-
/// Like the basic teleporter and the height adjustable teleporter the Dash Teleport script is attached to the `[CameraRig]` prefab and requires a World Pointer to be available.
27+
/// Like the basic teleporter and the height adjustable teleporter the Dash Teleport script is attached to the `[CameraRig]` prefab.
2828
///
2929
/// The basic principle is to dash for a very short amount of time, to avoid sim sickness. The default value is 100 miliseconds. This value is fixed for all normal and longer distances. When the distances get very short the minimum speed is clamped to 50 mps, so the dash time becomes even shorter.
3030
///

Assets/VRTK/Scripts/Pointers/VRTK_WorldPointer.cs renamed to Assets/VRTK/Scripts/Pointers/VRTK_BasePointer.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// World Pointer|Pointers|10020
1+
// Base Pointer|Pointers|10020
22
namespace VRTK
33
{
44
using UnityEngine;
55

66
/// <summary>
7-
/// This abstract class provides any game pointer the ability to know the state of the implemented pointer. It extends the `VRTK_DestinationMarker` to allow for destination events to be emitted when the pointer cursor collides with objects.
7+
/// This abstract class provides any game pointer the ability to know the state of the implemented pointer.
88
/// </summary>
99
/// <remarks>
10-
/// The World Pointer also provides a play area cursor to be displayed for all cursors that utilise this class. The play area cursor is a representation of the current calibrated play area space and is useful for visualising the potential new play area space in the game world prior to teleporting. It can also handle collisions with objects on the new play area space and prevent teleporting if there are any collisions with objects at the potential new destination.
10+
/// It extends the `VRTK_DestinationMarker` to allow for destination events to be emitted when the pointer cursor collides with objects.
1111
///
12-
/// The play area collider does not work well with terrains as they are uneven and cause collisions regularly so it is recommended that handling play area collisions is not enabled when using terrains.
12+
/// As this is an abstract class, it cannot be applied directly to a game object and performs no logic.
1313
/// </remarks>
14-
public abstract class VRTK_WorldPointer : VRTK_DestinationMarker
14+
public abstract class VRTK_BasePointer : VRTK_DestinationMarker
1515
{
1616
/// <summary>
1717
/// States of Pointer Visibility.
@@ -26,7 +26,8 @@ public enum pointerVisibilityStates
2626
Always_Off
2727
}
2828

29-
[Header("Generic Pointer Settings", order = 2)]
29+
[Header("Base Pointer Settings", order = 2)]
30+
3031
[Tooltip("The controller that will be used to toggle the pointer. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.")]
3132
public VRTK_ControllerEvents controller = null;
3233
[Tooltip("A custom transform to use as the origin of the pointer. If no pointer origin transform is provided then the transform the script is attached to is used.")]
@@ -113,7 +114,7 @@ protected virtual void Awake()
113114
}
114115
if (controller == null)
115116
{
116-
Debug.LogError("VRTK_WorldPointer requires a Controller that has the VRTK_ControllerEvents script attached to it");
117+
Debug.LogError("VRTK_BasePointer requires a Controller that has the VRTK_ControllerEvents script attached to it");
117118
return;
118119
}
119120
Utilities.SetPlayerObject(gameObject, VRTK_PlayerObject.ObjectTypes.Pointer);
@@ -375,13 +376,13 @@ protected virtual bool ValidDestination(Transform target, Vector3 destinationPos
375376

376377
protected virtual void CreateObjectInteractor()
377378
{
378-
objectInteractor = new GameObject(string.Format("[{0}]WorldPointer_ObjectInteractor_Holder", gameObject.name));
379+
objectInteractor = new GameObject(string.Format("[{0}]BasePointer_ObjectInteractor_Holder", gameObject.name));
379380
objectInteractor.transform.SetParent(controller.transform);
380381
objectInteractor.transform.localPosition = Vector3.zero;
381382
objectInteractor.layer = LayerMask.NameToLayer("Ignore Raycast");
382383
Utilities.SetPlayerObject(objectInteractor, VRTK_PlayerObject.ObjectTypes.Pointer);
383384

384-
var objectInteractorCollider = new GameObject(string.Format("[{0}]WorldPointer_ObjectInteractor_Collider", gameObject.name));
385+
var objectInteractorCollider = new GameObject(string.Format("[{0}]BasePointer_ObjectInteractor_Collider", gameObject.name));
385386
objectInteractorCollider.transform.SetParent(objectInteractor.transform);
386387
objectInteractorCollider.transform.localPosition = Vector3.zero;
387388
objectInteractorCollider.layer = LayerMask.NameToLayer("Ignore Raycast");
@@ -391,7 +392,7 @@ protected virtual void CreateObjectInteractor()
391392

392393
if (grabToPointerTip)
393394
{
394-
objectInteractorAttachPoint = new GameObject(string.Format("[{0}]WorldPointer_ObjectInteractor_AttachPoint", gameObject.name));
395+
objectInteractorAttachPoint = new GameObject(string.Format("[{0}]BasePointer_ObjectInteractor_AttachPoint", gameObject.name));
395396
objectInteractorAttachPoint.transform.SetParent(objectInteractor.transform);
396397
objectInteractorAttachPoint.transform.localPosition = Vector3.zero;
397398
objectInteractorAttachPoint.layer = LayerMask.NameToLayer("Ignore Raycast");

Assets/VRTK/Scripts/Pointers/VRTK_WorldPointer.cs.meta renamed to Assets/VRTK/Scripts/Pointers/VRTK_BasePointer.cs.meta

File renamed without changes.

Assets/VRTK/Scripts/Pointers/VRTK_BezierPointer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ namespace VRTK
1818
///
1919
/// `VRTK/Examples/036_Controller_CustomCompoundPointer' shows how to display an object (a teleport beam) only if the teleport location is valid, and can create an animated trail along the tracer curve.
2020
/// </example>
21-
public class VRTK_BezierPointer : VRTK_WorldPointer
21+
public class VRTK_BezierPointer : VRTK_BasePointer
2222
{
2323
[Header("Bezier Pointer Settings", order = 3)]
24+
2425
[Tooltip("The length of the projected forward pointer beam, this is basically the distance able to point from the controller position.")]
2526
public float pointerLength = 10f;
2627
[Tooltip("The number of items to render in the beam bezier curve. A high number here will most likely have a negative impact of game performance due to large number of rendered objects.")]
@@ -99,18 +100,18 @@ protected override void InitPointer()
99100
if (validTeleportLocationObject != null)
100101
{
101102
validTeleportLocationInstance = Instantiate(validTeleportLocationObject);
102-
validTeleportLocationInstance.name = string.Format("[{0}]WorldPointer_BezierPointer_TeleportBeam", gameObject.name);
103+
validTeleportLocationInstance.name = string.Format("[{0}]BasePointer_BezierPointer_TeleportBeam", gameObject.name);
103104
validTeleportLocationInstance.transform.parent = pointerCursor.transform;
104105
validTeleportLocationInstance.layer = LayerMask.NameToLayer("Ignore Raycast");
105106
validTeleportLocationInstance.SetActive(false);
106107
}
107108

108-
pointerCursor.name = string.Format("[{0}]WorldPointer_BezierPointer_PointerCursor", gameObject.name);
109+
pointerCursor.name = string.Format("[{0}]BasePointer_BezierPointer_PointerCursor", gameObject.name);
109110
Utilities.SetPlayerObject(pointerCursor, VRTK_PlayerObject.ObjectTypes.Pointer);
110111
pointerCursor.layer = LayerMask.NameToLayer("Ignore Raycast");
111112
pointerCursor.SetActive(false);
112113

113-
curvedBeamContainer = new GameObject(string.Format("[{0}]WorldPointer_BezierPointer_CurvedBeamContainer", gameObject.name));
114+
curvedBeamContainer = new GameObject(string.Format("[{0}]BasePointer_BezierPointer_CurvedBeamContainer", gameObject.name));
114115
Utilities.SetPlayerObject(curvedBeamContainer, VRTK_PlayerObject.ObjectTypes.Pointer);
115116
curvedBeamContainer.SetActive(false);
116117
curvedBeam = curvedBeamContainer.gameObject.AddComponent<CurveGenerator>();

Assets/VRTK/Scripts/Pointers/VRTK_DestinationMarker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public struct DestinationMarkerEventArgs
3333
/// This abstract class provides the ability to emit events of destination markers within the game world. It can be useful for tagging locations for specific purposes such as teleporting.
3434
/// </summary>
3535
/// <remarks>
36-
/// It is utilised by the `VRTK_WorldPointer` for dealing with pointer events when the pointer cursor touches areas within the game world.
36+
/// It is utilised by the `VRTK_BasePointer` for dealing with pointer events when the pointer cursor touches areas within the game world.
3737
/// </remarks>
3838
public abstract class VRTK_DestinationMarker : MonoBehaviour
3939
{

Assets/VRTK/Scripts/Pointers/VRTK_PlayAreaCursor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace VRTK
44
using UnityEngine;
55

66
/// <summary>
7-
/// The Play Area Cursor is used in conjunction with a World Pointer script and displays a representation of the play area where the pointer cursor hits.
7+
/// The Play Area Cursor is used in conjunction with a Base Pointer script and displays a representation of the play area where the pointer cursor hits.
88
/// </summary>
99
/// <example>
1010
/// `VRTK/Examples/012_Controller_PointerWithAreaCollision` shows how a Bezier Pointer with the Play Area Cursor and Collision Detection enabled can be used to traverse a game area but not allow teleporting into areas where the walls or other objects would fall into the play area space enabling the user to enter walls.
@@ -13,7 +13,7 @@ public class VRTK_PlayAreaCursor : MonoBehaviour
1313
{
1414
[Tooltip("Determines the size of the play area cursor and collider. If the values are left as zero then the Play Area Cursor will be sized to the calibrated Play Area space.")]
1515
public Vector2 playAreaCursorDimensions = Vector2.zero;
16-
[Tooltip("If this is ticked then if the play area cursor is colliding with any other object then the pointer colour will change to the `Pointer Miss Color` and the `WorldPointerDestinationSet` event will not be triggered, which will prevent teleporting into areas where the play area will collide.")]
16+
[Tooltip("If this is ticked then if the play area cursor is colliding with any other object then the pointer colour will change to the `Pointer Miss Color` and the `DestinationMarkerSet` event will not be triggered, which will prevent teleporting into areas where the play area will collide.")]
1717
public bool handlePlayAreaCursorCollisions = false;
1818
[Tooltip("If this is ticked then if the user's headset is outside of the play area cursor bounds then it is considered a collision even if the play area isn't colliding with anything.")]
1919
public bool headsetOutOfBoundsIsCollision = false;
@@ -121,9 +121,9 @@ public virtual void ToggleState(bool state)
121121

122122
protected virtual void Awake()
123123
{
124-
if (!GetComponent<VRTK_WorldPointer>())
124+
if (!GetComponent<VRTK_BasePointer>())
125125
{
126-
Debug.LogError("VRTK_PlayAreaCursor requires a VRTK_WorldPointer script attached to the same object.");
126+
Debug.LogError("VRTK_PlayAreaCursor requires a VRTK_BasePointer script attached to the same object.");
127127
return;
128128
}
129129

0 commit comments

Comments
 (0)