#include <CVertex.h>
Public Member Functions | |
cVertex (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0) | |
~cVertex () | |
void | setPos (const double &a_x, const double &a_y, const double &a_z) |
void | setPos (const cVector3d &a_pos) |
void | translate (const cVector3d &a_translation) |
cVector3d | getPos () const |
cVector3d | getGlobalPos () const |
void | setNormal (const cVector3d &a_normal) |
void | setNormal (const double &a_x, const double &a_y, const double &a_z) |
cVector3d | getNormal () const |
void | setTexCoord (const cVector3d &a_texCoord) |
Set texture coordinate. | |
void | setTexCoord (const double &a_tx, const double &a_ty) |
cVector3d | getTexCoord () const |
void | setColor (const cColorf &a_color) |
void | setColor (const float &a_red, const float &a_green, const float &a_blue, const float a_alpha=1.0) |
void | setColor (const cColorb &a_color) |
void | computeGlobalPosition (const cVector3d &a_globalPos, const cMatrix3d &a_globalRot) |
Public Attributes | |
cVector3d | m_localPos |
Local position of this vertex. | |
cVector3d | m_globalPos |
Global position of this vertex in world coordinates. | |
cVector3d | m_normal |
Surface normal. | |
cVector3d | m_texCoord |
Texture coordinate (uvw). | |
cColorf | m_color |
Color. | |
int | m_index |
My index in the vertex list of the mesh that owns me. | |
bool | m_allocated |
Is this vertex allocated? | |
int | m_nTriangles |
How many triangles use this vertex? | |
int | m_tag |
User data. |
cVertex::cVertex | ( | const double | a_x = 0.0 , |
|
const double | a_y = 0.0 , |
|||
const double | a_z = 0.0 | |||
) | [inline] |
cVertex::~cVertex | ( | ) | [inline] |
Destructor of cVertex.
void cVertex::computeGlobalPosition | ( | const cVector3d & | a_globalPos, | |
const cMatrix3d & | a_globalRot | |||
) | [inline] |
Compute the global position of vertex given the global position and global rotation matrix of the parent object.
a_globalPos | Global position vector of parent. | |
a_globalRot | Global rotation matrix of parent. |
cVector3d cVertex::getGlobalPos | ( | ) | const [inline] |
Read global position. This value is only correct if the computeGlobalPositions() method is called from the parent world.
cVector3d cVertex::getNormal | ( | ) | const [inline] |
Set normal vector of vertex.
cVector3d cVertex::getPos | ( | ) | const [inline] |
Read local position of vertex.
cVector3d cVertex::getTexCoord | ( | ) | const [inline] |
Read texture coordinate of vertex.
void cVertex::setColor | ( | const cColorb & | a_color | ) | [inline] |
Set color of vertex.
a_color | Color component to be set to vertex. |
void cVertex::setColor | ( | const float & | a_red, | |
const float & | a_green, | |||
const float & | a_blue, | |||
const float | a_alpha = 1.0 | |||
) | [inline] |
Set color of vertex.
a_red | Red component. | |
a_green | Green component. | |
a_blue | Blue component. | |
a_alpha | Alpha component. |
void cVertex::setColor | ( | const cColorf & | a_color | ) | [inline] |
Set color of vertex.
a_color | Color. |
void cVertex::setNormal | ( | const double & | a_x, | |
const double & | a_y, | |||
const double & | a_z | |||
) | [inline] |
Set normal vector of vertex by passing its X,Y and Z components as parameters.
a_x | X component. | |
a_y | Y component. | |
a_z | Z component. |
void cVertex::setNormal | ( | const cVector3d & | a_normal | ) | [inline] |
Set normal vector of vertex.
a_normal | Normal vector. |
void cVertex::setPos | ( | const cVector3d & | a_pos | ) | [inline] |
Set local position of vertex.
a_pos | Local position of vertex. |
void cVertex::setPos | ( | const double & | a_x, | |
const double & | a_y, | |||
const double & | a_z | |||
) | [inline] |
Set the position coordinates of vertex.
a_x | X component. | |
a_y | Y component. | |
a_z | Z component. |
void cVertex::setTexCoord | ( | const double & | a_tx, | |
const double & | a_ty | |||
) | [inline] |
Set texture coordinate by passing its coordinates as parameters.
a_tx | X component. | |
a_ty | Y component. |
void cVertex::setTexCoord | ( | const cVector3d & | a_texCoord | ) | [inline] |
Set texture coordinate.
Set texture coordinate of vertex.
a_texCoord | Texture coordinate. |
void cVertex::translate | ( | const cVector3d & | a_translation | ) | [inline] |
Translate vertex by defining a translation passed as parameter.
a_translation | Translation vector. |