mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-06 15:20:27 +02:00
Prevent entities from jittering or drifting when grab a moving set
This commit is contained in:
parent
6c35a008f1
commit
808f37a824
1 changed files with 9 additions and 3 deletions
|
@ -219,12 +219,18 @@ Selection = function (side) {
|
||||||
i;
|
i;
|
||||||
|
|
||||||
// Disable entity set's physics.
|
// Disable entity set's physics.
|
||||||
for (i = 0, count = selection.length; i < count; i += 1) {
|
//for (i = 0, count = selection.length; i < count; i += 1) {
|
||||||
|
for (i = selection.length - 1; i >= 0; i -= 1) {
|
||||||
Entities.editEntity(selection[i].id, {
|
Entities.editEntity(selection[i].id, {
|
||||||
dynamic: false, // So that gravity doesn't fight with us trying to hold the entity in place.
|
dynamic: false, // So that gravity doesn't fight with us trying to hold the entity in place.
|
||||||
collisionless: true // So that entity doesn't bump us about as we resize the entity.
|
collisionless: true, // So that entity doesn't bump us about as we resize the entity.
|
||||||
|
velocity: Vec3.ZERO, // So that entity doesn't drift if we've grabbed a set while it was moving.
|
||||||
|
angularVelocity: Vec3.ZERO // ""
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop moving.
|
||||||
|
Entities.editEntity(rootEntityID, { velocity: Vec3.ZERO, angularVelocity: Vec3.ZERO });
|
||||||
}
|
}
|
||||||
|
|
||||||
function finishEditing() {
|
function finishEditing() {
|
||||||
|
|
Loading…
Reference in a new issue