mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
normalize a vector that needed it. Correct rolloff of grab force
This commit is contained in:
parent
b59352a10e
commit
32dbbbdc8f
1 changed files with 1 additions and 1 deletions
|
@ -179,7 +179,7 @@ function update(deltaTime) {
|
|||
if (distanceToTarget > CLOSE_ENOUGH) {
|
||||
// compute current velocity in the direction we want to move
|
||||
velocityTowardTarget = Vec3.dot(currentVelocity, Vec3.normalize(dPosition));
|
||||
velocityTowardTarget = Vec3.multiply(dPosition, velocityTowardTarget);
|
||||
velocityTowardTarget = Vec3.multiply(Vec3.normalize(dPosition), velocityTowardTarget);
|
||||
// compute the speed we would like to be going toward the target position
|
||||
|
||||
desiredVelocity = Vec3.multiply(dPosition, (1.0 / deltaTime) * SPRING_RATE);
|
||||
|
|
Loading…
Reference in a new issue