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,38 @@
using HurricaneVR.Framework.Shared;
using UnityEngine;
namespace HurricaneVR.Framework.ControllerInput
{
public class HVRTrackedController : MonoBehaviour
{
public HVRHandSide HandSide;
public float VelocityMagnitude;// { get; private set; }
public float AngularVelocityMagnitude;// { get; private set; }
public Quaternion DeltaRotationZ { get; private set; }
public float DeltaEulerZ { get; private set; }
private Vector3 _previousUp;
public float DeltaZDisplay;
private void FixedUpdate()
{
var delta = Vector3.SignedAngle(_previousUp, transform.up, transform.forward);
DeltaEulerZ = delta;
DeltaRotationZ = Quaternion.Euler(0, 0, delta);
_previousUp = transform.up;
if (Mathf.Abs(DeltaEulerZ) > 2)
{
DeltaZDisplay = DeltaEulerZ;
}
}
private void LateUpdate()
{
VelocityMagnitude = HVRInputManager.Instance.GetController(HandSide).VelocityMagnitude;
AngularVelocityMagnitude = HVRInputManager.Instance.GetController(HandSide).AngularVelocityMagnitude;
}
}
}