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

How to move blocks out of blocks faster #317

Open
mrmola opened this issue Jul 23, 2019 · 1 comment
Open

How to move blocks out of blocks faster #317

mrmola opened this issue Jul 23, 2019 · 1 comment

Comments

@mrmola
Copy link

mrmola commented Jul 23, 2019

I have made a thing where you can control a block that moves around on a voxel terrain, but when the block goes fast enough it will go into other blocks. When it is partially overlapping another block, it will not be able to be controlled. While I understand why the blocks are going into each other, I don't know how to fix it. How do I either prevent fast moving blocks from moving inside each other, or make them move out of each other faster?

@zircher
Copy link

zircher commented Jul 23, 2019

There are several ways you can tackle that problem.

  1. Check each frame for fast movers and cap their speed.
  2. When fast movers are detected, Have the program look ahead for collisions before they happen and slam on the brakes.
  3. When blocks are overlapping by a given threshold, perform an 'eject' routine that searches for the nearest open space and translates the block (and probably reduces or eliminates the vectors.)
    Of course, none of these are features of the library and you would have to write these functions for yourself as part of the game loop.

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