Sorry for the late reply. I can give some help if I find time.Tell me what exactly you mean "That page didn't give me any good results and it never worked."? What is the point that stops working correctly?Also, how is a triangle defined in your code - to allow me write some compatible code? Like, ((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) (ie. is there a 'point' class? or maybe a 'triangle' class too?) Or raw data, like, (x1,y1,z1,x2,y2,z2,x3,y3,z3)?

EDIT: Oh also, how is the ray line defined? Point-and-direction or two-points-on-line? (Is there a 'ray' class or 'line' class? Show me.)

Triangles and their vertices are always defined the same way (if being traditional geometry), just by 3 points with a position for each dimensions, which in this case is three (3D). No matter if the vertecies are in a class, namespace, or structure of some sort, you can always get the floating point values form these vertices.However the ray is a little different because you can define it by a point and direction, or by two points. In my case its by two points.

Now I've searched many many sites, and went though about 40 (search)pages on google. I've got line-plane intersections to work. But that's only good if the plane is an infinite plane, so I need to detect whether the point is inside the triangle or not.Also the method I'm using is probably not the fastest (A LOT of conversion and abstract math, it could be simplified).I'm trying to look through the glm source code for some answers.

Yea in my code I have setup the functions for plane intersection to return true if intersected and I use pointers to cast the collision point to the variable I wan't to store it in.

But anyways thanks I'll try in my code when I have time tonight.Though I must ask what is with the Boolean variable rti? It's defined just to define floating point values. Why not just define the floating point values?

EDIT: I lied, I spent an hour and a half playing lone survivor, but I'm working on the code now so it counts I guess

Though I must ask what is with the Boolean variable rti? It's defined just to define floating point values. Why not just define the floating point values?

DUH!! It's not a variable! rti() is the complete function ready - made. You don't have to edit it! rti() returns if the point is inside the triangle. I've already made it! see below for an example.

Example of use.suppose we have, a triangle with points (1,2,3), (2,3,4), (3,4,5).and a ray line from points (3,2,1), (2,0,1).

Rename rti.cpp to rti.h (should have done this myself - sorry)

And in your main program:#include "rti.h"...float xi, yi, zi;...inTri = rti(1,2,3,2,3,4,3,4,5,3,2,1,2,0,1,&xi,&yi,&zi);if (inTri == true){ // The point is in the triangle. // The point is (xi,yi,zi) - do something with it!}else{ // The point is not in the triangle.}

EDIT: Uhh it seems it needs just a tad of debugging, I'm sorry cooldude234!!

Yea, it would really help if I understood the math to this whole thing. I can't tell if it's something wrong with my code, the code I based my code off of, or thanos's code or if the universe just like messing with me :S