Skip to main content Link Menu Expand (external link) Document Search Copy Copied

GRPLGestureRecognizer Public class

Description

This class implements the behaviour to detect gestures. These gestures can be imported from a json or recording during play mode. There is also the possibility to export the gestures in a (new) json file.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph Rhinox.XR.Grapple
  Rhinox.XR.Grapple.GRPLGestureRecognizer[[GRPLGestureRecognizer]]
  end
  subgraph UnityEngine
UnityEngine.MonoBehaviour[[MonoBehaviour]]
  end
UnityEngine.MonoBehaviour --> Rhinox.XR.Grapple.GRPLGestureRecognizer

Members

Properties

Public properties

Type Name Methods
RhinoxGesture CurrentLeftGesture
A RhinoxGesture object that represents the current gesture of the left hand.
get
RhinoxGesture CurrentRightGesture
A RhinoxGesture object that represents the current gesture of the right hand.
get
bool LeftHandGestureRecognizedThisFrame
A boolean flag that indicates whether a gesture was recognized for the first time this frame on the left hand.
get, private set
bool RightHandGestureRecognizedThisFrame
A boolean flag that indicates whether a gesture was recognized for the first time this frame on the right hand.
get, private set

Methods

Public methods

Returns Name
RhinoxGesture GetCurrentGestureOfHand(RhinoxHand hand)
Returns the current gesture on the given hand if the hand is either left or right.
Returns null if the given hand is invalid.
void ReadGesturesFromJson(string path)
Imports the gestures from the given json file at path “path”. If the directory or file is not valid, an empty list is added. Specify whether to overwrite the current gesture using “OverwriteGesturesOnImport”
bool WasRecognizedGestureStartedThisFrame(RhinoxHand hand)
Returns whether the current gesture on the given hand was recognized for the first time this frame.
Returns false if the given hand is invalid.
void WriteGesturesToJson()
Writes all current gestures to a .json file at directory “ExportFilePath” with name “ExportFileName”.json. If the ExportFilePath directory is not valid, the application data path is used.

Details

Summary

This class implements the behaviour to detect gestures. These gestures can be imported from a json or recording during play mode. There is also the possibility to export the gestures in a (new) json file.

Inheritance

  • MonoBehaviour

Constructors

GRPLGestureRecognizer

public GRPLGestureRecognizer()

Methods

GetCurrentGestureOfHand

public RhinoxGesture GetCurrentGestureOfHand(RhinoxHand hand)
Arguments
Type Name Description
RhinoxHand hand  
Summary

Returns the current gesture on the given hand if the hand is either left or right. Returns null if the given hand is invalid.

Returns

The gesture on hand.

WasRecognizedGestureStartedThisFrame

public bool WasRecognizedGestureStartedThisFrame(RhinoxHand hand)
Arguments
Type Name Description
RhinoxHand hand  
Summary

Returns whether the current gesture on the given hand was recognized for the first time this frame. Returns false if the given hand is invalid.

Returns

Whether the current gesture on the given hand was recognized for the first time this frame.

WriteGesturesToJson

public void WriteGesturesToJson()
Summary

Writes all current gestures to a .json file at directory “ExportFilePath” with name “ExportFileName”.json. If the ExportFilePath directory is not valid, the application data path is used.

ReadGesturesFromJson

public void ReadGesturesFromJson(string path)
Arguments
Type Name Description
string path  
Summary

Imports the gestures from the given json file at path “path”. If the directory or file is not valid, an empty list is added. Specify whether to overwrite the current gesture using “OverwriteGesturesOnImport”

Properties

CurrentLeftGesture

public RhinoxGesture CurrentLeftGesture { get; }
Summary

A RhinoxGesture object that represents the current gesture of the left hand.

CurrentRightGesture

public RhinoxGesture CurrentRightGesture { get; }
Summary

A RhinoxGesture object that represents the current gesture of the right hand.

LeftHandGestureRecognizedThisFrame

public bool LeftHandGestureRecognizedThisFrame { get; private set; }
Summary

A boolean flag that indicates whether a gesture was recognized for the first time this frame on the left hand.

RightHandGestureRecognizedThisFrame

public bool RightHandGestureRecognizedThisFrame { get; private set; }
Summary

A boolean flag that indicates whether a gesture was recognized for the first time this frame on the right hand.

Events

GlobalInitialized

public static event Action<GRPLGestureRecognizer> GlobalInitialized

Generated with ModularDoc