Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

pge::triangle Namespace Reference


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)


Function Documentation

bool isPointInside const Vector3f &  point,
const Vector3f &  a,
const Vector3f &  b,
const Vector3f &  c
[static]
 

Definition at line 72 of file Triangle.h.

References sameSide().

00072                                                                                                                           {
00073                         if (sameSide(point, a, b, c) && sameSide(point, b, a, c) && sameSide(point, c, a, b)) {
00074                                 return true;
00075                         }
00076                         return false;
00077                 }

Here is the call graph for this function:

bool isPointInside const Vector3f &  point,
const Triangle &  triangle
[static]
 

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:

bool sameSide Vector3f  p0,
Vector3f  p1,
Vector3f  a,
Vector3f  b
[static]
 

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:


Generated on Mon Oct 16 12:10:02 2006 for Phobosengine by doxygen 1.3.4