echo icon indicating copy to clipboard operation
echo copied to clipboard

[Question] Checking Colission

Open barisyild opened this issue 2 years ago • 4 comments

Is there a sync function to check the colission between 2 bodies?

barisyild avatar Mar 16 '22 01:03 barisyild

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);

AustinEast avatar Mar 19 '22 16:03 AustinEast

it doesn't return bool, I don't understand how exactly I can check it.

barisyild avatar Mar 23 '22 05:03 barisyild

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
})

yesitsfebreeze avatar Jun 21 '22 19:06 yesitsfebreeze

bodyA.collision(bodyB) == true

Is such a sync colission detection possible?

barisyild avatar Jun 24 '22 08:06 barisyild