TeslasuitDocumentation
Plugins

Haptic

Classes#

SimplifiedChannelsGenerator#

SimplifiedChannelsGenerator

Methods

Generate#

void Generate();


TsHapticBones#

TsHapticBones

Contains bones that are covered by haptic channels.

Fields

RequiredBones IReadOnlyCollection< TsHumanBoneIndex >


TsHapticCollisionHandler#

TsHapticCollisionHandler

Component is used to generate haptic output from collision events.

Fields

HapticPlayer TsHapticPlayer

Haptic player component.

Channel TsHapticSimplifiedChannel

Simplified haptic channel used to get native electric channels to play haptic.

Methods

GetChannels#

IMapping2dElectricChannel[] GetChannels();

Returns native electric channels represented by this handler.

Returns: IMapping2dElectricChannel[]


AddImpact#

void AddImpact(IHapticMaterialPlayable material, float impact, int duration);

Adds channels to the material playable if not exist and sets or updates its impact for a given lifetime in milliseconds.

Parameters

material: IHapticMaterialPlayable

Material used to set impact

impact: float

Channel impact parameter that takes values in the range [0:1]

duration: int

Duration of impact in milliseconds


RemoveImpact#

void RemoveImpact(IHapticMaterialPlayable material);

Removes impact for all channels from the material playable.

Parameters

material: IHapticMaterialPlayable

Material used to remove impact



TsHapticImpulseMaterialObject#

TsHapticImpulseMaterialObject

Material object component where the haptic impact is depended from physical impulse value.

Fields

maxImpulse float

Max impulse value that used to generate normalized impact.

minCollisionDurationMs int

The minimal haptic duration interval when material objects is colliding.

m_hapticMaterial TsHapticMaterialAsset

Haptic material asset reference.

Methods

OnCollisionEnter#

void OnCollisionEnter(Collision collision);

Parameters

collision: Collision


OnCollisionStay#

void OnCollisionStay(Collision collision);

Parameters

collision: Collision


OnCollisionExit#

void OnCollisionExit(Collision collision);

Parameters

collision: Collision



TsHapticPlayer#

TsHapticPlayer

Properties

PlayerHandle — IHapticPlayer (read-only)

Handle to IHapticPlayer device interface.

Device — IDevice (read-only)

Target device that providing IHapticPlayer interface.

Fields

m_deviceBehaviour TsDeviceBehaviour

m_hapticPlayer IHapticPlayer

Methods

Start#

void Start();

DeviceBehaviour_ConnectionStateChanged#

void DeviceBehaviour_ConnectionStateChanged(TsDeviceBehaviour devicetBehaviour, bool connected);

Parameters

devicetBehaviour: TsDeviceBehaviour

connected: bool


GetPlayable#

IHapticPlayable GetPlayable(IHapticAsset asset);

Returns IHapticPlayable by given haptic asset .

Parameters

asset: IHapticAsset

Asset used to get playable.

Returns: IHapticPlayable

IHapticPlayable interface


CreateTouch#

IHapticDynamicPlayable CreateTouch(int frequency, int amplitude, int pulseWidth, long duration);

Creates touch playable from touch parameters.

Parameters

frequency: int

Touch Frequency parameter. Should be in the range [0:150]

amplitude: int

Touch Amplitude parameter. Should be in the range [0:100]

pulseWidth: int

Touch PulseWidth parameter. Should be in the range [0:320]

duration: long

Touch Duration in milliseconds

Returns: IHapticDynamicPlayable



TsHapticSimplifiedChannel#

TsHapticSimplifiedChannel

TsHapticSimplifiedChannel asset is used for targeting a haptic to the same place on the body between the devices.

Fields

BoneIndex TsHumanBoneIndex

Bone index used to get device native channels.

BoneSide TsBone2dSide

Bone side used to get device native channels.

Methods

GetChannels#

IMapping2dElectricChannel[] GetChannels(IDevice device);

Returns native electric channels represented by given device and that covers BoneIndex and BoneSide.

Parameters

device: IDevice

Device to get native channels from

Returns: IMapping2dElectricChannel[]



TsSimplifiedCollisionBuilder#

TsSimplifiedCollisionBuilder

Fields

m_boneWeightThreshold float

meshRenderer SkinnedMeshRenderer

m_avatarSettings TsAvatarSettings

channels TsHapticSimplifiedChannel[]

m_hapticPlayer TsHapticPlayer

build bool

Methods

Start#

void Start();

HasActiveBoneWeight#

bool HasActiveBoneWeight(BoneWeight bw, int transformIndex);

Parameters

bw: BoneWeight

transformIndex: int

Returns: bool


Build#

void Build();

BuildChannel#

TsHapticCollisionHandler BuildChannel(TsHapticSimplifiedChannel channel, BoneWeight[] boneWeights, Vector3[] vertices);

Parameters

channel: TsHapticSimplifiedChannel

boneWeights: BoneWeight[]

vertices: Vector3[]


GetMesh#

Mesh GetMesh(TsHapticSimplifiedChannel channel, BoneWeight[] boneWeights, Vector3[] vertices);

Parameters

channel: TsHapticSimplifiedChannel

boneWeights: BoneWeight[]

vertices: Vector3[]

Returns: Mesh


GetTransformIndex#

int GetTransformIndex(string transformName);

Parameters

transformName: string

Returns: int


Update#

void Update();

GetSidePlanePoint#

Vector3 GetSidePlanePoint(TsHumanBoneIndex index);

Parameters

index: TsHumanBoneIndex

Returns: Vector3