I've been getting pretty frustrated with Opcode, but I think I'm close to getting what I need.
What I want to do is to load a walkmap .mesh into Ogre and perform ray collisions on it to determine if my character can walk to a certain place (and where to move him, ie up a ramp).
I basically copy-pasted the OgreOpcode code to load an Entity into Opcode, but now I don't understand how I can turn the results of a ray collision into an intersection point.
You should call RC.GetNbIntersections(); after your call to collider.Collide - and you should loop through CollisionFaces (through CF) to see the results.
You also need a function to extract the hit vertices from your mesh data from the returned index.
Take a closer look at OgreOpcode.
/* Less noise. More signal. */ Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion. OgreAddons - the Ogre code suppository.
Ok, well if I can find out the triangle then I can use ray-triangle collision to find the intersection point.
Looking at the SourceForge CVS, it seems that OgreOpcode just does a boolean test like "does A overlap B?" rather than "where does A intersect B?" So OgreOpcode doesn't seem to help with this question.
Looking through Opcode, a CollisionFaces object returns an array of CollisionFace objects. Each CollisionFace object then has a few details, one of them being faceID. Thanks to the kind folks at Opcode, there is absolutely no documentation on this. What do I do from here to return the 3 points of the stabbed triangle?
@sirSolarius:
There's two versions of OgreOpcode: one from ogreaddons CVS (which works with Opcode 1.3 using my patch) and the WIP from Berlios, which I posted a link to in the other opcode thread in general discussion.
If you are using the ogreaddons version, which you are, the code for getting the tricoords is available from the callback: