I’ve spent quite some time searching a simple / fast c++ library (Win / Linux) that can answer the two questions ‘does this ray crosses any of the triangles?’ or ‘where is the first intersection, if there are any?’.
It’s for my little game I’m writing and will be used to see if a NPC can see a player and also to check if a player can fall all the way to the ground (or not).
The triangles will not move (well, if you can flag a triangle group ‘on’ / ‘off’ that would be nice).
I actually found some libraries but only non-continued (or it seems) like OZCollide for example.
Of course there are all those new shiny Physics engines out there but I don’t need 99% of what they offer.
A bonus would be if the library can load .3ds an .b3d files and even better if it can be used in a multi threaded environment (creating several instances of the search data).
Thanks all!
Well, there seems to be no ‘simple & small’ library / code out there so I guess the answer might be ‘roll your own’.
That is what I did anyway:
a tool that uses Irrlicht to load up my (static) geometry and then save off all (triangle/vertex) data to a file, just 9 floats for each triangle.
Then a collision library that loads up the data into an octree and the c2005 triangle / ray intersection test and it works OK.