Crevaya 0.1-PreAlpha
|
Defines a simple triangle. More...
#include <Triangle.h>
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. |
Defines a simple triangle.
Holds the data for a simple triangle. Three vertices with three normal vectors.
Triangle::Triangle | ( | ) |
Triangle::Triangle | ( | wxString | string | ) |
Triangle::~Triangle | ( | ) | [virtual] |
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 |
Color vectors.
Normal vectors.
Position of vertices.