[DesktopVRIK] Fixes for 2023r172.

This commit is contained in:
NotAKidoS 2023-09-23 18:58:43 -05:00
parent c7eb5715ba
commit df53840a63
6 changed files with 27 additions and 13 deletions

View file

@ -48,12 +48,15 @@ internal abstract class IKHandler
{
Vector3 currentPosition = currentParent._referencePoint.position;
Quaternion currentRotation = Quaternion.Euler(0f, currentParent.transform.rotation.eulerAngles.y, 0f);
Vector3 deltaPosition = currentPosition - _movementPosition;
Quaternion deltaRotation = Quaternion.Inverse(_movementRotation) * currentRotation;
if (_movementParent == currentParent)
if (_movementParent != null && _movementParent == currentParent)
{
Vector3 deltaPosition = currentPosition - _movementPosition;
Quaternion deltaRotation = Quaternion.identity;
if (currentParent.orientationMode == CVRMovementParent.OrientationMode.RotateWithParent)
deltaRotation = Quaternion.Inverse(_movementRotation) * currentRotation;
_solver.AddPlatformMotion(deltaPosition, deltaRotation, platformPivot);
_ikSimulatedRootAngle = Mathf.Repeat(_ikSimulatedRootAngle + deltaRotation.eulerAngles.y, 360f);
}

View file

@ -26,7 +26,6 @@ public class IKManager : MonoBehaviour
// Player Info
internal Transform _desktopCamera;
internal Transform _vrCamera;
private bool _isEmotePlaying;
// Avatar Info
private Animator _animator;