Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::math::Triangle Struct Reference

#include <Triangle.h>

Public Member Functions

void Set (gfx::Vertex3 *p1, gfx::Vertex3 *p2, gfx::Vertex3 *p3)
CollisionType IntersectRay (Ray *pRay)
 Checks if the ray and triangle intersects.
CollisionType IntersectRay (Ray *pRay, kge::math::Vector &Out)
 Checks if the ray and triangle intersects and store the intersection point in the Out parameter.

Public Attributes

gfx::Vertex3 Edge1
gfx::Vertex3 Edge2
gfx::Vertex3Point1
gfx::Vertex3Point2
gfx::Vertex3Point3
Vector Normal

Detailed Description

Definition at line 18 of file Triangle.h.

Member Function Documentation

CollisionType kge::math::Triangle::IntersectRay ( Ray pRay)
inline
CollisionType kge::math::Triangle::IntersectRay ( Ray pRay,
kge::math::Vector Out 
)
inline

Checks if the ray and triangle intersects and store the intersection point in the Out parameter.

Definition at line 65 of file Triangle.h.

References kge::math::Vector::Cross(), kge::math::Ray::Direction, kge::math::ECT_Intersect, kge::math::ECT_NotIntersect, Edge1, Edge2, kge::math::fEpsilon, Normal, kge::math::Ray::Position, and kge::gfx::Vertex3::ToVector().

void kge::math::Triangle::Set ( gfx::Vertex3 p1,
gfx::Vertex3 p2,
gfx::Vertex3 p3 
)
inline

Definition at line 27 of file Triangle.h.

References kge::math::Vector::Cross(), Edge1, Edge2, Normal, Point1, Point2, and Point3.

Member Data Documentation

gfx::Vertex3 kge::math::Triangle::Edge1

Definition at line 20 of file Triangle.h.

Referenced by IntersectRay(), and Set().

gfx::Vertex3 kge::math::Triangle::Edge2

Definition at line 20 of file Triangle.h.

Referenced by IntersectRay(), and Set().

Vector kge::math::Triangle::Normal

Definition at line 25 of file Triangle.h.

Referenced by IntersectRay(), and Set().

gfx::Vertex3* kge::math::Triangle::Point1

Definition at line 22 of file Triangle.h.

Referenced by Set().

gfx::Vertex3 * kge::math::Triangle::Point2

Definition at line 22 of file Triangle.h.

Referenced by Set().

gfx::Vertex3 * kge::math::Triangle::Point3

Definition at line 22 of file Triangle.h.

Referenced by Set().


The documentation for this struct was generated from the following file: