echo
echo copied to clipboard
[Question] Checking Colission
Is there a sync function to check the colission between 2 bodies?
I think you may be looking for this?
https://austineast.dev/echo/api/echo/Echo.html#check
It can be used like so:
world.check(body_a, body_b, my_collision_options);
it doesn't return bool, I don't understand how exactly I can check it.
Adding to this issue, it would be great to have a more direct api for conditional collision checks. I know u have the conditional in the options, but a fluid interface makes the code a lot easier to maintain imho. And this would only require adding setters in the listener object.
ala:
var collided = world.check(bodyA, bodyB, options).when((A,B, Data) -> {
return true;
})
// or
world.listen(bodyA, bodyB, options).when((A,B, Data) -> {
return true;
}).onEnter((A,B, Data) -> {
// do things
})
bodyA.collision(bodyB) == true
Is such a sync colission detection possible?