Skip to main content

USkineticPattern

More...

#include <SkineticPattern.h>

Inherits from UDataAsset

Public Functions

Name
intLoadPattern(ESkineticError & Error)
ESkineticErrorUnloadPattern()
ESkineticErrorSetAccumulationPattern(TSoftObjectPtr< USkineticPattern > FallbackPattern, float TimeWindow, int MaxAccumulation)
ESkineticErrorEraseAccumulationWindowToPattern()
intPlayEffect(ESkineticError & Error, FEffectProperties EffectProperties)
EEffectStateEffectState(int EffectID)
intGetPatternIntensityBoost(ESkineticError & Error)
ESkineticErrorStopEffect(int EffectID, float Time)

Public Attributes

Name
FTextJson

Detailed Description

class USkineticPattern;

DataAsset representation of a Skinetic pattern. Can be generated by dragging and dropping a .spn file in the content browser.

Public Functions Documentation

function LoadPattern

int LoadPattern(
ESkineticError & Error
)

Parameters:

  • Error contains the corresponding error in case of failure.

Return: positive patternID on success, -1 otherwise.

Load a pattern from a valid asset into the SDK and store locally and return the corresponding patternID. The patternID is a positive index.

function UnloadPattern

ESkineticError UnloadPattern()

Return: NoError on success, corresponding Error code otherwise.

Unload the pattern.

function SetAccumulationPattern

ESkineticError SetAccumulationPattern(
TSoftObjectPtr< USkineticPattern > FallbackPattern,
float TimeWindow,
int MaxAccumulation
)

Parameters:

  • FallbackPattern reference of the fallback pattern
  • TimeWindow time window in seconds during which the accumulation should happen.
  • MaxAccumulation max number of extra accumulated effect instances. 0 means no limit.

Return: NoError on success, corresponding Error code otherwise.

Enable the effect accumulation strategy. The fallback pattern set will be rendered instead of the main one for the TimeWindow and MaxAccumulation defined. See documentation (Haptic Guidelines > Haptic Confusion Mitigation > Effect Accumulation) for details.

function EraseAccumulationWindowToPattern

ESkineticError EraseAccumulationWindowToPattern()

Return: 0 on success, an ERROR otherwise.

Disable the effect accumulation strategy on the pattern if any set.

function PlayEffect

int PlayEffect(
ESkineticError & Error,
FEffectProperties EffectProperties
)

Parameters:

  • Error contains the corresponding error in case of failure.
  • EffectProperties struct to specialized the effect.

Return: positive EffectID on success, -1 otherwise.

Play an haptic effect based on a loaded pattern and return the effect ID of this instance. This ID is a positive index. Each call to PlayEffect() from the same SkineticPattern asset generates a new haptic effect instance totally uncorrelated to the previous ones. The instance is destroyed once it stops playing.

The haptic effect instance reproduces the pattern with variations describes in the structure FEffectProperties. More information on these parameters and how to used them can be found in the structure's description. If the pattern is unloaded, the haptic effect is immediately stopped.

function EffectState

EEffectState EffectState(
int EffectID
)

Parameters:

  • EffectID ID of the effect.

Return: true if the effect is playing, false otherwise.

Check if the effect with the provided ID is still playing.

function GetPatternIntensityBoost

int GetPatternIntensityBoost(
ESkineticError & Error
)

Parameters:

  • Error contains the corresponding error in case of failure.

Return: the pattern intensity boost of the pattern if it exists, 0 otherwise.

Get the pattern boost value which serves as a default value for the playing effect. The value is ranged in [-100; 100]. If the pattern ID is invalid, zero is still returned.

function StopEffect

static ESkineticError StopEffect(
int EffectID,
float Time
)

Parameters:

  • EffectID index identifying the effect.
  • Time duration of the fadeout.

Return: NoError on success, an ERROR otherwise.

Stop the effect instance identified by its effectID. The effect is stop in "time" seconds with a fade out to prevent abrupt transition. if time is set to 0, no fadeout are applied and the effect is stopped as soon as possible. Once an effect is stopped, it is instance is destroyed and its effectID invalidated.

Public Attributes Documentation

variable Json

FText Json;

Json string representation of the pattern. Cannot be modified.


Updated on 2024-05-16 at 15:17:15 +0000