GRPLTeleport Public class
Description
Teleport script that can be used with handtracking or controller. Nothing needs to be called externally when usinghandtracking, as all the internal logic takes care of that. When using it with controller, the user needs to call ‘ GRPLTeleport.ShowArc ‘ to toggle the arc visual and GRPLTeleport.CalculateTeleportLocation(UnityEngine.Ray) , where the ray is the startpoint and direction the teleport arc should go in.
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph Rhinox.XR.Grapple.It
Rhinox.XR.Grapple.It.GRPLTeleport[[GRPLTeleport]]
end
subgraph UnityEngine
UnityEngine.MonoBehaviour[[MonoBehaviour]]
end
UnityEngine.MonoBehaviour --> Rhinox.XR.Grapple.It.GRPLTeleport
Members
Properties
Public properties
Type | Name | Methods |
---|---|---|
bool | IsInitialized Public getter property for _isInitialized. | get |
bool | IsValidTeleportPoint Public getter property for _isValidTeleportPoint. | get |
bool | ShowArc Enable or disable the line rendering | get, set |
Vector3 | TeleportPoint Public getter property for _avgTeleportPoint. | get |
Methods
Public methods
Returns | Name |
---|---|
void | CalculateTeleportLocation (Ray startRay)This method takes a Ray as input and calculates the points of the teleportation arc using the initial velocity, gravity, and maximum distance. It then calls CalculateIntersectionPoint to find the intersection point between the arc and the environment. If a valid teleportation point is found, it sets _avgTeleportPoint to the average position of all the valid teleportation points, sets the position of the _teleportZoneVisual game object to _avgTeleportPoint, and sets _isValidTeleportPoint to true. Otherwise, it sets _lineRenderer’s colors to red, sets _isValidTeleportPoint to false, and clears the _teleportPositions queue. |
void | Initialize ()Initializes the Teleport system by hooking up to the GRPLJointManager events and to the GRPLGestureRecognizer teleport gesture. This also sets up the proximity sensor to the correct location and to only trigger on the the other hand. |
bool | IsHandEnabled (RhinoxHand handedness) |
void | SetHandEnabled (bool newState, RhinoxHand handedness) |
Details
Summary
Teleport script that can be used with handtracking or controller. Nothing needs to be called externally when usinghandtracking, as all the internal logic takes care of that. When using it with controller, the user needs to call ‘ GRPLTeleport.ShowArc ‘ to toggle the arc visual and GRPLTeleport.CalculateTeleportLocation(UnityEngine.Ray) , where the ray is the startpoint and direction the teleport arc should go in.
Remarks
Inheritance
MonoBehaviour
Constructors
GRPLTeleport
public GRPLTeleport()
Methods
Initialize
public void Initialize()
Summary
Initializes the Teleport system by hooking up to the GRPLJointManager events and to the GRPLGestureRecognizer teleport gesture. This also sets up the proximity sensor to the correct location and to only trigger on the the other hand.
Remarks
Both GRPLJointManager AND GRPLGestureRecognizer should be initialized before calling this.
CalculateTeleportLocation
public void CalculateTeleportLocation(Ray startRay)
Arguments
Type | Name | Description |
---|---|---|
Ray | startRay | Ray that gives a start point and direction the teleport arc should go in |
Summary
This method takes a Ray as input and calculates the points of the teleportation arc using the initial velocity, gravity, and maximum distance. It then calls CalculateIntersectionPoint to find the intersection point between the arc and the environment. If a valid teleportation point is found, it sets _avgTeleportPoint to the average position of all the valid teleportation points, sets the position of the _teleportZoneVisual game object to _avgTeleportPoint, and sets _isValidTeleportPoint to true. Otherwise, it sets _lineRenderer’s colors to red, sets _isValidTeleportPoint to false, and clears the _teleportPositions queue.
SetHandEnabled
public void SetHandEnabled(bool newState, RhinoxHand handedness)
Arguments
Type | Name | Description |
---|---|---|
bool | newState | |
RhinoxHand | handedness |
IsHandEnabled
public bool IsHandEnabled(RhinoxHand handedness)
Arguments
Type | Name | Description |
---|---|---|
RhinoxHand | handedness |
Properties
ShowArc
public bool ShowArc { get; set; }
Summary
Enable or disable the line rendering
IsInitialized
public bool IsInitialized { get; }
Summary
Public getter property for _isInitialized.
IsValidTeleportPoint
public bool IsValidTeleportPoint { get; }
Summary
Public getter property for _isValidTeleportPoint.
TeleportPoint
public Vector3 TeleportPoint { get; }
Summary
Public getter property for _avgTeleportPoint.
Generated with ModularDoc