Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Checking Colission #31

Open
barisyild opened this issue Mar 16, 2022 · 4 comments
Open

[Question] Checking Colission #31

barisyild opened this issue Mar 16, 2022 · 4 comments

Comments

@barisyild
Copy link

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

@AustinEast
Copy link
Owner

AustinEast commented Mar 19, 2022

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

@barisyild
Copy link
Author

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

@yesitsfebreeze
Copy link

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

@barisyild
Copy link
Author

bodyA.collision(bodyB) == true

Is such a sync colission detection possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants