Unigine::Plugins::Suit Class
Header: | #include <plugins/Unigine/TeslaSuit/UnigineTeslaSuit.h> |
Suit Class
枚举
TSP_BUFFER_SIZE#
TSP_R_CODE#
TSP_SUIT_HARDWARE_VERSION#
TSP_CONNECT_QUALITY#
TSP_SUIT_SEX#
Name | 描述 |
---|---|
TSP_SEX_UNKNOWN = 0 | Unknown model of TESLASUIT. |
TSP_MEN = 1 | Men suit. |
TSP_WOMEN = 2 | Women suit. |
TSP_UNISEX = 3 | Unisex suit. |
TSP_SUIT_SIZE#
TSP_SUIT_KIT#
Name | 描述 |
---|---|
TSP_KIT_UNKNOWN = 0 | Unknown kit of TESLASUIT. |
TSP_JACKET = 1 << 0 | Jacket is available. |
TSP_TROUSES = 1 << 1 | Pants are available. |
TSP_GLOVES = 1 << 2 | Gloves are available. |
TSP_HIT_EVENT#
Name | 描述 |
---|---|
TSP_ENTER = 0 | Start playing. |
TSP_STAY = 1 | Continue playing. |
TSP_EXIT = 2 | End playing. |
TSP_HIT_EVENT_NONE = 3 | NULL. |
TSP_ASSET_TYPE#
Name | 描述 |
---|---|
TSP_EMPTY = 0 | Empty asset. |
TSP_ANIMATION = 1 | Animation. |
TSP_PRESET = 2 | Preset. |
TSP_EFFECT = 3 | Effect. |
TSP_SAMPLE = 4 | Sample |
TSP_FEEL = 5 | Touch. |
TSP_MATERIAL = 6 | Material. |
TSP_MOCAP_FREQ#
TSP_ECG_FREQ#
Name | 描述 |
---|---|
TSP_ECG_FPS_5 = 200 | ECG frequency rate of 5 frames per second. |
TSP_ECG_FPS_10 = 100 | ECG frequency rate of 10 frames per second. |
TSP_ECG_FPS_20 = 50 | ECG frequency rate of 20 frames per second. |
TSP_GSR_FREQ#
CALLBACK_INDEX#
Members
unsigned long long getID ( ) #
Returns the ID of TESLASUIT.Return value
TESLASUIT ID.String getName ( ) #
Returns the name of TESLASUIT.Return value
TESLASUIT name.String getSerial ( ) #
Returns a serial number of TESLASUIT.Return value
TESLASUIT serial numberString getSSID ( ) #
Returns SSID of TESLASUIT.Return value
TESLASUIT SSIDString getUserNetworkSSID ( ) #
Returns SSID of the network, to which TESLASUIT is connected.Return value
SSID of a network, to which TESLASUIT is connectedSuit::TSP_SUIT_HARDWARE_VERSION getHardwareVersion ( ) #
Returns a hardware version of the connected TESLASUIT.Return value
TESLASUIT hardware version, one of the TSP_SUIT_HARDWARE_VERSION valuesString getFirmwareVersion ( ) #
Returns a firmware version of the connected TESLASUIT.Return value
TESLASUIT firmware versionSuit::TSP_SUIT_SIZE getSize ( ) #
Returns the size of TESLASUIT.Return value
Size of TESLASUIT, one of the TSP_SUIT_SIZE valuesSuit::TSP_SUIT_SEX getSex ( ) #
Returns the model of TESLASUIT.Return value
Model of TESLASUIT, one of the TSP_SUIT_SEX valuesSuit::TSP_SUIT_KIT getKit ( ) #
Returns values of the TESLASUIT parts that are available for TESLASUIT.Return value
TSP_SUIT_KIT values of the TESLASUIT parts that are availableSuit::suit_info getInfo ( ) #
Returns all available information about the suit including its name, serial number, SSIDs, hardware and firmware version, size, sex, and kit.Return value
All available information about the suitSuit::TSP_CONNECT_QUALITY getConnectQuality ( ) #
Returns quality of Wi-Fi connection quality for TESLASUIT.Return value
Quality of the Wi-Fi connection of TESLASUIT, one of the TSP_CONNECT_QUALITY valuesunsigned int playAsset ( unsigned long long id ) #
Plays a loaded haptic asset.Arguments
- unsigned long long id - Asset ID
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int stopAsset ( unsigned long long id ) #
Stops playback of a haptic asset.Arguments
- unsigned long long id - Asset ID
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int pausedAsset ( unsigned long long assetId, bool isPaused ) #
Pauses/resumes playback of a haptic asset.Arguments
- unsigned long long assetId - Asset ID
- bool isPaused - true — pause, false — resume playing
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int loopedAsset ( unsigned long long assetId, bool isLooped ) #
Enables/disables playback looping of a haptic asset.Arguments
- unsigned long long assetId - Asset ID
- bool isLooped - true — looped playback, false — normal playback
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.bool isPlayingAsset ( unsigned long long assetId ) #
Checks if the haptic asset is currently playing.Arguments
- unsigned long long assetId - Asset ID.
Return value
true, if the asset is currently playing, false, if the asset is not playing at the moment.unsigned int stopAssets ( ) #
Stops playback of all haptic assets for this TESLASUIT.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int pausedAssets ( bool isPaused ) #
Pauses/resumes playback of all haptic assets for the TESLASUIT.Arguments
- bool isPaused - true — pause, false — resume playing.
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.Vector< unsigned long long > getPlayingAsset ( ) #
Returns a list of the haptic assets that are currently played on the TESLASUIT.Return value
Array of haptic asset IDsSuit::asset_info getAssetInfo ( unsigned long long assetId ) #
Returns the haptic asset information.Arguments
- unsigned long long assetId - ID of a loaded asset
Return value
Information about a haptic asset:- ID of the loaded asset
- Current playback time of the asset
- Duration of the asset, in milliseconds
- Flag that defines whether the asset should be removed after being played
- Flag that defines whether the asset playback is looped
- Flag that defines whether the asset is played at the moment
- Type of a loaded asset: Touch, Effect (Fx), Sample, Channel, Preset, Track, Animation, Material
unsigned int clearAssets ( ) #
Removes all loaded haptic assets for the TESLASUIT.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned long long getSourceMapID ( ) #
Returns ID of a source mapping.Return value
ID of a source mappingunsigned int removeHitMap ( unsigned long long mapId ) #
Removes a hit mapping for TESLASUIT with the given ID.Arguments
- unsigned long long mapId - ID of the hit mapping to be removed
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int buildAssetForMap ( unsigned long long mapId, unsigned long long assetId ) #
Builds an asset for a loaded mapping.Arguments
- unsigned long long mapId - ID of a loaded mapping
- unsigned long long assetId - ID of a loaded asset
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int getMapPolyCount ( unsigned long long mapId, short layer ) #
Returns the count of mapping polygons.Arguments
- unsigned long long mapId - ID of a loaded mapping, from which the count of polygons should be received
- short layer - ID of a layer of the mapping
Return value
Count of mapping polygonsVector< Suit::poly_2d > getMapPolygons ( unsigned long long mapId, short layer ) #
Returns mapping polygons.Arguments
- unsigned long long mapId - ID of a loaded mapping, from which the count of polygons should be received
- short layer - ID of a layer of the mapping
Return value
Array of polygonsunsigned long long cachePoly ( unsigned long long mapId, const Vector< Math::vec2 > & points ) #
Caches a polygon shape for further processing.Arguments
- unsigned long long mapId - ID of a loaded mapping.
- const Vector< Math::vec2 > & points - Points of the polygon.
Return value
ID of cached polygon shape.unsigned long long cacheCircle ( unsigned long long mapId, const Math::vec2 & center, float radius ) #
Caches a circle shape for further processing.Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Math::vec2 & center - Coordinates of the center of a circle
- float radius - A value of a circle radius
Return value
ID of cached shapeunsigned long long cachePoint ( unsigned long long mapId, const Math::vec2 & point ) #
Caches a point for further processing.Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Math::vec2 & point - Coordinates of the point
Return value
ID of cached shape.unsigned int hapticPointHit ( unsigned long long mapId, const Vector< Suit::point_hit > & hits ) #
Hit event. Plays haptic feedback basing on the point, mapping and material.Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Vector< Suit::point_hit > & hits - A buffer of points, in which the hit should be played
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int hapticCircleHit ( unsigned long long mapId, const Vector< Suit::circle_hit > & hits ) #
Hit event. Plays haptic feedback basing on circle shapes, mapping and material.Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Vector< Suit::circle_hit > & hits - A buffer of circle shapes, in which the hit should be played
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int hapticPolyHit ( unsigned long long mapId, const Vector< Suit::poly_hit > & hits ) #
Hit event. Plays haptic feedback basing on polygon shapes, mapping and material.Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Vector< Suit::poly_hit > & hits - A buffer of polygon shapes, in which the hit should be played
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int hapticCacheHit ( unsigned long long mapId, const Vector< Suit::cache_hit > & hits ) #
Hit event. Plays haptic feedback basing on the cached shapes.Arguments
- unsigned long long mapId - ID of a loaded mapping
- const Vector< Suit::cache_hit > & hits - A buffer of cashed shapes
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int updateMul ( unsigned long long mapId, unsigned long long assetId, const Suit::mul_conf & mul ) #
Sets multipliers for frequency, amplitude and pulse width parameters of the haptic asset. All multipliers should lie in the [0, 1] interval.Arguments
- unsigned long long mapId - Loaded mapping ID
- unsigned long long assetId - ID of a haptic asset, for which the multipliers should be set
- const Suit::mul_conf & mul - Structure that stores multipliers
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2.unsigned int mocapUpdatableStart ( const Suit::mocap_opt & opt ) #
Starts updatable streaming of mocap data from TESLASUIT. When you use this function, all data is streamed in the TSMocapData struct. To stream data from earlier hardware versions, use mocapStart() or mocapStartExtended() instead. To get motion data, pass the callback that is invoked each time when the mocap data is updated. Call mocapStop() to stop updatable streaming of mocap data.To use this function, the hardware version of the suit should be 4.5.4 or higher.
Arguments
- const Suit::mocap_opt & opt - Structure that stores frame rate and sensors mask of the mocap data
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_MOCAP_1, TS_FAIL_MOCAP_3.unsigned int mocapStart ( ) #
Starts streaming of Mocap data from TESLASUIT. When you use this function, only mocap_bone_index and quat (9-axis) are streamed in the TSFifoData struct. To stream all data, use mocapStartExtended() instead. To get motion data, pass the callback that is invoked each time that Mocap data is updated. Call mocapStop() to stop Mocap data streaming. It is recommended to stop streaming of extended Mocap data from the same suit before calling the function, as well as streaming of GSR and ECG data.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_MOCAP_1.unsigned int mocapStartExtended ( ) #
Starts streaming of Mocap extended data from TESLASUIT. When you use this function, all data is streamed in the TSFifoData struct. To stream only mocap_bone_index and quat (9-axis), use mocapStart() instead. To get motion data, pass the callback that is invoked each time that Mocap data is updated. Call ts_mocap_stop_extended() to stop Mocap extended data streaming. It is recommended to stop streaming of Mocap data from the same suit before calling the function, as well as streaming of GSR and ECG data.This function is available only for TESLASUITs with hardware version 4.5.2 or earlier.
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_MOCAP_1.unsigned int mocapStop ( ) #
Stops streaming of Mocap data from TESLASUIT.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_MOCAP_2.unsigned int mocapStopExtended ( ) #
Stops streaming of mocap extended data from TESLASUIT.This function is available only for TESLASUITs with hardware version 4.5.2 or earlier.
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_MOCAP_2.unsigned int updateMocapFreq ( Suit::TSP_MOCAP_FREQ freq ) #
Sets frames per second rate of the mocap data streaming for TESLASUIT.Arguments
- Suit::TSP_MOCAP_FREQ freq - Mocap frame rate to be set
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT.unsigned int updateMocapOptions ( const Suit::mocap_opt & opt ) #
Sets the frame rate and sensors mask of the mocap data streaming from TESLASUIT. To use this function, the hardware version of the suit must be 4.5.4 or higher.Arguments
- const Suit::mocap_opt & opt - Structure that stores frame rate and sensors mask of the mocap data
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG.unsigned int biometryStartEcg ( ) #
Starts streaming of ECG data from TESLASUIT. To get ECG data, pass the callback that is invoked each time that ECG data is updated. Call biometryStopEcg() to stop ECG data streaming.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_ECG_1.unsigned int biometryStopEcg ( ) #
Stops streaming of ECG data from TESLASUIT.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_ECG_2.unsigned int biometryStartGsr ( ) #
Starts streaming of GSR data from TESLASUIT. To get GSR data, pass the callback that is invoked each time that GSR data is updated. Call biometryStopGsr() to stop GSR data streaming.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_GSR_1.unsigned int biometryStopGsr ( ) #
Stops streaming of GSR data from TESLASUIT.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_SUIT, TS_FAIL_SH_MEM, TS_FAIL_QUEUE_1, TS_FAIL_QUEUE_2, TS_FAIL_GSR_2.unsigned int updateEcgFreq ( Suit::TSP_ECG_FREQ freq ) #
Sets frames per second rate of ECG data streaming for TESLASUIT.Arguments
- Suit::TSP_ECG_FREQ freq - ECG streaming rate
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT.unsigned int updateGsrFreq ( Suit::TSP_GSR_FREQ freq ) #
Sets frames per second rate of GSR data streaming for TESLASUIT.Arguments
- Suit::TSP_GSR_FREQ freq - GSR streaming rate
Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_SUIT.unsigned int subCurrentFeedback ( ) #
Creates a subscription on the current feedback callbacks. Every time a measurement is taken, the TSOnCurrentFeedbackUpdate callback occurs.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_CURRENT_FEEDBACK_1.unsigned int unsubCurrentFeedback ( ) #
Deletes a subscription on the current feedback callbacks.Return value
A code that describes the result of function execution, one of the following TSP_ values: TS_SUCCESS, TS_FAIL_ARG, TS_FAIL_CURRENT_FEEDBACK_2.Last update:
2024-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)