06-05-2024, 06:01 PM
(This post was last modified: 06-05-2024, 06:08 PM by josemendez.)
(06-05-2024, 05:38 PM)spikebor Wrote: Thanks, that cleared up my confusion.Hi!
I understand now, so the system can only output contacts in its solver (which has any type of ObiActor). In case of the Cube which is just an Obi Collider it can't know the attacker who added force on it, since it cannot query any contacts in its solver.
Is there any workaround for this?
No, that’s not how it works either: the system can output contacts in *any* object, you just need to subscribe that object to the solver’s OnCollision event.
The callback you get for that event contains a list of
*all* contacts between the particles in that solver and *all* ObiColliders in the scene. Each contact contains a reference to a collider and a reference to a particle in the solver. So for each contact you can know the particle that collided, the actor it belongs to, and which collider it collided against.
There’s no need for a collider to be inside a solver or have a reference to a solver for contacts to work: *all* ObiColliders in the scene are considered by all solvers.
See the manual for sample code snippets for all of the above, let me know if you need further help.
Kind regards,