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,37 @@
using HurricaneVR.Framework.Core;
using HurricaneVR.Framework.Core.Grabbers;
using UnityEngine;
namespace HurricaneVR.TechDemo.Scripts
{
public class DemoHolster : HVRSocket
{
public override Vector3 GetTargetPosition(HVRGrabbable grabbable)
{
if (grabbable.TryGetComponent(out DemoHolsterOrientation orientation))
{
var offSet = -orientation.Orientation.localPosition;
var delta = Quaternion.Inverse(orientation.Orientation.localRotation);
offSet = delta * offSet;
offSet.x *= grabbable.transform.localScale.x;
offSet.y *= grabbable.transform.localScale.y;
offSet.z *= grabbable.transform.localScale.z;
return offSet;
}
return base.GetTargetPosition(grabbable);
}
public override Quaternion GetTargetRotation(HVRGrabbable grabbable)
{
if (grabbable.TryGetComponent(out DemoHolsterOrientation orientation))
{
return Quaternion.Inverse(orientation.Orientation.localRotation);
}
return base.GetTargetRotation(grabbable);
}
}
}