version 2.5.0
This commit is contained in:
@@ -83,11 +83,25 @@ namespace VIVE.OpenXR.Toolkits.RealisticHandInteraction
|
||||
{
|
||||
if (!HandPoseMap.ContainsKey(poseType))
|
||||
{
|
||||
UnityEngine.Object[] handObjects = UnityEngine.Object.FindObjectsOfType(typeof(RealHandPose));
|
||||
for (int i = 0; i < handObjects.Length; i++)
|
||||
{
|
||||
UnityEngine.Object handObject = handObjects[i];
|
||||
if (handObject is RealHandPose realHand &&
|
||||
(realHand.isLeft ? poseType == HandPoseType.HAND_LEFT : poseType == HandPoseType.HAND_RIGHT))
|
||||
{
|
||||
realHand.SetType(poseType);
|
||||
RegisterHandPose(poseType, realHand);
|
||||
return realHand;
|
||||
}
|
||||
}
|
||||
|
||||
GameObject handPoseObject = new GameObject(poseName);
|
||||
RealHandPose realHandPose = handPoseObject.AddComponent<RealHandPose>();
|
||||
realHandPose.SetType(poseType);
|
||||
RegisterHandPose(poseType, realHandPose);
|
||||
return realHandPose;
|
||||
RealHandPose newRealHand = handPoseObject.AddComponent<RealHandPose>();
|
||||
newRealHand.SetType(poseType);
|
||||
RegisterHandPose(poseType, newRealHand);
|
||||
return newRealHand;
|
||||
|
||||
}
|
||||
return HandPoseMap[poseType];
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace VIVE.OpenXR.Toolkits.RealisticHandInteraction
|
||||
{
|
||||
[SerializeField]
|
||||
private Handedness m_Handedness;
|
||||
private bool isLeft => m_Handedness == Handedness.Left;
|
||||
public bool isLeft => m_Handedness == Handedness.Left;
|
||||
private bool keepUpdate = false;
|
||||
|
||||
protected override void OnEnable()
|
||||
@@ -66,8 +66,8 @@ namespace VIVE.OpenXR.Toolkits.RealisticHandInteraction
|
||||
{
|
||||
if (handData.GetJointPosition((JointType)i, ref position) && handData.GetJointRotation((JointType)i, ref rotation))
|
||||
{
|
||||
m_Position[i] = position;
|
||||
m_Rotation[i] = rotation;
|
||||
m_Position[i] = transform.position + transform.rotation * position;
|
||||
m_Rotation[i] = transform.rotation * rotation;
|
||||
m_LocalPosition[i] = position;
|
||||
m_LocalRotation[i] = rotation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user