mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
fix for coding standard
This commit is contained in:
parent
475dad6863
commit
7e7500eaad
1 changed files with 2 additions and 2 deletions
|
@ -137,7 +137,7 @@ function update(deltaTime) {
|
|||
var CLOSE_ENOUGH = 0.001;
|
||||
var FULL_STRENGTH = 0.025;
|
||||
var distanceToTarget = Vec3.length(dPosition);
|
||||
if (distanceToTarget/cameraEntityDistance > CLOSE_ENOUGH) {
|
||||
if (distanceToTarget / cameraEntityDistance > CLOSE_ENOUGH) {
|
||||
// compute current velocity in the direction we want to move
|
||||
var velocityTowardTarget = Vec3.dot(currentVelocity, Vec3.normalize(dPosition));
|
||||
// compute the speed we would like to be going toward the target position
|
||||
|
@ -147,7 +147,7 @@ function update(deltaTime) {
|
|||
// compute how much we want to add to the existing velocity
|
||||
var addedVelocity = Vec3.subtract(desiredVelocity, velocityTowardTarget);
|
||||
// If target is too far, roll off the force as inverse square of distance
|
||||
if (distanceToTarget/cameraEntityDistance > FULL_STRENGTH) {
|
||||
if (distanceToTarget / cameraEntityDistance > FULL_STRENGTH) {
|
||||
addedVelocity = Vec3.multiply(addedVelocity, Math.pow(FULL_STRENGTH / distanceToTarget, 2.0));
|
||||
}
|
||||
var newVelocity = Vec3.sum(currentVelocity, addedVelocity);
|
||||
|
|
Loading…
Reference in a new issue