![]() |
Interhaptics SDK for Unity 1.6
|
Public Types | |
enum | PlayMethod { Undefined , OnCollision , OnTrigger } |
Public Member Functions | |
override void | PlayEventVibration () |
Method to start the coroutine from outside (if necessary). Plays the haptic effect after the vibrationOffset. | |
override 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. | |
void | AddTarget (GameObject target) |
void | RemoveTarget (GameObject target) |
![]() | |
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. | |
Public Attributes | |
PlayMethod | playMethod |
![]() | |
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 |
Protected Member Functions | |
override void | Start () |
Initialize the haptic effect settings at the start of the game. | |
virtual void | OnCollisionEnter (Collision other) |
virtual void | OnTriggerEnter (Collider other) |
virtual void | OnTriggerExit (Collider other) |
virtual void | OnCollisionExit (Collision other) |
![]() | |
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 | Update () |
Update the haptic effect settings at every frame. | |
Additional Inherited Members | |
![]() | |
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." |
![]() | |
int | HapticMaterialId [get, set] |
float | SourceIntensity [get, set] |
Definition at line 15 of file SpatialHapticSource.cs.
Enumerator | |
---|---|
Undefined | |
OnCollision | |
OnTrigger |
Definition at line 19 of file SpatialHapticSource.cs.
void Interhaptics.SpatialHapticSource.AddTarget | ( | GameObject | target | ) |
Definition at line 77 of file SpatialHapticSource.cs.
References Interhaptics.SpatialHapticSource.AddTarget(), and Interhaptics.Internal.HapticSource.HapticMaterialId.
Referenced by Interhaptics.SpatialHapticSource.AddTarget().
|
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.
Reimplemented from Interhaptics.Internal.HapticSource.
Definition at line 47 of file SpatialHapticSource.cs.
References Interhaptics.Internal.HapticSource.DebugMode(), Interhaptics.Internal.HapticSource.hapticEffectDuration, and Interhaptics.Internal.HapticSource.Play().
|
protectedvirtual |
Reimplemented in Interhaptics.Samples.XRControllerHapticSource.
Definition at line 95 of file SpatialHapticSource.cs.
References Interhaptics.SpatialHapticSource.playMethod.
|
protectedvirtual |
Reimplemented in Interhaptics.Samples.XRControllerHapticSource.
Definition at line 129 of file SpatialHapticSource.cs.
References Interhaptics.SpatialHapticSource.RemoveTarget().
|
protectedvirtual |
Reimplemented in Interhaptics.Samples.XRControllerHapticSource.
Definition at line 103 of file SpatialHapticSource.cs.
References Interhaptics.SpatialHapticSource.playMethod.
|
protectedvirtual |
Reimplemented in Interhaptics.Samples.XRControllerHapticSource.
Definition at line 124 of file SpatialHapticSource.cs.
References Interhaptics.SpatialHapticSource.RemoveTarget().
|
virtual |
Method to start the coroutine from outside (if necessary). Plays the haptic effect after the vibrationOffset.
Reimplemented from Interhaptics.Internal.HapticSource.
Definition at line 38 of file SpatialHapticSource.cs.
void Interhaptics.SpatialHapticSource.RemoveTarget | ( | GameObject | target | ) |
Definition at line 87 of file SpatialHapticSource.cs.
References Interhaptics.SpatialHapticSource.RemoveTarget().
Referenced by Interhaptics.Samples.XRControllerHapticSource.OnCollisionExit(), Interhaptics.SpatialHapticSource.OnCollisionExit(), Interhaptics.Samples.XRControllerHapticSource.OnTriggerExit(), Interhaptics.SpatialHapticSource.OnTriggerExit(), Interhaptics.SpatialHapticSource.RemoveTarget(), and Interhaptics.Samples.XRControllerHapticSource.XRControlVibration().
|
protectedvirtual |
Initialize the haptic effect settings at the start of the game.
Reimplemented from Interhaptics.Internal.HapticSource.
Reimplemented in Interhaptics.Samples.XRControllerHapticSource.
Definition at line 30 of file SpatialHapticSource.cs.
References Interhaptics.Internal.HapticSource.isLooping, and Interhaptics.Internal.HapticSource.playAtStart.
PlayMethod Interhaptics.SpatialHapticSource.playMethod |
Definition at line 26 of file SpatialHapticSource.cs.
Referenced by Interhaptics.SpatialHapticSource.OnCollisionEnter(), and Interhaptics.SpatialHapticSource.OnTriggerEnter().