/// EVENTS ///
These events are broadcasted by the GestureRecognizer at key moments.
Subscribe to them in your scripts
GestureDetectedEvent ( string gestureName, double confidence, Handedness hand, bool isDouble )
- gestureName - the string that is the title of the gesture you recorded and trained into the network-
- confidence - how confident the neural network is that the classification was correct
- hand - the hand that performed the gesture (ignore this if isDouble is true)
- isDouble - if true this was this a double handed gesture done with both hands
When a gesture is detected, the neural network attempts to classify the gesture and the GestureRecognizer class will broadcast an event that you can subscribe to.
When the neural network isn't "confident" enough that the users gesture was accurate, it will broadcast a GestureNull event. You can use this event to give negative feedback to the player that they didn't correctly perform a gesture.
Make sure in your logic to check that "isDouble" is true if you want your code to react to double handed gestures. Even if only one hand performs a gesture, this event will still be called, but isDouble will be false.
If you only want your code to only react when both hands did the double handed gesture, make sure to check that "isDouble" is true.
GestureNull ( string nullDebugInfo );
- nullDebugInfo - some debug info that gives info about what the network thinks it was
To explain what's going on at a lower level here:
The neural network never actuallly returns a null, instead, it always thinks you've done some gesture, even if it didn't resemble any of the previously recorded/trained gestures.
Therefore, we use the "Confidence Threshold" setting on the VRGestureManager as a way to detect null gestures. Any gesture that returns a lower confidence than the threshold will cause the VRGestureManager to broadcast a GestureNull event.
We also give you the string “nullDebugInfo” so that you can see what’s going on when a gesture is null. This can help you improve your tracking data.
For example, if a gesture is often returning null, you could take a look at it’s confidence in the nullDebugInfo and re-record / train the neural net with improved data to get the confidence above the “confidence threshold”.
This is called when the user first presses the record button down.
ContinueCapture ( Vector3 capturePoint );
- capturePoint - the point that was captured just now
This is called each time a point on the line is captured.
When the user holds down the record gesture button, we begin capturing points.
Each time a point is captured, it's added to the line that eventually becomes the gesture.
The Vector3 capturePoint is that point in world space.
This is called when the user lets go of the record button and the gesture has been captured.
This is always called at the end of a gesture capture, it doesn't matter if the gesture was recognized or not.