Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Bounding Box Bouncing

Bounding Box Bouncing

benryves
benryves
Any Colour You Like · · 1 min read
3,121 2
I've updated the collision detection between points and the world with Scet's idea of only testing with the faces in the leaf containing the start position of the point.



ZiggyWare's Simple Vector Rendering GameComponent is being very useful for testing the collision routines. [smile]

I have also extended the collision routines to bounding boxes. This fixes a few issues where a point could drop through a crack in the floor between two faces.



My technique is to test the collision between the eight corners of the box and then to pick the shortest collision and use that as the resultant position. This results in a bounding box that is not solid; you can impale it on a spike, for example.



In the above screenshot, the cube comes to rest with the corners all lined up on cracks, which means that it slips through as its base isn't solid.



Happily, object collisions are simple bounding-box affairs, the bounding boxes set with QuakeC code, which should simplify things somewhat.

Discussion

Loading comments...