mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-12 17:14:47 +02:00
don't apply changes to velocity unless needed
This commit is contained in:
parent
de6a63c69a
commit
d40e4b7218
1 changed files with 5 additions and 2 deletions
|
@ -193,12 +193,15 @@ function update(deltaTime) {
|
|||
// Add Damping
|
||||
newVelocity = Vec3.subtract(newVelocity, Vec3.multiply(newVelocity, DAMPING_RATE));
|
||||
// Update entity
|
||||
|
||||
//add damping to angular velocity:
|
||||
} else {
|
||||
newVelocity = entityProps.velocity;
|
||||
}
|
||||
if (shouldRotate) {
|
||||
angularVelocity = Vec3.subtract(angularVelocity, Vec3.multiply(angularVelocity, ANGULAR_DAMPING_RATE));
|
||||
} else {
|
||||
angularVelocity = entityProps.angularVelocity;
|
||||
}
|
||||
|
||||
Entities.editEntity(grabbedEntity, {
|
||||
velocity: newVelocity,
|
||||
angularVelocity: angularVelocity
|
||||
|
|
Loading…
Reference in a new issue