Spatialization Example
In this example the haptic effect transformation parameters can be tested as a sphere is shooting marbles onto a target capsule representing the vest. In playmode, the device will automatically connect to any Skinetic device available, and update the connection status.
Below, the Boost Global Setting is exposed and allows to increase the overall intensity of every effect on the vest. Additionally, the UI exposes 2 different PatternAssets
that the user can select. Then, the user can change the position of the shooting sphere.
Automatic connection
The automatic connection is the same as the Basic UI Example using the same SkiEx_AutoConnect script.
PatternAssets
In this example, 6 PatternAssets
are added to the preload list of the SkineticDevice
component. After the OnEnable
event, they will be loaded and accessible through LoadedPatterns
, a read-only list of all loaded patterns available on the SkineticDevice
component. The component then acts as a storage that another script will use.
Shooter
Using the UI slider, the user can rotate the shooter around the target and perceive the spatialized haptic effect. The SkiEx_Shooter handles the HapticEffect
Component and sets its TargetDevice
and TargetPattern
through scripting. It also instantiates the bullets and passes them the reference to the HapticEffect
to use. In order to render each bullet impact individually, the HapticEffect
component is set to E_PULLED
.
Impact Handling
The SkiEx_SpatializedCollision handles the computation of the transform parameters in order to apply the haptic effect on the right part of the Skinetic Vest and triggers the HapticEffect
component of the Shooter.