Crevaya 0.1-PreAlpha

Triangle Class Reference

Defines a simple triangle. More...

#include <Triangle.h>

Collaboration diagram for Triangle:

List of all members.

Public Member Functions

 Triangle ()
 Triangle (wxString string)
virtual ~Triangle ()
wxString ToString (void) const
void FromString (wxString const &string)
void Paint (bool useNormals=true, bool useColors=false) const
 Puts a triangle in the OpenGL queue.
void CalculateNormal ()
 Calculates normals for the corners of a triangle.
void ApplyTransformation (const AffineTransformMatrix &matrix)

Public Attributes

Vector3 p [3]
 Position of vertices.
Vector3 n [3]
 Normal vectors.
Vector3 c [3]
 Color vectors.

Detailed Description

Defines a simple triangle.

Holds the data for a simple triangle. Three vertices with three normal vectors.


Constructor & Destructor Documentation

Triangle::Triangle ( )
Triangle::Triangle ( wxString  string)
Triangle::~Triangle ( ) [virtual]

Member Function Documentation

void Triangle::ApplyTransformation ( const AffineTransformMatrix matrix)
void Triangle::CalculateNormal ( )

Calculates normals for the corners of a triangle.

If no normals can be provided from elsewhere, this function can generate a set. The normal vectors n[0] to n[2] are all set normal to the plane of the triangle. Orientation is right handed.

void Triangle::FromString ( wxString const &  string)
void Triangle::Paint ( bool  useNormals = true,
bool  useColors = false 
) const

Puts a triangle in the OpenGL queue.

This function does not call glBegin(GL_TRIANGLES); and glEnd();. This has to be done by the calling function. (Allows to save on OpenGL calls.)

wxString Triangle::ToString ( void  ) const

Member Data Documentation

Color vectors.

Normal vectors.

Position of vertices.


The documentation for this class was generated from the following files: