mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 12:09:52 +02:00
Merge pull request #4809 from PhilipRosedale/master
don't apply changes to velocity unless needed
This commit is contained in:
commit
6008713a2a
1 changed files with 5 additions and 2 deletions
|
@ -193,12 +193,15 @@ function update(deltaTime) {
|
||||||
// Add Damping
|
// Add Damping
|
||||||
newVelocity = Vec3.subtract(newVelocity, Vec3.multiply(newVelocity, DAMPING_RATE));
|
newVelocity = Vec3.subtract(newVelocity, Vec3.multiply(newVelocity, DAMPING_RATE));
|
||||||
// Update entity
|
// Update entity
|
||||||
|
} else {
|
||||||
//add damping to angular velocity:
|
newVelocity = entityProps.velocity;
|
||||||
}
|
}
|
||||||
if (shouldRotate) {
|
if (shouldRotate) {
|
||||||
angularVelocity = Vec3.subtract(angularVelocity, Vec3.multiply(angularVelocity, ANGULAR_DAMPING_RATE));
|
angularVelocity = Vec3.subtract(angularVelocity, Vec3.multiply(angularVelocity, ANGULAR_DAMPING_RATE));
|
||||||
|
} else {
|
||||||
|
angularVelocity = entityProps.angularVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entities.editEntity(grabbedEntity, {
|
Entities.editEntity(grabbedEntity, {
|
||||||
velocity: newVelocity,
|
velocity: newVelocity,
|
||||||
angularVelocity: angularVelocity
|
angularVelocity: angularVelocity
|
||||||
|
|
Loading…
Reference in a new issue