From 2ab022b22b3823ec577fa3ecb36bbc27ae8ec3a9 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 24 Feb 2023 16:08:19 +0100 Subject: [PATCH] Updated accessibility --- .../Scripts/Movements/LegMovements.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Runtime/HumanoidControl/Scripts/Movements/LegMovements.cs b/Runtime/HumanoidControl/Scripts/Movements/LegMovements.cs index af60fa1..65a5eb9 100644 --- a/Runtime/HumanoidControl/Scripts/Movements/LegMovements.cs +++ b/Runtime/HumanoidControl/Scripts/Movements/LegMovements.cs @@ -82,7 +82,7 @@ namespace Passer.Humanoid { #region Upper Leg - private Quaternion NaturalUpperLegOrientation(FootTarget footTarget, Vector3 footPosition) { + protected Quaternion NaturalUpperLegOrientation(FootTarget footTarget, Vector3 footPosition) { Quaternion oldUpperLegRotation = footTarget.upperLeg.bone.transform.rotation * footTarget.upperLeg.bone.toTargetRotation; Quaternion upperLegRotation = CalculateUpperLegRotation(footTarget, footTarget.upperLeg.bone.transform.position, footPosition, footTarget.foot.target.transform.rotation, footTarget.upperLeg.bone.length, footTarget.lowerLeg.bone.length); //upperLegRotation = LimitRotationSpeed(oldUpperLegRotation, upperLegRotation); @@ -130,7 +130,8 @@ namespace Passer.Humanoid { #endregion #region Lower Leg - private Quaternion NaturalLowerLegOrientation(FootTarget footTarget, Quaternion upperLegRotation, Vector3 footPosition) { + + protected Quaternion NaturalLowerLegOrientation(FootTarget footTarget, Quaternion upperLegRotation, Vector3 footPosition) { float lowerLegAngle = CalculateKneeAngle(footTarget.upperLeg.bone.transform.position, footPosition, footTarget.upperLeg.bone.length, footTarget.lowerLeg.bone.length); if (footTarget.lowerLeg.bone.jointLimitations) @@ -163,12 +164,13 @@ namespace Passer.Humanoid { kneeAngle = 180; return 180 - kneeAngle; } + #endregion #region Foot // Calculate the foot position taking body limitations into account - private Vector3 NaturalFootPosition(FootTarget footTarget) { + protected Vector3 NaturalFootPosition(FootTarget footTarget) { if (footTarget.ground == null || !footTarget.physics) return footTarget.foot.target.transform.position; else { @@ -177,7 +179,7 @@ namespace Passer.Humanoid { } // Calculate the foot orientation taking body limitation into account - private Quaternion NaturalFootOrientation(FootTarget footTarget) { + protected Quaternion NaturalFootOrientation(FootTarget footTarget) { Quaternion footOrientation = DetermineFootOrientation(footTarget); if (footTarget.foot.bone.jointLimitations) footOrientation = LimitAngle(footTarget.foot, ref lastLocalFootRotation, footOrientation); @@ -232,7 +234,8 @@ namespace Passer.Humanoid { #endregion #region Toes - private Quaternion NaturalToesOrientation(FootTarget footTarget) { + + protected Quaternion NaturalToesOrientation(FootTarget footTarget) { Quaternion footRotation = footTarget.foot.bone.transform.rotation * footTarget.foot.bone.toTargetRotation; if (footTarget.ground != null) { return Quaternion.LookRotation(footTarget.groundNormal, footRotation * Vector3.back) * Quaternion.Euler(90, 0, 0); @@ -241,6 +244,7 @@ namespace Passer.Humanoid { return footRotation; } } + #endregion private static float Square(float x) {