GRPLTwoWayLever Public class
Description
The GRPLOneWayLever class is a subclass of GRPLLeverBase and provides functionality for two-way levers in a 3D environment. It has four events (LeverForwardActivated, LeverForwardStopped, LeverBackwardActivated, LeverBackwardStopped) to notify when the lever is activated or stopped in either direction. It also has some properties that can be used for debugging. The OnValidate method is used to set the minimum angle that the lever can move, while the Update method is used to update the lever’s rotation and process the current angle.
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph Rhinox.XR.Grapple.It
Rhinox.XR.Grapple.It.GRPLTwoWayLever[[GRPLTwoWayLever]]
Rhinox.XR.Grapple.It.GRPLLeverBase[[GRPLLeverBase]]
class Rhinox.XR.Grapple.It.GRPLLeverBase abstractStyle;
end
Rhinox.XR.Grapple.It.GRPLLeverBase --> Rhinox.XR.Grapple.It.GRPLTwoWayLever
Members
Methods
Protected methods
Returns | Name |
---|---|
float | GetLeverRotation (Vector3 projectedPos)Calculates the angle of the lever based on the projected joint position. |
void | Initialize ()Initializes the lever. |
void | OnDrawGizmos () |
Public methods
Returns | Name |
---|---|
bool | CheckForInteraction (RhinoxJoint joint, RhinoxHand hand)Checks if the given RhinoxJoint and RhinoxHand are interacting with the lever. |
Transform | GetReferenceTransform ()Returns the transform of the handle. |
bool | TryGetCurrentInteractJoint (ICollection <RhinoxJoint > joints, out RhinoxJoint joint, RhinoxHand hand) |
Details
Summary
The GRPLOneWayLever class is a subclass of GRPLLeverBase and provides functionality for two-way levers in a 3D environment. It has four events (LeverForwardActivated, LeverForwardStopped, LeverBackwardActivated, LeverBackwardStopped) to notify when the lever is activated or stopped in either direction. It also has some properties that can be used for debugging. The OnValidate method is used to set the minimum angle that the lever can move, while the Update method is used to update the lever’s rotation and process the current angle.
Inheritance
Constructors
GRPLTwoWayLever
public GRPLTwoWayLever()
Methods
Initialize
protected override void Initialize()
Summary
Initializes the lever.
GetLeverRotation
protected override float GetLeverRotation(Vector3 projectedPos)
Arguments
Type | Name | Description |
---|---|---|
Vector3 | projectedPos | The projected joint position |
Summary
Calculates the angle of the lever based on the projected joint position.
Returns
GetReferenceTransform
public override Transform GetReferenceTransform()
Summary
Returns the transform of the handle.
Returns
CheckForInteraction
public override bool CheckForInteraction(RhinoxJoint joint, RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
RhinoxJoint | joint | The interact joint. |
RhinoxHand | hand | The hand on which this joint resides. |
Summary
Checks if the given RhinoxJoint and RhinoxHand are interacting with the lever.
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 |
OnDrawGizmos
protected override void OnDrawGizmos()
Events
LeverForwardActivated
public event Action<GRPLTwoWayLever> LeverForwardActivated
Summary
An event that is raised when the lever is activated in the forward direction.
LeverForwardStopped
public event Action<GRPLTwoWayLever> LeverForwardStopped
Summary
An event that is raised when the lever is stopped in the forward direction.
LeverBackwardActivated
public event Action<GRPLTwoWayLever> LeverBackwardActivated
Summary
An event that is raised when the lever is activated in the backward direction.
LeverBackwardStopped
public event Action<GRPLTwoWayLever> LeverBackwardStopped
Summary
An event that is raised when the lever is stopped in the backward direction.
Generated with ModularDoc