A polygon structure.
More...
List of all members.
Public Member Functions |
| Polygon () |
| Default constructor.
|
unsigned int | getVertexCount () |
| Returns the number of vertices in the polygon.
|
Vertex * | getVertex (unsigned int index) |
| Returns the vertex at specified index.
|
Vertex * | addVertex (Number x, Number y, Number z) |
| Adds a new vertex with the specified position coordinates.
|
Vertex * | addVertex (Number x, Number y, Number z, Number u, Number v) |
| Adds a new vertex with the specified position coordinates and texture coordinates.
|
void | addVertex (Vertex *vertex) |
| Adds a new vertex.
|
void | removeVertex (int index) |
| Removes and deletes the vertex at specified index.
|
void | calculateNormal () |
| Calculates the average normal for the vertices.
|
void | calculateTangent () |
| Calculates the tangent space vector for the vertices.
|
Vector3 | getFaceNormal () |
| Returns the face normal.
|
Vector3 | getFaceTangent () |
| Returns the face tangent vector.
|
void | setNormal (Vector3 normal) |
| Sets the polygon normal.
|
void | flipUVY () |
| Flips the texture coordinate vertically.
|
Public Attributes |
bool | useVertexNormals |
| If true, will use vertex normals, if false will use the polygon normal.
|
Detailed Description
Member Function Documentation
Vertex * Polycode::Polygon::addVertex |
( |
Number |
x, |
|
|
Number |
y, |
|
|
Number |
z |
|
) |
| |
Adds a new vertex with the specified position coordinates.
- Parameters:
-
x | X coordinate of new vertex. |
y | Y coordinate of new vertex. |
z | Z coordinate of new vertex. |
- Returns:
- Newly added vertex.
Vertex * Polycode::Polygon::addVertex |
( |
Number |
x, |
|
|
Number |
y, |
|
|
Number |
z, |
|
|
Number |
u, |
|
|
Number |
v |
|
) |
| |
Adds a new vertex with the specified position coordinates and texture coordinates.
- Parameters:
-
x | X coordinate of new vertex. |
y | Y coordinate of new vertex. |
z | Z coordinate of new vertex. |
u | Horizontal texture coordinate. |
v | Vertical texture coordinate. |
- Returns:
- Newly added vertex.
void Polycode::Polygon::addVertex |
( |
Vertex * |
vertex | ) |
|
Adds a new vertex.
- Parameters:
-
Vector3 Polycode::Polygon::getFaceNormal |
( |
| ) |
|
Returns the face normal.
- Returns:
- Face normal.
Vector3 Polycode::Polygon::getFaceTangent |
( |
| ) |
|
Returns the face tangent vector.
- Returns:
- Face tangent vector.
Vertex * Polycode::Polygon::getVertex |
( |
unsigned int |
index | ) |
|
Returns the vertex at specified index.
- Returns:
- Vertex at specified index.
unsigned int Polycode::Polygon::getVertexCount |
( |
| ) |
|
Returns the number of vertices in the polygon.
- Returns:
- Number of vertices in the polygon.
void Polycode::Polygon::removeVertex |
( |
int |
index | ) |
|
Removes and deletes the vertex at specified index.
- Parameters:
-
index | to remove vertex at. |
void Polycode::Polygon::setNormal |
( |
Vector3 |
normal | ) |
|
Sets the polygon normal.
- Parameters:
-