Update accessibility
This commit is contained in:
parent
f19acc5133
commit
c013cf0722
@ -186,7 +186,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
#region Force
|
||||
|
||||
protected Vector3 CalculateForce() {
|
||||
protected virtual Vector3 CalculateForce() {
|
||||
/*
|
||||
//Vector3 locationDifference = handTarget.stretchlessTarget.position - handTarget.handRigidbody.position;
|
||||
//Debug.DrawLine(handTarget.stretchlessTarget.position, handTarget.handRigidbody.position);
|
||||
@ -204,7 +204,7 @@ namespace Passer.Humanoid {
|
||||
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;
|
||||
if (damping)
|
||||
force += CalculateForceDamper();
|
||||
@ -212,9 +212,9 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
private const float damping = 12;
|
||||
private float lastDistanceTime;
|
||||
private Vector3 lastDistanceToTarget;
|
||||
private Vector3 CalculateForceDamper() {
|
||||
protected float lastDistanceTime;
|
||||
protected Vector3 lastDistanceToTarget;
|
||||
protected virtual Vector3 CalculateForceDamper() {
|
||||
Vector3 distanceToTarget = handTarget.hand.bone.transform.position - handTarget.hand.target.transform.position;
|
||||
|
||||
float deltaTime = Time.fixedTime - lastDistanceTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user