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 Detection Needs Work #2

Open
BKaperick opened this issue Dec 28, 2017 · 1 comment
Open

Collision Detection Needs Work #2

BKaperick opened this issue Dec 28, 2017 · 1 comment

Comments

@BKaperick
Copy link
Owner

There are a few issues with how collisions are currently handled:

  • We oversample currently to reduce the maximum magnitude of overlap in any collisions occuring on the most recent time step, so we need to add in one additional step of self.time_disc - dt before update() is done so that each frame represents a consistent unit of time.
  • Magnitude is not being reduced
@BKaperick
Copy link
Owner Author

This is currently no longer an issue. The biggest collision issue that occurs now is objects passing through each other when they move past each other in between the current time discretization.

One solution for this would be to:

  1. Run the full simulation to predefined length at predefined time step.
  2. Keep track of the fastest moving object (MAX_SPEED) and the smallest width object (SHORTEST_WIDTH).
  3. Re run simulation with a time discretization small enough to ensure an object attaining this MAX_SPEED will travel at most SHORTEST_WIDTH.
    (i.e. DT = SHORTEST_WIDTH / MAX_SPEED)

I suspect this would be a very safe choice of time step since an object is likely to attain its max speed after failing a collision check (e.g. object escapes the frame and accelerates freely until the simulation finishes)

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

1 participant