Method

How to use API

The VIVEPORT AirSig API provides an easy way for your content to provide VIVEPORT AirSig functions for your users.

  • public void SetMode(Mode mode)

    Set which AirSig function is going to use when player triggered the controller input.

Note

Please reference Mode above to see a list of available modes.

  • public void SetTarget(List<int> target)

    • Player’s Signatures and Player-defined Gestures share the same storage space. Please use the index to indicate which storage slot to access. target is a List of indexs.
    • For TrainPlayerSignature mode, set candidate index to train. Valid value are 1 - 1000.
    • For IdentifyPlayerSignature mode, set identification candidates to identify aganist. Valid value are 1 - 1000.
    • For AddPlayerGesture mode, set candidate index to add to. Valid values are 1 - 1000.
    • For IdentifyPlayerGesture mode, set identifcation candidate index to verify aganist. Valid values are 1-1000.
    • For DeveloperDefined, SmartTrainDeveloperDefined, SmartIdentifyDeveloperDefined mode, please use SetDeveloperDefinedTarget instead.
  • public void SetDeveloperDefinedTarget(List<string> target)

    This API is specific for DevloperDefined mode. This tells the engine which candidate to perform against to. These targets are gesture name that was used in the collection app.

  • public void SetClassifier(string classifier, string subClassifier)

    This API is specific for DevloperDefined mode. This tells the engine which classifier (database name) to use. Currently, the subClassifier is not used and should be set to empty string.

  • public Dictionary<int, int> SetPlayerGesture(List<int> targets)

    Call this method to complete the AddPlayerGesture process. The method will set gestures at the target index to the engine and return how many gestures are set for each index.

  • public void ResetSmartTrain()

    Reset smart training cache data.

  • public void DeletePlayerRecord(int targetIndex)

    Delete player signature or gesture.

  • public float[] GetFromCache(long gestureId)

    Get the gesture data given a gestureId (gestureId is available for all callback function). Only latest 10 gestures are stored.

  • public bool IsPlayerGestureExisted(long gestureId)

    Check whether a Player-defined Gesture data exist in the database or not.

  • TriggerStartButton

    Set the trigger key to start collecting gesture. If None is used, then no gesture will be collected and no identification will be triggered. The default is Touchpad and other acceptable settings are:

    • TriggerButton.None
    • TriggerButton.Touchpad
    • TriggerButton.Trigger
  • TriggerEndButton

    Set the trigger key to stop collecting gesture. If None is used, then releasing the TriggerStartButton will be used to end the collecting. The default is None and other acceptable settings are:

    • TriggerButton.None
    • TriggerButton.Touchpad
    • TriggerButton.Trigger
  • UseTouchTrigger

    • Set use Touch or Press to trigger. Note only Touchpad can support Touch.
  • public void ClearTriggerStartKeys(Controller ctrl)

    Clear the start key for the specified controller.

    • ctrl: Controller ID. It can be either Controller.RIGHT_HAND or Controller.LEFT_HAND.
  • public void ClearTriggerEndKeys(Controller ctrl)

    Clear the end key for the specified controller.

    • ctrl: Controller ID. It can be either Controller.RIGHT_HAND or Controller.LEFT_HAND.

VIVEPORT AirSig work flow

_images/AirSig_workflow.jpg

Example in Unity

  1. Use Touchpad Press to start collecting and releasing to end collecting.
TriggerStartButtton = TriggerButton.Touchpad;
UseTouchTrigger = false;
  1. Use Touchpad Press to start collecting and Touchpad Press again to end collecting.
TriggerStartButtton = TriggerButton.Touchpad;
UseTouchTrigger = false;

TriggerEndButtton = TriggerButton.Touchpad;
UseTouchTrigger = false;