Collision detection and response

BlitzMax Forums/BlitzMax Programming/Collision detection and response

UnderwoodNullium(Posted 2008) [#1]
Hello Forum!

$100.00 or £67.87 for working code!

I've been working on a physics engine for a long time now, and I've been banging my head around forever trying to get this to work. I am using Verlet integration, and it's working great. The collision detection I've been using has been crude to say the least... and is incorrect.

I know there are ways to use vectors to check for intersections, I just can't wrap my brain around it. I've read many, if not all, online pages I could find.

Basically, is there any way that you have found to see if a moving point and a moving line segment (made from two moving points) have collided? If there's anyway to get the correct response velocities for said point and segment points, I would be very grateful.

I know that asking other people to give you code is very non-programmer-like, but I can't do it. I could understand it if I had it in front of me!

I will pay $100.00 or £67.87 to anyone who can get my existing engine to have collision detection and response. I know this is horrible of me and I should be shunned, but I don't care anymore. I'm desperate.

I just thought of a method of making things simple and work very well, but I'm not sure if it will work:



Anyways, here is the code:

Engine Code:



...and the 'example' code needed to run the engine:




Regular K(Posted 2008) [#2]


Well I got a start on some simple collision detection. Doesn't really work, but eh. It's a start.


UnderwoodNullium(Posted 2008) [#3]
Thanks for the code Regular K. I've tried that method before, and even tested the LinesCross() for future and past points, but it wouldn't work when I was trying to have just a single point and 'link'... I might try to re-implement the LinesCross() function again.

Here's my original collision detection and 'response', which tested if a point's orientation to each line segment changed since the last frame, and attempts to update it if true... :P



Thanks again Mr. K...