GRPLValve Public class
Description
This class represents a valve that can be interacted with in a hand tracking context. It extends the GRPLInteractable class.
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph Rhinox.XR.Grapple.It
Rhinox.XR.Grapple.It.GRPLValve[[GRPLValve]]
Rhinox.XR.Grapple.It.GRPLInteractable[[GRPLInteractable]]
class Rhinox.XR.Grapple.It.GRPLInteractable abstractStyle;
end
Rhinox.XR.Grapple.It.GRPLInteractable --> Rhinox.XR.Grapple.It.GRPLValve
Members
Properties
Public properties
Type | Name | Methods |
---|---|---|
float | CurrentValveRotation The current angle of the valve. | get |
ValveState | CurrentValveState The current state of the valve. | get |
bool | IsGrabbed Whether or not the valve is currently being grabbed. | get, protected set |
Methods
Protected methods
Returns | Name |
---|---|
void | Awake ()Sets _forceInteractibleJoint to true and sets the correct _forcedInteractJointID. |
void | Initialize ()This method initializes the valve’s rotation, minimum and maximum grab radii and checks if the visualTransform variable is not null. |
void | InteractStopped () |
void | OnDisable ()Unsubscribes the needed events. |
void | OnDrawGizmos () |
void | OnEnable ()Subscribes the needed events. |
Public methods
Returns | Name |
---|---|
bool | CheckForInteraction (RhinoxJoint joint, RhinoxHand hand)This method checks if a joint is within range of the valve and if it is in a proper gesture state to grab the valve. If so, it returns true, else false. |
bool | TryGetCurrentInteractJoint (ICollection <RhinoxJoint > joints, out RhinoxJoint outJoint, RhinoxHand hand) |
void | TryGrab (RhinoxHand hand)Function that allows external code to grab the valve if given hand is in range. |
void | TryLetGo (RhinoxHand hand)Function that allows external code to grab the valve if given hand is the hand that is interacting with it. |
Details
Summary
This class represents a valve that can be interacted with in a hand tracking context. It extends the GRPLInteractable class.
Remarks
Only one hand can interact with it at the same time. Turning the valve clockwise is considered to be closing the valve. Turning the valve counter-clockwise is considered to be opening the valve.
Inheritance
Constructors
GRPLValve
public GRPLValve()
Methods
Awake
protected void Awake()
Summary
Sets _forceInteractibleJoint to true and sets the correct _forcedInteractJointID.
Initialize
protected override void Initialize()
Summary
This method initializes the valve’s rotation, minimum and maximum grab radii and checks if the visualTransform variable is not null.
OnEnable
protected override void OnEnable()
Summary
Subscribes the needed events.
OnDisable
protected override void OnDisable()
Summary
Unsubscribes the needed events.
CheckForInteraction
public override bool CheckForInteraction(RhinoxJoint joint, RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
RhinoxJoint | joint | The interaction joint. |
RhinoxHand | hand | The hand on which this joint resides |
Summary
This method checks if a joint is within range of the valve and if it is in a proper gesture state to grab the valve. If so, it returns true, else false.
Returns
Whether the interaction is successful
TryGetCurrentInteractJoint
public override bool TryGetCurrentInteractJoint(ICollection<RhinoxJoint> joints, out RhinoxJoint outJoint, RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
ICollection <RhinoxJoint > | joints | |
out RhinoxJoint | outJoint | |
RhinoxHand | hand |
InteractStopped
protected override void InteractStopped()
TryGrab
public void TryGrab(RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
RhinoxHand | hand | The hand that will be used to grab and interact with the valve. |
Summary
Function that allows external code to grab the valve if given hand is in range.
TryLetGo
public void TryLetGo(RhinoxHand hand)
Arguments
Type | Name | Description |
---|---|---|
RhinoxHand | hand | The hand that should try to let go of the valve. |
Summary
Function that allows external code to grab the valve if given hand is the hand that is interacting with it.
OnDrawGizmos
protected override void OnDrawGizmos()
Properties
IsGrabbed
public bool IsGrabbed { get; protected set; }
Summary
Whether or not the valve is currently being grabbed.
CurrentValveRotation
public float CurrentValveRotation { get; }
Summary
The current angle of the valve.
CurrentValveState
public float CurrentValveRotation { get; }
Summary
The current angle of the valve. Generated with ModularDoc