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

Collision point #5

Closed
whaqzhzd opened this issue Apr 20, 2018 · 2 comments
Closed

Collision point #5

whaqzhzd opened this issue Apr 20, 2018 · 2 comments

Comments

@whaqzhzd
Copy link

After the two HitBox collisions, I need to get the collision point. What should I do?

@SergiusIW
Copy link
Owner

I haven't made a collision point method. For my use cases so far, the PlacedShape::normal_from method has been enough. Though it would be easy enough to add a method like this. Here's what the function signature might look like:

impl PlacedShape {
  /// Returns the contact point of two shapes,
  /// or the nearest point if they are not overlapping
  fn contact_point(&self, other: &PlacedShape) -> Vec2 {...}
}

Let me know if this satisfies your use case. If so, I will add this method.

@whaqzhzd
Copy link
Author

Returns the contact point of two shapes,or the nearest point if they are not overlapping。
Thank you very much. This is exactly what I need.

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

2 participants