This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Getting Started (From 1.5.0)
Sangwon Choi edited this page May 29, 2020
·
9 revisions
-
Or
you can also download latest version here and paste it your engine's plugins folder.
- Provided functions are static so you can find our functions in your blueprint.
- Just, right click and check the bhaptics section or search with
bhaptics
keyword.
- An example below uses
Circle
haptic pattern which is created from bHaptics Designer. For more about the designer, please check Presets section
-
If you cannot find
Circle
, please check this section or just drag-and-drop exported files from the designer. -
You can find over 200 different haptic feedback files/patterns here.
Or
you can make your own pattern using bHaptics designer.
Designer https://designer.bhaptics.com
Tutorial for designer https://youtu.be/Pyq9GHdchzc
- Presets can be constructed through using the bHaptics designer at https://designer2.bhaptics.com
- After signing in, you can create a new project and design a feedback effect for use in the game.
- In order to use the feedback effect in Unreal, export the feedback file from the Designer, and simply drag and drop the file into your Unreal project, or you can import the files using the import function in the Content Browser.
- The files will be automatically converted into a UAsset, and you can view the feedback effect's identifying Key, the device it will be played on, and the duration of the effect
- Example feedback files are given in the Feedback folder in the Plugin's contents directory, to help get you started.
- There are three functions provided for playing the feedback from haptic feedback files: Submit Feedback, Submit Feedback with Intensity and Duration, and Submit Feedback with Transform.
- To play a given Feedback File, simply call the Submit Feedback function and select the Feedback File to be played.
- The additional two functions add additional options to the alter the feedback file for any dynamic changes needed.
- Submitting with Transform adds a RotationOption, with Offset-Angle and Offset-Y, which will transform any Tactot feedback files. The Offset Angle rotates the file around the body counter-clockwise, horizontally, by the given degrees, switching from front to the back when leaving the boundary of the front part of the vest, or vice versa. Similarly, OffsetY transforms the feedback up or down the body. This allows for a single impact feedback to be used anywhere on the body by rotating and transforming the horizontal and vertical components.
- Submitting with Intensity and Duration adds a ScaleOption to the previous function, which adds scale variables to alter the original feedback's intensity and duration. For instance an intensity and/or duration scale(s) of 0.5 would halve the original intensity and duration of the feedback, while a value of 2.0 would double it, although the intensity will be capped at a value of 100, and neither value can be less than 0. This can be applied to any device's feedback file.
- Both of the above methods also include an AltKey, or Alternative Key, in the case when a submitted feedback file key is already being played. If left blank, the submission call will interrupt the playing feedback and restart it; however if an AltKey is given, the two feedback files will be played together, with the second under the AltKey. This is useful in cases such as when a character is hit twice requiring the same feedback file to be played simultaneously.
- These functions allow feedback files to be dynamically altered while in-game, while not affecting the file itself, allowing for a single file to be adapted to multiple situations.
- You can also access each individual motor using the SubmitFeedbackUsingDots function, which takes in an array of DotPoints as an input.
- A DotPoint represents an individual motor in the array, specifying which index the motor is and at what intensity it should vibrate.
- The index ranges from 0 to 19 for the Tactosy and Tactot devices, 0 to 6 for the tactal, and 0 to 9 for other devices, and moves from left to right.
- Since the input for this function is an array, you can send multiple dots as a feedback effect at once.
- To give more of a location-specific effect, SubmitFeedbackUsingPaths can be called using the PathPoints structure.
- PathPoints give the illusion that the feedback is coming from a point between two motors and can be used to make the feedback effect seem more continuous.
- The structure consists of an X and Y coordinate on the device plane, as well as the intensity of the feedback.
- The coordinates range from the top-left of the device as (0,0) to the bottom-right as (1,1).
- Multiple points can be submitted together with the feedback effect.
- The bHaptics designer is a great tool for testing effects and trying out ideas, and can help with planning effects you want to create in-game.
- PathPoints will automatically interpolate between motors, and the intensity will be shared between the two. If this feedback feels too weak for your situation, you can add more points clustered together to increase the feedback effect when interpolated between points.
- Be careful of naming the feedback effects, as 2 feedback effects with the same name will interrupt each other. Use the IsPlaying function to check if a specifc feedback effect is finished before sending the same feedback effect again, or submit with an AltKey so both feedback files play together.
- Be aware of the duration of your effects. You may need to add delays to ensure the submitted feedback has finished playing before submitting the next, in the case of a series of feedback calls to create the effect (ie. explosion, moving feedback).
- For the Submit Key With Transform, you can consider the torso as a cylinder and project the haptic feedback file onto that. You can then change the horizontal offset by finding the angle offset from the forward vector, and the OffsetY from the height on the cylinder to play. This will help the feedback feel more continuous as it moves from the front to the back or vice versa. You can see the KeyDummy blueprint for an example of how to do this.
- Some simple examples are provided in the Plugin's Content/Blueprints folder, with Dummies for collision detection examples, as well some simple macro effects in the Macro Effect Library .
- The ForLoops in blueprints can cause unexpected results with feedback, as it does not natively support delays. A ForLoopWithDelay macro is provided; however, if you are using loops and delays heavily, it is recommended to work in C++ for these functions, or use the designer for the feedback.
- Official Website: http://www.bhaptics.com/
- E-mail: contact@bhaptics.com
Last update: March 5th, 2020.