Skip to content

Commit

Permalink
fix(Interaction): ensure haptic pulse duration is a float
Browse files Browse the repository at this point in the history
Previously, the haptic pulse duration on the interact touch/grab/use
scripts was being cast to an int, which is incorrect, the type taken
byt the `TriggerHapticPulse` method is of type float so no cast
is needed.
  • Loading branch information
thestonefox committed Jun 29, 2016
1 parent 980e8bf commit a219347
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractGrab.cs
Expand Up @@ -401,7 +401,7 @@ private void AttemptGrabObject()
var rumbleAmount = grabbedObject.GetComponent<VRTK_InteractableObject>().rumbleOnGrab;
if (!rumbleAmount.Equals(Vector2.zero))
{
controllerActions.TriggerHapticPulse((ushort)rumbleAmount.y, (int)rumbleAmount.x, 0.05f);
controllerActions.TriggerHapticPulse((ushort)rumbleAmount.y, rumbleAmount.x, 0.05f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractTouch.cs
Expand Up @@ -139,7 +139,7 @@ private void OnTriggerStay(Collider collider)
var rumbleAmount = touchedObjectScript.rumbleOnTouch;
if (!rumbleAmount.Equals(Vector2.zero))
{
controllerActions.TriggerHapticPulse((ushort)rumbleAmount.y, (int)rumbleAmount.x, 0.05f);
controllerActions.TriggerHapticPulse((ushort)rumbleAmount.y, rumbleAmount.x, 0.05f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/SteamVR_Unity_Toolkit/Scripts/VRTK_InteractUse.cs
Expand Up @@ -122,7 +122,7 @@ private void UseInteractedObject(GameObject touchedObject)
var rumbleAmount = usingObjectScript.rumbleOnUse;
if (!rumbleAmount.Equals(Vector2.zero))
{
controllerActions.TriggerHapticPulse((ushort)rumbleAmount.y, (int)rumbleAmount.x, 0.05f);
controllerActions.TriggerHapticPulse((ushort)rumbleAmount.y, rumbleAmount.x, 0.05f);
}
}
}
Expand Down

0 comments on commit a219347

Please sign in to comment.