You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS/device including version:
GPU: AMD RX 580 driver - 20.4.2
OS: Windows 10 10.0.18363
Issue description:
This issue is physics related. In theory, adding a force equal to the weight of an object in the opposite direction of gravity should counteract the force of gravity, making it suspend in mid air.
However, in practice the objects gains a small but very noticeable upward velocity of 0.1633...
When this is done with using the state.get_total_gravity() to get the force to counteract gravity, everything works fine.
After printing both values (weight and total gravity's Y) their value is 9.8 and -9.8 respectively (for an object with mass 1)
The absolute values of these two variables are practically the same but they yield a different result.
Steps to reproduce:
Create an object with a RigidBody call add_central_force() with it's weight as the Y value.
Notice how the objects gains a velocity of 0.1633...
Then do the same with but inside the _integrate_forces() call, using the negative of the get_total_gravity() as the counter force.
Notice how the object is stationary (as expected).
Actually, the problem is that in the first physics frame there is no gravity, state.get_total_gravity() returns Vector3(0, 0, 0); therefore applying a force of add_central_force(Vector3(0, weight, 0)) accelerates the body upwards for that one frame resulting in as subsequent constanct velocity of 0.163333.
madmiraal
changed the title
Discrepancy between gravitational acceleration and weight
Bullet physics PhysicsDirectBodyState.get_total_gravity() returns Vector3(0, 0, 0) in the first physics frame.
Jul 12, 2020
Can confirm. After waiting for 1 frame before applying the force using weight, the object behaves as expected.
pouleyKetchoupp
changed the title
Bullet physics PhysicsDirectBodyState.get_total_gravity() returns Vector3(0, 0, 0) in the first physics frame.
[Bullet] Bullet physics PhysicsDirectBodyState.get_total_gravity() returns Vector3(0, 0, 0) in the first physics frame.
Jan 15, 2021
Godot version:
Version 3.2.2 stable
OS/device including version:
GPU: AMD RX 580 driver - 20.4.2
OS: Windows 10 10.0.18363
Issue description:
This issue is physics related. In theory, adding a force equal to the weight of an object in the opposite direction of gravity should counteract the force of gravity, making it suspend in mid air.
However, in practice the objects gains a small but very noticeable upward velocity of 0.1633...
When this is done with using the
state.get_total_gravity()
to get the force to counteract gravity, everything works fine.After printing both values (weight and total gravity's Y) their value is 9.8 and -9.8 respectively (for an object with mass 1)
The absolute values of these two variables are practically the same but they yield a different result.
Steps to reproduce:
Create an object with a RigidBody call
add_central_force()
with it's weight as the Y value.Notice how the objects gains a velocity of 0.1633...
Then do the same with but inside the
_integrate_forces()
call, using the negative of theget_total_gravity()
as the counter force.Notice how the object is stationary (as expected).
Minimal reproduction project:
PhysicsExample.zip
The text was updated successfully, but these errors were encountered: