Open krokoschlange opened 1 year ago
It's worse than it seems. I get a lot of screwed up zero impulses that mess up my integrate_forces calculations.
@krokoschlange @darthLeviN Does this issue also apply to 2D?
@krokoschlange @darthLeviN Does this issue also apply to 2D?
I haven't tested it myself, but according to this comment and #81654, yes it does. Looking at the code, that is not surprising, it's basically the same.
@krokoschlange @darthLeviN Does this issue also apply to 2D?
Yes, I have seen it in 2D as well (today). But changing the: physics-tick-per-second from 60 to 240 max physics steps per second from 8 to 32 I was able to see some impulses values.
I am also experiencing this, where I get alternating frames of zero impulse, mainly from convex collision meshes.
Godot version
v4.0.rc2.official [d2699dc7a]
System information
EndeavourOS, Vulkan
Issue description
Calling the
get_contact_impulse()
method on the PhysicsDirectState3D object provided in the_integrate_forces()
method ofRigidBody3D
returnsVector3.ZERO
for contacts that were created in the current frame. I would expect this method to return the impulse applied to the rigidbody by the contact, even during the first frame. This becomes an issue particularly with bouncy objects as they often only have one frame of contact which results in no impulse being reported at all.I dug a bit in the physics code and it seems that the contacts of a rigidbody are not updated after
pre_solve
inGodotBodyPair3D
ran which seems suspicious.Steps to reproduce
contact_monitor
and setmax_contacts_reported
to a reasonable value_integrate_forces()
and callstate.get_contact_impulse()
, for example print all impulses for all contactsMinimal reproduction project
impulse_test.zip