chandlerprall/Physijs

How to move blocks out of blocks faster

mrmola opened this issue · 1 comments

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?

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.