Class BhapticsPhysicsGlove
Erbt von MonoBehaviour
Die Klasse BhapticsPhysicsGlove enthält die Funktionen zur Verwendung der haptischen Geräte von bHaptics.
Public Methods
SendEnterHaptic
public void SendEnterHaptic(bool isLeft, int fingerIndex);
public void SendEnterHaptic(bool isLeft, int fingerIndex, Collision collision);
public void SendEnterHaptic(bool isLeft, int fingerIndex, Vector3 velocity);
public void SendEnterHaptic(PositionType position, int fingerIndex);
public void SendEnterHaptic(PositionType position, int fingerIndex, Collision collision);
public void SendEnterHaptic(PositionType position, int fingerIndex, Vector3 velocity);
Sendet haptisches Feedback beim Eintreten (enter). Verwenden Sie es, wenn die Hand begonnen hat, etwas zu berühren, etwa bei OnCollisionEnter im Collider.
Declaration
public void SendEnterHaptic(bool isLeft, int fingerIndex);
public void SendEnterHaptic(PositionType position, int fingerIndex);
Description
Sendet haptisches Feedback beim Eintreten basierend auf der Einstellung der maximalen Geschwindigkeitsänderung.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
private void OnCollisionEnter(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback will come to the index finger of the left glove.
BhapticsPhysicsGlove.Instance.SendEnterHaptic(isLeft, fingerIndex);
// OR
BhapticsPhysicsGlove.Instance.SendEnterHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR, fingerIndex);
}
}
Declaration
public void SendEnterHaptic(bool isLeft, int fingerIndex, Collision collision);
public void SendEnterHaptic(PositionType position, int fingerIndex, Collision collision);
Description
Sendet haptisches Feedback beim Eintreten basierend auf der relativen Geschwindigkeit aus den Kollisionsdaten.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
Collision collision: Kollisionsdaten.
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
private void OnCollisionEnter(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback based on the relative velocity of the collision to the index finger of the left glove.
BhapticsPhysicsGlove.Instance.SendEnterHaptic(isLeft, fingerIndex, collision);
// OR
BhapticsPhysicsGlove.Instance.SendEnterHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR, fingerIndex, collision);
}
}
Declaration
public void SendEnterHaptic(bool isLeft, int fingerIndex, Vector3 velocity);
public void SendEnterHaptic(PositionType position, int fingerIndex, Vector3 velocity);
Description
Sendet haptisches Feedback beim Eintreten basierend auf den bereitgestellten Geschwindigkeitsdaten.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
Vector3 velocity: Geschwindigkeitsdaten.
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
private void OnCollisionEnter(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback will come to the index finger of the left glove based on velocity data.
BhapticsPhysicsGlove.Instance.SendEnterHaptic(isLeft, fingerIndex, collision.relativeVelocity);
// OR
BhapticsPhysicsGlove.Instance.SendEnterHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR, fingerIndex, collision.relativeVelocity);
}
}
SendStayHaptic
public void SendStayHaptic(bool isLeft, int fingerIndex);
public void SendStayHaptic(bool isLeft, int fingerIndex, Transform slaveTransform, Transform masterTransform);
public void SendStayHaptic(bool isLeft, int fingerIndex, float relativeDistance);
public void SendStayHaptic(PositionType position, int fingerIndex);
public void SendStayHaptic(PositionType position, int fingerIndex, Transform slaveTransform, Transform masterTransform);
public void SendStayHaptic(PositionType position, int fingerIndex, float relativeDistance);
Sendet haptisches Feedback beim Verbleiben (stay). Verwenden Sie es, wenn die Hand etwas weiterhin berührt, etwa bei OnCollisionStay im Collider.
Declaration
public void SendStayHaptic(bool isLeft, int fingerIndex);
public void SendStayHaptic(PositionType position, int fingerIndex);
Description
Sendet haptisches Feedback beim Verbleiben basierend auf der Einstellung der maximalen Geschwindigkeitsänderung.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
private void OnCollisionStay(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback will come to the index finger of the left glove.
BhapticsPhysicsGlove.Instance.SendStayHaptic(isLeft, fingerIndex);
// OR
BhapticsPhysicsGlove.Instance.SendStayHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR, fingerIndex);
}
}
Declaration
public void SendStayHaptic(bool isLeft, int fingerIndex, Transform slaveTransform, Transform masterTransform);
public void SendStayHaptic(PositionType position, int fingerIndex, Transform slaveTransform, Transform masterTransform);
Description
Sendet haptisches Feedback beim Verbleiben mit Transformationsdaten.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
Transform slaveTransform: Slave-Transformationsdaten.Transform masterTransform: Master-Transformationsdaten.
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
public Transform masterTransform;
private void OnCollisionStay(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback based on the relative velocity of the collision to the index finger of the left glove.
BhapticsPhysicsGlove.Instance.SendStayHaptic(isLeft, fingerIndex, transform, masterTransform);
// OR
BhapticsPhysicsGlove.Instance.SendStayHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR, fingerIndex, transform, masterTransform);
}
}
Declaration
public void SendStayHaptic(bool isLeft, int fingerIndex, float relativeDistance);
public void SendStayHaptic(PositionType position, int fingerIndex, float relativeDistance);
Description
Sendet haptisches Feedback beim Verbleiben basierend auf den bereitgestellten Geschwindigkeitsdaten.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
float relativeDistance: Daten der relativen Distanz.
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
public float distance;
private void OnCollisionStay(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback will come to the index finger of the left glove based on velocity data.
BhapticsPhysicsGlove.Instance.SendStayHaptic(isLeft, fingerIndex, distance);
// OR
BhapticsPhysicsGlove.Instance.SendStayHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR , fingerIndex, distance);
}
}
SendExitHaptic
public void SendExitHaptic(bool isLeft, int fingerIndex);
public void SendExitHaptic(PositionType position, int fingerIndex);
Sendet haptisches Feedback beim Austreten (exit) basierend auf der Einstellung der maximalen Geschwindigkeitsänderung.
Parameters
bool isLeft: Gibt an, ob der linke Handschuh verwendet wird.PositionType position: Typ des bHaptics-Geräts.PositionType.GloveL(== 8)PositionType.GloveR(== 9)
int fingerIndex: Index des Fingers (oder des Handgelenks).0: Daumenspitze1: Zeigefingerspitze2: Mittelfingerspitze3: Ringfingerspitze4: Spitze des kleinen Fingers5: Handgelenk
Example
using Bhaptics.SDK2;
using Bhaptics.SDK2.Glove;
public class Example : MonoBehaviour
{
public int fingerIndex;
public bool isLeft;
private void OnCollisionExit(Collision collision)
{
// If isLeft is true and fingerIndex is 1, then feedback will come to the index finger of the left glove.
BhapticsPhysicsGlove.Instance.SendExitHaptic(isLeft, fingerIndex);
// OR
BhapticsPhysicsGlove.Instance.SendExitHaptic(isLeft ? PositionType.GloveL : PositionType.GloveR, fingerIndex);
}
}
ChangeHapticMode
public void ChangeHapticMode(BhapticsPhysicsGloveSettings.HapticMode mode);
Ändert den Haptikmodus. Weitere Informationen zu den Modi finden Sie auf der Seite BhapticsPhysicsGloveSettings.HapticMode.
Von MonoBehaviour geerbte Mitglieder finden Sie in den Unity References.