For the last week i was working on implementing collisions and psychics in my engine. I used for that excellent psychics library Bullet. First I generate colliders for level, with greedy algorithm that builds quads for collision: https://github.com/macbury/ForgE/blob/master/core/src/macbury/forge/graphics/builders/TerrainBuilder.java#L86

Finaly only thing left is to assemble quads into btConvexHullShape: https://github.com/macbury/ForgE/blob/master/core/src/macbury/forge/graphics/builders/ChunkPartCollider.java#L74

Final result:


Source code

  • Last update: ( about 3 years ago )
  • Size: 30.9 KB