Bhaptics.Tac 1.4.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bhaptics.Tac --version 1.4.2
NuGet\Install-Package Bhaptics.Tac -Version 1.4.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bhaptics.Tac" Version="1.4.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bhaptics.Tac --version 1.4.2
#r "nuget: Bhaptics.Tac, 1.4.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Bhaptics.Tac as a Cake Addin
#addin nuget:?package=Bhaptics.Tac&version=1.4.2

// Install Bhaptics.Tac as a Cake Tool
#tool nuget:?package=Bhaptics.Tac&version=1.4.2

bHaptics haptic devices C# plugin

This project helps to utilize haptic devices in Unity and other C# based platform. Current version is 1.4.2

Prerequisite

How to use codes

  • You can download library (Bhaptics.Tac) with nuget manager Bhaptics.Tac
  • To install Bhaptics.Tac, run the following command in the Package Manager Console
PM> Install-Package Bhaptics.Tac
or
  • Clone the git then apply dll in src folder
$ git clone https://github.com/bhaptics/tac-sharp.git

Sample (Unity plug-in)

  • Sample source codes for Unity is already available now.
  • For more detail, you can find in unity-plugin

Websocket Communication V2

  • request url : /v2/feedbacks

How to use

  • Import namespaces into classes that will be using haptic feedback.
using Bhaptics.Tact;
  • Use HapticPlayer
var hapticPlayer = new HapticPlayer((connected) =>
{
    Debug.WriteLine("Connected");
});
hapticPlayer.Register(key, "BowShoot.tact");

hapticPlayer.StatusReceived += feedback =>
{
    if (feedback.ActiveKeys.Count <= 0)
    {
        return;
    }
};

Thread.Sleep(100);
hapticPlayer.SubmitRegistered(key);
Thread.Sleep(1000);
hapticPlayer.Dispose();
  • Apply more feedback effects: with .tact file

You can create Tact feeback effects via https://designer.bhaptics.com. The .tact files generated by the designer are timeline based haptic feedback effect files.<br/> You can find more details of the designer here.<br/>

  • Play feedback effects in C# Script: List of PathPoints
var motorCount = 2; // number of motors for PathPoint
List<PathPoint> pathPoints = new List<PathPoint>
{
    new PathPoint(x_position, y_position, intensity)
    /* x_position, y_position are floats in
        normalized value (0.0f to 1.0f) beginning from upper left of the device.*/
    , new PathPoint(x_position, y_position, intensity, motorCount)
};
HapticPlayer.Submit("Point", PositionType.VestFront, pathPoints, duration);
/* duration is a positive integer in milliseconds */
  • Play feedback effects in C# Script: DotPoints
HapticPlayer.Submit("space", PositionType.Head, new DotPoint(3, 100), 1000);
  • Play feedback effects in C# Script: Array of Bytes
byte[] bytes =
{
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 100, 100, 0,
    0, 0, 0, 0, 0
}; 
/* Values should be an int (0~100)
/* Each number is the intensity of the point*/
HapticPlayer.Submit("Bytes", PositionType.VestBack, bytes);
  • Play registered .tact feedback effects using file names
    • The plugin will automatically register tact files in the specified pathPrefix in [bhaptics Manager], using their file name as a key.
/* Just play feedback of Fireball.tact file */
HapticPlayer.SubmitRegistered("Fireball");

/* play feedback of RifleImpact.tact file with counter-clockwise angle and yOffset */
HapticPlayer.SubmitRegisteredVestRotation("RifleImpact", new RotationOption(180f, .5f));

/* play feedback of RifleImpact.tact file with different key. */
HapticPlayer.SubmitRegisteredVestRotation("RifleImpact", "for_backward" new RotationOption(180f, .5f));
HapticPlayer.SubmitRegisteredVestRotation("RifleImpact", "for_front" new RotationOption(0f, .5f));
  • Check if Device is connected
HapticPlayer.IsActive(PositionType.ForearmL)
  • TurnOff Signal
/* Turn off all current Haptic feedback effects */
HapticPlayer.TurnOff();
/* Turn off the specified Haptic feedback effect using its Key string */
HapticPlayer.TurnOff("Fireball");
  • Check whether some feedback is playing or not
/* Return the bool whether 'Fireball' is playing */
bool isFireballFeedbackPlaying = HapticPlayer.IsPlaying("Fireball");
/* Return the bool whether any feedback is playing */
bool isAnyFeedbackPlaying = HapticPlayer.IsPlaying();

Contact

Last update of README.md: Dec 17th, 2018.

Product Compatible and additional computed target framework versions.
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Universal Windows Platform uap is compatible.  uap10.0 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Bhaptics.Tac:

Repository Stars
brandonmousseau/vhvr-mod
Adds VR support to the PC game Valheim
Version Downloads Last updated
1.4.16 1,884 9/8/2020
1.4.15 1,395 9/8/2020
1.4.14 1,514 7/16/2020
1.4.5 1,566 7/3/2019
1.4.2 1,682 12/17/2018
1.3.0 1,940 4/4/2018
1.2.2 1,922 1/11/2018
1.2.1 1,975 12/13/2017
1.1.1 2,062 11/9/2017
1.1.0 1,930 11/3/2017
1.0.2 1,835 8/11/2017
1.0.0 1,908 6/15/2017

bhaptics tactile SDK for c#