![]() |
Interhaptics SDK for Unity 1.6
|
Public Member Functions | |
virtual void | ApplyTargetIntensity () |
void | ApplySourceIntensity () |
Call this method to apply the source intensity. | |
void | ApplyLooping (int loopValue) |
Call this method to apply the looping state. | |
void | DebugMode (string debugMessage) |
Debug method to print messages in the console only when debugMode is enabled. | |
virtual void | Play () |
Call this method to play the haptic effect. | |
virtual void | Stop () |
Call this method to stop the haptic effect. | |
void | AddTarget (List< HapticBodyMapping.CommandData > Target) |
Call this method to add a target to the haptic effect. | |
void | RemoveTarget (List< HapticBodyMapping.CommandData > Target) |
Call this method to remove a target from the haptic effect. | |
virtual void | PlayEventVibration () |
Method to start the coroutine from outside (if necessary). Plays the haptic effect after the vibrationOffset. | |
virtual IEnumerator | ControlVibration () |
Controls the vibration perception based on the full length of the haptic material; stops any residual haptics which might come from the controller after the haptic playback length (made for platforms other than mobile) | |
Public Attributes | |
HapticMaterial | hapticMaterial |
bool | useStreamingAssets = false |
string | hapticEffectStreamingAssetsPath |
float | vibrationOffset |
bool | debugMode |
bool | isLooping |
int | maxLoops = 1 |
float | maxLoopTime = 10f |
double | targetIntensity = 1.0 |
bool | playAtStart = false |
bool | isPlaying = false |
double | hapticEffectDuration = 0 |
Coroutine | playingCoroutine = null |
double | loopStartTime = 0 |
Static Public Attributes | |
const string | ERROR_MESSAGE_MONO = "Interhaptics requires IL2CPP scripting backend for Android. Please change it in Player Settings. Haptics will not play on the Mono scripting backend on the Android platform." |
Protected Member Functions | |
virtual void | Awake () |
Add the haptic effect file to the when the object is created. The haptic effect file can be in the StreamingAssets folder if the useStreamingAssets property is set to true. | |
virtual void | Start () |
Initialize the haptic effect settings at the start of the game. | |
virtual void | Update () |
Update the haptic effect settings at every frame. | |
Properties | |
int | HapticMaterialId [get, set] |
float | SourceIntensity [get, set] |
Definition at line 17 of file HapticSource.cs.
void Interhaptics.Internal.HapticSource.AddTarget | ( | List< HapticBodyMapping.CommandData > | Target | ) |
Call this method to add a target to the haptic effect.
Target |
Definition at line 240 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.HapticMaterialId.
Referenced by Interhaptics.Utils.AudioHapticSource.Play(), Interhaptics.Utils.EventHapticSource.Play(), Interhaptics.Utils.ParametricHapticSource.Play(), Interhaptics.Utils.EventHapticSource.PlayEventVibration(), Interhaptics.Utils.ParametricHapticSource.PlayEventVibration(), Interhaptics.Utils.AudioHapticSource.Start(), and Interhaptics.Utils.EventHapticSource.Start().
void Interhaptics.Internal.HapticSource.ApplyLooping | ( | int | loopValue | ) |
Call this method to apply the looping state.
Definition at line 192 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.DebugMode(), and Interhaptics.Internal.HapticSource.HapticMaterialId.
Referenced by Interhaptics.Internal.HapticSource.ControlVibration().
void Interhaptics.Internal.HapticSource.ApplySourceIntensity | ( | ) |
Call this method to apply the source intensity.
Definition at line 185 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.HapticMaterialId.
Referenced by Interhaptics.Samples.SourceIntensitySlider.HandleSliderValueChanged(), and Interhaptics.Internal.HapticSource.Update().
|
virtual |
Definition at line 177 of file HapticSource.cs.
|
protectedvirtual |
Add the haptic effect file to the when the object is created. The haptic effect file can be in the StreamingAssets folder if the useStreamingAssets property is set to true.
Reimplemented in Interhaptics.Utils.AudioHapticSource, and Interhaptics.Utils.ParametricHapticSource.
Definition at line 86 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.DebugMode(), Interhaptics.Internal.HapticSource.ERROR_MESSAGE_MONO, Interhaptics.Internal.HapticSource.hapticEffectStreamingAssetsPath, Interhaptics.Internal.HapticSource.hapticMaterial, Interhaptics.Internal.HapticSource.HapticMaterialId, and Interhaptics.Internal.HapticSource.useStreamingAssets.
|
virtual |
Controls the vibration perception based on the full length of the haptic material; stops any residual haptics which might come from the controller after the haptic playback length (made for platforms other than mobile)
Reimplemented in Interhaptics.SpatialHapticSource, and Interhaptics.Utils.AudioHapticSource.
Definition at line 279 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.ApplyLooping(), Interhaptics.Internal.HapticSource.DebugMode(), Interhaptics.Internal.HapticSource.hapticEffectDuration, Interhaptics.Internal.HapticSource.isLooping, Interhaptics.Internal.HapticSource.isPlaying, Interhaptics.Internal.HapticSource.maxLoops, Interhaptics.Internal.HapticSource.maxLoopTime, Interhaptics.Internal.HapticSource.Play(), and Interhaptics.Internal.HapticSource.playingCoroutine.
Referenced by Interhaptics.Internal.HapticSource.PlayEventVibration().
void Interhaptics.Internal.HapticSource.DebugMode | ( | string | debugMessage | ) |
Debug method to print messages in the console only when debugMode is enabled.
debugMessage |
Definition at line 202 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.debugMode.
Referenced by Interhaptics.Internal.HapticSource.ApplyLooping(), Interhaptics.Internal.HapticSource.Awake(), Interhaptics.Utils.ParametricHapticSource.Awake(), Interhaptics.Internal.HapticSource.ControlVibration(), Interhaptics.SpatialHapticSource.ControlVibration(), Interhaptics.Utils.AudioHapticSource.ControlVibration(), Interhaptics.Utils.ParametricHapticSource.InitializeParametricHapticSource(), Interhaptics.Samples.XRControllerHapticSource.OnCollisionEnter(), Interhaptics.Samples.XRControllerHapticSource.OnTriggerEnter(), Interhaptics.Utils.EventHapticSource.Play(), Interhaptics.Internal.HapticSource.PlayEventVibration(), Interhaptics.Internal.HapticSource.Start(), Interhaptics.Internal.HapticSource.Update(), and Interhaptics.Samples.XRControllerHapticSource.XRControlVibration().
|
virtual |
Call this method to play the haptic effect.
Reimplemented in Interhaptics.Utils.AudioHapticSource, Interhaptics.Utils.EventHapticSource, and Interhaptics.Utils.ParametricHapticSource.
Definition at line 213 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.HapticMaterialId, Interhaptics.Internal.HapticSource.isPlaying, and Interhaptics.Internal.HapticSource.vibrationOffset.
Referenced by Interhaptics.Internal.HapticSource.ControlVibration(), Interhaptics.SpatialHapticSource.ControlVibration(), and Interhaptics.Samples.XRControllerHapticSource.XRControlVibration().
|
virtual |
Method to start the coroutine from outside (if necessary). Plays the haptic effect after the vibrationOffset.
Reimplemented in Interhaptics.SpatialHapticSource, Interhaptics.Utils.AudioHapticSource, Interhaptics.Utils.EventHapticSource, and Interhaptics.Utils.ParametricHapticSource.
Definition at line 256 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.ControlVibration(), Interhaptics.Internal.HapticSource.DebugMode(), Interhaptics.Internal.HapticSource.hapticEffectDuration, Interhaptics.Internal.HapticSource.HapticMaterialId, Interhaptics.Internal.HapticSource.isPlaying, Interhaptics.Internal.HapticSource.loopStartTime, Interhaptics.Internal.HapticSource.maxLoops, Interhaptics.Internal.HapticSource.playingCoroutine, and Interhaptics.Internal.HapticSource.vibrationOffset.
Referenced by Interhaptics.Internal.HapticSource.Start().
void Interhaptics.Internal.HapticSource.RemoveTarget | ( | List< HapticBodyMapping.CommandData > | Target | ) |
Call this method to remove a target from the haptic effect.
Target |
Definition at line 249 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.HapticMaterialId.
Referenced by Interhaptics.Utils.AudioHapticSource.Stop().
|
protectedvirtual |
Initialize the haptic effect settings at the start of the game.
Reimplemented in Interhaptics.Samples.XRControllerHapticSource, Interhaptics.SpatialHapticSource, Interhaptics.Utils.AudioHapticSource, Interhaptics.Utils.EventHapticSource, and Interhaptics.Utils.ParametricHapticSource.
Definition at line 125 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.DebugMode(), Interhaptics.Internal.HapticSource.hapticEffectDuration, Interhaptics.Internal.HapticSource.hapticMaterial, Interhaptics.Internal.HapticSource.HapticMaterialId, Interhaptics.Internal.HapticSource.isLooping, Interhaptics.Internal.HapticSource.maxLoops, Interhaptics.Internal.HapticSource.maxLoopTime, Interhaptics.Internal.HapticSource.playAtStart, and Interhaptics.Internal.HapticSource.PlayEventVibration().
|
virtual |
Call this method to stop the haptic effect.
Reimplemented in Interhaptics.Utils.AudioHapticSource, Interhaptics.Utils.EventHapticSource, and Interhaptics.Utils.ParametricHapticSource.
Definition at line 222 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.HapticMaterialId, Interhaptics.Internal.HapticSource.isPlaying, and Interhaptics.Internal.HapticSource.playingCoroutine.
|
protectedvirtual |
Update the haptic effect settings at every frame.
Definition at line 165 of file HapticSource.cs.
References Interhaptics.Internal.HapticSource.ApplySourceIntensity(), and Interhaptics.Internal.HapticSource.DebugMode().
bool Interhaptics.Internal.HapticSource.debugMode |
Definition at line 38 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.DebugMode().
|
static |
Definition at line 64 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.Awake(), and Interhaptics.Utils.ParametricHapticSource.Awake().
double Interhaptics.Internal.HapticSource.hapticEffectDuration = 0 |
Definition at line 56 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.ControlVibration(), Interhaptics.SpatialHapticSource.ControlVibration(), Interhaptics.Utils.AudioHapticSource.ControlVibration(), Interhaptics.Samples.XRControllerHapticSource.OnCollisionEnter(), Interhaptics.Samples.XRControllerHapticSource.OnTriggerEnter(), Interhaptics.Internal.HapticSource.PlayEventVibration(), Interhaptics.Internal.HapticSource.Start(), and Interhaptics.Samples.XRControllerHapticSource.XRControlVibration().
string Interhaptics.Internal.HapticSource.hapticEffectStreamingAssetsPath |
Definition at line 27 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.Awake().
HapticMaterial Interhaptics.Internal.HapticSource.hapticMaterial |
Definition at line 21 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.Awake(), and Interhaptics.Internal.HapticSource.Start().
bool Interhaptics.Internal.HapticSource.isLooping |
bool Interhaptics.Internal.HapticSource.isPlaying = false |
Definition at line 54 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.ControlVibration(), Interhaptics.Internal.HapticSource.Play(), Interhaptics.Internal.HapticSource.PlayEventVibration(), Interhaptics.Internal.HapticSource.Stop(), and Interhaptics.Samples.EventHapticManagerMobile.StopPlayingEventHapticSources().
double Interhaptics.Internal.HapticSource.loopStartTime = 0 |
Definition at line 62 of file HapticSource.cs.
Referenced by Interhaptics.Utils.AudioHapticSource.ControlVibration(), and Interhaptics.Internal.HapticSource.PlayEventVibration().
int Interhaptics.Internal.HapticSource.maxLoops = 1 |
float Interhaptics.Internal.HapticSource.maxLoopTime = 10f |
Definition at line 49 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.ControlVibration(), and Interhaptics.Internal.HapticSource.Start().
bool Interhaptics.Internal.HapticSource.playAtStart = false |
Definition at line 53 of file HapticSource.cs.
Referenced by Interhaptics.Utils.AudioHapticSource.Awake(), Interhaptics.Internal.HapticSource.Start(), Interhaptics.SpatialHapticSource.Start(), and Interhaptics.Utils.AudioHapticSource.Start().
Coroutine Interhaptics.Internal.HapticSource.playingCoroutine = null |
Definition at line 60 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.ControlVibration(), Interhaptics.Utils.AudioHapticSource.ControlVibration(), Interhaptics.Internal.HapticSource.PlayEventVibration(), Interhaptics.Utils.AudioHapticSource.PlayEventVibration(), Interhaptics.Utils.AudioHapticSource.Start(), Interhaptics.Internal.HapticSource.Stop(), and Interhaptics.Samples.EventHapticManagerMobile.StopPlayingEventHapticSources().
double Interhaptics.Internal.HapticSource.targetIntensity = 1.0 |
Definition at line 51 of file HapticSource.cs.
bool Interhaptics.Internal.HapticSource.useStreamingAssets = false |
Definition at line 24 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.Awake().
float Interhaptics.Internal.HapticSource.vibrationOffset |
Definition at line 34 of file HapticSource.cs.
Referenced by Interhaptics.Utils.AudioHapticSource.ControlVibration(), Interhaptics.Internal.HapticSource.Play(), and Interhaptics.Internal.HapticSource.PlayEventVibration().
|
getset |
Definition at line 65 of file HapticSource.cs.
Referenced by Interhaptics.Internal.HapticSource.AddTarget(), Interhaptics.SpatialHapticSource.AddTarget(), Interhaptics.Internal.HapticSource.ApplyLooping(), Interhaptics.Internal.HapticSource.ApplySourceIntensity(), Interhaptics.Internal.HapticSource.Awake(), Interhaptics.Utils.ParametricHapticSource.InitializeParametricHapticSource(), Interhaptics.Internal.HapticSource.Play(), Interhaptics.Internal.HapticSource.PlayEventVibration(), Interhaptics.Internal.HapticSource.RemoveTarget(), Interhaptics.Internal.HapticSource.Start(), Interhaptics.Internal.HapticSource.Stop(), and Interhaptics.Samples.EventHapticManagerMobile.StopPlayingEventHapticSources().
|
getset |
Definition at line 71 of file HapticSource.cs.