polygon to polygon collision

Blitz3D Forums/Blitz3D Programming/polygon to polygon collision

Chroma(Posted 2007) [#1]
I'm trying to get some proper physics responses using blitz collision but since we only have spherical collision...

Am I missing something or do I have to write my own collision routine to handle polygon->polygon collision?


puki(Posted 2007) [#2]
Do your own - take a look at Coldet though: http://www.freewebs.com/elias_t/coldetwrapper.htm

I've not used it.


Chroma(Posted 2007) [#3]
Thanks a bunch puki. That collision lib is exactly what I was looking for. Much gratitude to elias also. It's a wonder no one has used this to make a blitz physics system that rivals newton or tokamak.


caff_(Posted 2007) [#4]
As fast as coldet is, I had problems with inaccurate collision normals with large scales - however I didn't establish if it was the wrapper or coldet itself. Just so you're warned... However if you're not interested in collision normals you should be ok.


Chroma(Posted 2007) [#5]
Bah, I need the collision normals. =(

The colliding_nx1() etc I'm reading back isn't the collision normals. So I guess I'm still serach for polygon collision.


Chroma(Posted 2007) [#6]
Actually, it looks like you can get the collision normals in coldet. I'm just messing about with it until I figure it out.


caff_(Posted 2007) [#7]
Oh yes, you can. I'm just saying I'm not sure I'd trust them 100% of the time...


Chroma(Posted 2007) [#8]
Yep, I saw your other post about coldet and getting the collision normals. I was getting them before but wasn't sure because of them being 4 also. But I normalized em too. I'm trying to use coldet to get the basic cube dropping to the ground and bouncing around.


Buggy(Posted 2007) [#9]
I think there's actually a polygon-to-polygon collision command.

MeshesIntersect?


Chroma(Posted 2007) [#10]
Your are right sir! I'm wondering how slow it is though. Has anyone done any speed tests on it and I wonder if it returns collision normals. Will test when I get home.


puki(Posted 2007) [#11]
It is a slow routine - period. Not for large scale use.


GfK(Posted 2007) [#12]
I wouldn't use MeshesIntersect.

Whether its slow or not, there lies the potential for objects to pass through each other undetected in cases where they're moving faster than a certain speed (related to the size of the objects in question).


jfk EO-11110(Posted 2007) [#13]
This, or if object a is completely encapsuled inside object b.

As far as I know meshesintersect will also not return Normals.

If you really are after "proper physics responses" then you maybe better use one of the physics libraries, eg. ODE.

One solution would be to position a pivot on every vertex of object A, then simply use sphere against polygon with every pivot. If there are too many pivots in the scene then you may have to use a pivot contingent, eg. 3000 pivots or so for the whole world, that are placed dynamicly, using vertex coorinates with tformpoint - which is probably slow too.