Functions | |
bool | sameSide (Vector3f p0, Vector3f p1, Vector3f a, Vector3f b) |
bool | isPointInside (const Vector3f &point, const Triangle &triangle) |
bool | isPointInside (const Vector3f &point, const Vector3f &a, const Vector3f &b, const Vector3f &c) |
|
Definition at line 72 of file Triangle.h. References sameSide().
|
Here is the call graph for this function:
|
Definition at line 59 of file Triangle.h. References pge::Triangle::m_vertices, and sameSide().
00059 { 00060 if(sameSide(point, triangle.m_vertices[0], triangle.m_vertices[1], triangle.m_vertices[2]) 00061 && sameSide(point, triangle.m_vertices[1], triangle.m_vertices[0], triangle.m_vertices[2]) 00062 && sameSide(point, triangle.m_vertices[2], triangle.m_vertices[0], triangle.m_vertices[1])) { 00063 return true; 00064 } 00065 return false; 00066 } |
Here is the call graph for this function:
|
Definition at line 43 of file Triangle.h. References pge::Vector3f::crossProduct(), pge::Vector3f::dotProduct(), and pge::Vector3f::subtract(). Referenced by isPointInside().
00043 { 00044 Vector3f cp0; 00045 Vector3f cp1; 00046 00047 cp0 = (b.subtract(a)).crossProduct(p0.subtract(a)); 00048 cp1 = (b.subtract(a)).crossProduct(p1.subtract(a)); 00049 00050 if (cp0.dotProduct(cp1) >= 0.0f) { 00051 return true; 00052 } 00053 return false; 00054 } |
Here is the call graph for this function: