Replace UltimateXR with HurricaneVR

This commit is contained in:
2024-08-08 17:01:07 +02:00
parent e8658374d6
commit fb21dbbb73
5932 changed files with 358362 additions and 2174150 deletions

View File

@@ -0,0 +1,48 @@
using HurricaneVR.Framework.Core.Grabbers;
using HurricaneVR.Framework.Core.Player;
using UnityEngine;
namespace HurricaneVR.Framework.Components
{
public class HVRHandImpactHaptics : HVRImpactHapticsBase
{
public HVRHandGrabber Hand;
[Tooltip("If true and the hand is holding something, haptics will not play.")]
public bool HandGrabbingPrevents = true;
[Tooltip("If true the max force for the haptic amplitude calc will use the hand's default max force.")]
public bool UseHandMaxStrength = true;
private HVRJointHand _hand;
public override float MaxForce
{
get
{
if (UseHandMaxStrength)
{
if ( _hand && _hand.JointSettings)
return _hand.JointSettings.XDrive.MaxForce;
}
return base.MaxForce;
}
}
protected override void Awake()
{
base.Awake();
if (!Hand) TryGetComponent(out Hand);
TryGetComponent(out _hand);
}
protected override void Vibrate(float duration, float amplitude, float frequency)
{
if (HandGrabbingPrevents && Hand.IsGrabbing) return;
Hand.Controller.Vibrate(amplitude, duration, frequency);
}
}
}