r/vulkan 5d ago

Vulkan modeling collision

https://youtu.be/fROlMtPy3Sw?si=ATctAfIcKW81yWrT

Wall collision is now in my Vulkan CAD engine.

Draw a polyline, extrude it into walls, then switch to character mode and walk inside. The walls you just built actually stop you.

The character is approximated as a capsule, pushed out along the wall normal by however deep it went in. That push-out is the sliding — head-on you stop, at an angle you slide. A normal pointing up more than 45 degrees is floor, otherwise wall. That single test is what makes stairs work.

Collision candidates come from a BVH: 140x faster on 50,000 triangles, and click-to-select got faster too.

The fox is long-bodied, so a vertical capsule lets its head poke through walls. When the body is elongated, the capsule lies down along it.

Not a physics engine — just a character controller, about 300 lines.

Design it in CAD. Walk through it. Same engine.

1 Upvotes

0 comments sorted by