CVertex Class Reference
Inheritance diagram for CVertex:
[legend]Collaboration diagram for CVertex:
[legend]List of all members.
Detailed Description
The vertex type is used to represent vertices for 3D models which can be rendered by eg. OpenGL. The CVertex class is not derivaed from
CVector because the operator[] is hard to access when dealing with pointers to CVertex structures. Eg: (*vertex)[0] = 0.0 is IMHO less appealing than vertex->p[0] = 0.0.
Definition at line 34 of file CVertex.h.
|
Public Member Functions |
void | setColour (float r, float g, float b, float a=1.0) |
void | setTexCoord (float u, float v, float w=0.0) |
void | setTexCoord (int texture, float u, float v, float w=0.0) |
CVertex | interpolateLinear (CVertex &vertex1, CVertex &vertex2, float t) |
CVertex & | operator= (CVertex vertex) |
CVertex | operator * (float scale) |
CVertex | operator+ (CVertex vertex) |
Public Attributes |
CVector | p |
| XYZ position.
|
float | c [4] |
| RGBA colour. Range [0.0, 1.0].
|
float | t [VERTEX_TEX_COUNT][VERTEX_TEX_COMPONENTS] |
| UVST texture coordinates. Range [0.0, 1.0].
|
Member Function Documentation
void CVertex::setColour |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1.0 |
|
) |
|
|
|
Sets four colour components. Alpha is defined as 1.0 by default. |
void CVertex::setTexCoord |
( |
float |
u, |
|
|
float |
v, |
|
|
float |
w = 0.0 |
|
) |
|
|
|
Sets texture coordinates for texture 0. Third texture coordinate defaults to 0.0. |
void CVertex::setTexCoord |
( |
int |
texture, |
|
|
float |
u, |
|
|
float |
v, |
|
|
float |
w = 0.0 |
|
) |
|
|
|
Sets texture coordinates for texture texture. - Parameters:
-
| texture | Index of texture coordinates to set. Range [0..VERTEX_TEX_COUNT-1]. |
- See also:
- set_texture()
|
CVertex CVertex::operator * |
( |
float |
scale |
) |
|
|
|
Scales all components of vertex. - Parameters:
-
| scale | Scaling factor to multiply all components with. |
- Returns:
- Vertex with value of all components of vertex scaled by scale
|
|
Adds all components of vertex. - Parameters:
-
| vertex | Vertex to add to vertex object |
- Returns:
- Vertex with value of all components of vertices summed.
|
The documentation for this class was generated from the following file:
Generated on Tue Feb 8 21:59:44 2005 for MarSTDv2004 by
1.4.1