mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
I was told there would be no math
This commit is contained in:
parent
b8565358ff
commit
40aecf3bf4
1 changed files with 2 additions and 5 deletions
|
@ -54,12 +54,9 @@ function setEnergy(energy) {
|
||||||
function avatarAccelerationEnergy() {
|
function avatarAccelerationEnergy() {
|
||||||
var AVATAR_MOVEMENT_ENERGY_CONSTANT = 0.001;
|
var AVATAR_MOVEMENT_ENERGY_CONSTANT = 0.001;
|
||||||
var velocity = MyAvatar.getVelocity();
|
var velocity = MyAvatar.getVelocity();
|
||||||
var dV = Vec3.subtract(velocity, lastAvatarVelocity);
|
var dV = Math.abs(Vec3.length(velocity) - Vec3.length(lastAvatarVelocity));
|
||||||
var dE = Vec3.length(lastAvatarVelocity) * Vec3.length(dV) * AVATAR_MOVEMENT_ENERGY_CONSTANT;
|
var dE = Vec3.length(lastAvatarVelocity) * dV * AVATAR_MOVEMENT_ENERGY_CONSTANT;
|
||||||
lastAvatarVelocity = velocity;
|
lastAvatarVelocity = velocity;
|
||||||
if (dE > 0.01) {
|
|
||||||
print("de " + dE);
|
|
||||||
}
|
|
||||||
return dE;
|
return dE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue