Hi Coders,
Just posted an example on UnderwareDesigncom that allows you to perform 2D sliding collision on a circle against static Convex or Concave shapes. Shapes can also be intersecting. Sliding collision seems to be something of a holly grail in the DB forums, while it's not the most straight foreward thing to understand the concept behind is really very simple.
This code contains two main parts. There's a small set of functions to define your 2D wall lines. These Wall lines are single sided, meaning collision is only available on one side. So all shapes you want run collision against, will need to be enclosed shapes.
To use the RUN_COLLISION function. You pass it the current position of an object and the position the object wishes too move to. After the Run_Collision function has completed it's work, you then position this object at the location returned by the function..
I'll write a 3D one later (sphere to polygon). When I need it.. Soonish
Download (collision & Intersections section)
=============================================
https://www.underwaredesign.com/?page=programs.Dark-Basic-Source-Codes