Updated accessibility
This commit is contained in:
parent
5e4d59d30a
commit
2ab022b22b
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user