mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Fix physics "grabbable" setting being applied without gravity
This commit is contained in:
parent
acf6a433a9
commit
ec6cae4105
1 changed files with 5 additions and 1 deletions
|
@ -1470,16 +1470,20 @@
|
|||
break;
|
||||
|
||||
case "setGravityOn":
|
||||
// Dynamic is true if the entity has gravity or is grabbable.
|
||||
if (parameter) {
|
||||
physicsToolPhysics.gravity = { x: 0, y: physicsToolGravity, z: 0 };
|
||||
physicsToolPhysics.dynamic = true;
|
||||
} else {
|
||||
physicsToolPhysics.gravity = Vec3.ZERO;
|
||||
physicsToolPhysics.dynamic = false;
|
||||
physicsToolPhysics.dynamic = physicsToolPhysics.userData.grabbableKey.grabbable === true;
|
||||
}
|
||||
break;
|
||||
case "setGrabOn":
|
||||
// Dynamic is true if the entity has gravity or is grabbable.
|
||||
physicsToolPhysics.userData.grabbableKey.grabbable = parameter;
|
||||
physicsToolPhysics.dynamic = parameter
|
||||
|| (physicsToolPhysics.gravity && Vec3.length(physicsToolPhysics.gravity) > 0);
|
||||
break;
|
||||
case "setCollideOn":
|
||||
if (parameter) {
|
||||
|
|
Loading…
Reference in a new issue