Implementing proper collision detection in a BSP
Posted 19 January 2007 - 01:30 AM
I've already read this:
and pretty much all articles in here.
i already can create a BSP tree out of a legal object without much issues, and doing the simple "point inside/outside bsp" test works fine.
However, i want to check when a point is about to enter a BSP and stop it just before it is inside. This is proving to be very difficult so far... i have:
-attempted next position
i create a ray (segment) with this, and find an intersection against the BSP,
Once I get the intersection, I dont really know what to do,
-if i place the object in the collision, it ends up inside the BSP (in the plane)
-if i try to make the object go back a bit, it can either still be inside the BSP (due to epsilon-test value for inside a plane and the angle against that same colliding plane) or it can go back too much (if the value is too big) and visually bounce. Trying to find an intermediate "go back amount" seems to hackish..
Keep in mind I'm doing this as a hobby project for the nintendo DS, so I really can't use anything that is too CPU intensive.
Cheers, and thanks a lot!
Posted 19 January 2007 - 02:27 AM
Posted 19 January 2007 - 04:14 AM
I thought about this, but then I realized it can be very difficult in a situation like this object (moving in arrow direction, and arrow is outside the BSP and about to crash witht he upper wall)
If i slide along the collision plane, it will push me against another wall (the bottom wall in this case), that is no good.. I'd have to do the check again against that other wall, which may also push me back against the other wall.... is there any simple way to fix this?
Posted 19 January 2007 - 04:15 AM
Sorry, forgot that html strips spaces.. I guess to simplify, something like this:
Posted 19 January 2007 - 05:16 AM
Posted 19 January 2007 - 05:47 AM
Hmm this kind of sucks, performance-wise , although i really see for now no other way to do it... as said, my priority is that it runs on a DS..
maybe i can just "sum" the pushback-vectors or something, so it's enough with one iteration.. ?
My other alternative, as I saw in a few papers, was binary-like search for the no-collision moment.. but this is also a CPU hog :\
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users