GRPLLeverBase Public class
Description
The GRPLLeverBase class is an abstract class that extends from GRPLInteractable. The class is used to derive lever-type interactable objects, and it includes additional methods and properties for that functionality.
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph Rhinox.XR.Grapple.It
Rhinox.XR.Grapple.It.GRPLLeverBase[[GRPLLeverBase]]
class Rhinox.XR.Grapple.It.GRPLLeverBase abstractStyle;
Rhinox.XR.Grapple.It.GRPLInteractable[[GRPLInteractable]]
class Rhinox.XR.Grapple.It.GRPLInteractable abstractStyle;
end
Rhinox.XR.Grapple.It.GRPLInteractable --> Rhinox.XR.Grapple.It.GRPLLeverBase
Members
Methods
Protected methods
Returns | Name |
---|---|
void | Awake ()Initializes the class by setting the forced interactible joint and linking to the gesture recognizer. |
void | DrawGrabRange ()Draws the grab range of the lever in the Unity editor. |
void | DrawLeverTransforms ()Draws the transforms of the lever in the Unity editor. |
float | GetLeverRotation (Vector3 projectedPos)Calculates and returns the current rotation of the lever based on the projected position of the hand onto the plane defined by the base position and forward direction of the lever. |
Public methods
Returns | Name |
---|---|
bool | CheckForInteraction (RhinoxJoint joint, RhinoxHand hand)Returns false and logs an error message indicating that this class does not implement the functionality of an interactable. This method should be overridden in derived classes to provide specific interaction logic. |
Transform | GetReferenceTransform ()Returns the transform of the handle as the reference transform for the interactable object. |
bool | TryGetCurrentInteractJoint (ICollection <RhinoxJoint > joints, out RhinoxJoint joint, RhinoxHand hand) |
Details
Summary
The GRPLLeverBase class is an abstract class that extends from GRPLInteractable. The class is used to derive lever-type interactable objects, and it includes additional methods and properties for that functionality.
Inheritance
Constructors
GRPLLeverBase
protected GRPLLeverBase()
Methods
Awake
protected void Awake()
Summary
Initializes the class by setting the forced interactible joint and linking to the gesture recognizer.
GetLeverRotation
protected abstract float GetLeverRotation(Vector3 projectedPos)
Arguments
Type | Name | Description |
---|---|---|
Vector3 | projectedPos | The reference point projected on the plane defined by the lever base position and forward. |
Summary
Calculates and returns the current rotation of the lever based on the projected position of the hand onto the plane defined by the base position and forward direction of the lever.
Returns
The angle in degrees.
GetReferenceTransform
public override Transform GetReferenceTransform()
Summary
Returns the transform of the handle as the reference transform for the interactable object.
Returns
CheckForInteraction
public override bool CheckForInteraction(RhinoxJoint joint, RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
RhinoxJoint | joint | |
RhinoxHand | hand |
Summary
Returns false and logs an error message indicating that this class does not implement the functionality of an interactable. This method should be overridden in derived classes to provide specific interaction logic.
Returns
TryGetCurrentInteractJoint
public override bool TryGetCurrentInteractJoint(ICollection<RhinoxJoint> joints, out RhinoxJoint joint, RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
ICollection <RhinoxJoint > | joints | |
out RhinoxJoint | joint | |
RhinoxHand | hand |
DrawLeverTransforms
protected void DrawLeverTransforms()
Summary
Draws the transforms of the lever in the Unity editor.
DrawGrabRange
protected void DrawGrabRange()
Summary
Draws the grab range of the lever in the Unity editor.
Generated with ModularDoc