Update accessibility

This commit is contained in:
Pascal Serrarens 2023-04-05 12:50:35 +02:00
parent f19acc5133
commit c013cf0722

View File

@ -186,7 +186,7 @@ namespace Passer.Humanoid {
#region Force #region Force
protected Vector3 CalculateForce() { protected virtual Vector3 CalculateForce() {
/* /*
//Vector3 locationDifference = handTarget.stretchlessTarget.position - handTarget.handRigidbody.position; //Vector3 locationDifference = handTarget.stretchlessTarget.position - handTarget.handRigidbody.position;
//Debug.DrawLine(handTarget.stretchlessTarget.position, handTarget.handRigidbody.position); //Debug.DrawLine(handTarget.stretchlessTarget.position, handTarget.handRigidbody.position);
@ -204,7 +204,7 @@ namespace Passer.Humanoid {
return force; return force;
} }
public Vector3 CalculateForce(Vector3 position, Vector3 targetPosition, bool damping = false) { public virtual Vector3 CalculateForce(Vector3 position, Vector3 targetPosition, bool damping = false) {
Vector3 force = (targetPosition - position) * handTarget.strength; Vector3 force = (targetPosition - position) * handTarget.strength;
if (damping) if (damping)
force += CalculateForceDamper(); force += CalculateForceDamper();
@ -212,9 +212,9 @@ namespace Passer.Humanoid {
} }
private const float damping = 12; private const float damping = 12;
private float lastDistanceTime; protected float lastDistanceTime;
private Vector3 lastDistanceToTarget; protected Vector3 lastDistanceToTarget;
private Vector3 CalculateForceDamper() { protected virtual Vector3 CalculateForceDamper() {
Vector3 distanceToTarget = handTarget.hand.bone.transform.position - handTarget.hand.target.transform.position; Vector3 distanceToTarget = handTarget.hand.bone.transform.position - handTarget.hand.target.transform.position;
float deltaTime = Time.fixedTime - lastDistanceTime; float deltaTime = Time.fixedTime - lastDistanceTime;