rapier
rapier copied to clipboard
Stand-alone QueryPipeline doesn't account for changes to bodies
When using a QueryPipeline
without any physics, e.g. for querying against world whose state is only updated with calls to RigidBody::set_position
, the set_position
calls are not accounted for. It looks like this is due to RigidBodySet::handle_user_changes
and ColliderSet::handle_user_changes
, and perhaps other similar functionality, never getting invoked. Normally these are invoked by PhysicsPipeline::step
, but this is painful to invoke when no physics is desired. Unfortunately the critical calls are private to the crate, which leaves the user with little choice.
Hi! Ultimately, I think that I would like the QueryPipeline
to be moved to parry
, and therefore to completely ignore the existence of rigid-bodies. You can update the collider’s position based on their parent rigid-body manually before updating the query pipeline. Maybe we could expose a method from RigidBodySet
that would take care of that update for all the modified colliders for you.
Working directly in terms of colliders is an easy workaround then, thanks! This isn't a pressing issue for me yet, but is there a plan to support the swept query modes in that case, since those currently depend on information in the rigid body?
is there a plan to support the swept query modes in that case, since those currently depend on information in the rigid body?
Yeah, that will have to be supported. That’s one of the things I need to figure out before moving the QueryPipeline
over to parry
.
For other folks running into this, this feature was implemented as RigidBodySet::propagate_modified_body_positions_to_colliders
.
Yep, this is biting me right now in RapierJS. Adding colliders to the world requires step()
to be called, otherwise they don't show up in intersection queries.
Can anyone see a workaround?
Edit: With help from Discord server just found out that world.queryPipeline.update(world.islands, world.bodies, world.colliders)
resolves my issue. Newly created colliders get picked up by queries