#include <VertexNormal.h>
The class used to compute vertex normals considering smoothing.
Public Member Functions |
|
VertexNormal () | |
Default Constructor. |
|
VertexNormal (Point3 &n, DWORD s) | |
Constructor. |
|
VertexNormal (const VertexNormal ©VNormal) | |
Copy Constructor. |
|
VertexNormal & | operator= (const VertexNormal &from) |
Assignment operator. |
|
virtual | ~VertexNormal () |
Destructor. |
|
void | AddNormal (Point3 &n, DWORD s) |
Add a normal to the list if the smoothing
group bits overlap, otherwise create a new vertex normal in the
list. |
|
Point3 & | GetNormal (DWORD s) |
Retrieves a normal if the smoothing groups
overlap or there is only one in the list. |
|
void | Normalize () |
Normalize each normal in the list. |
|
Public Attributes |
|
Point3 | norm |
The normal. |
|
DWORD | smooth |
The smoothing groups. |
|
VertexNormal * | next |
A pointer to the next normal -- this class
is a linked list. |
|
BOOL | init |
The init variable is used as a flag to
indicate if the first normal in the list has been initialized.
|
VertexNormal | ( | ) |
Default Constructor.
VertexNormal | ( | Point3 & | n, |
DWORD | s | ||
) |
Constructor.
n | - The vertex normal vector |
s | - The ID of the smoothing group |
VertexNormal | ( | const VertexNormal & | copyVNormal | ) |
Copy Constructor.
virtual ~VertexNormal | ( | ) | [virtual] |
Destructor.
VertexNormal& operator= | ( | const VertexNormal & | from | ) |
Assignment operator.
void AddNormal | ( | Point3 & | n, |
DWORD | s | ||
) |
Add a normal to the list if the smoothing group bits overlap, otherwise create a new vertex normal in the list.
It is used when a face is going to add its normal to a vertex. This method is passed the normal and the smoothing information for that face. It checks if the normal passed shares smoothing information with the existing normal. If it does, the normal is added in, and the smoothing bits are bitwise OR-ed in. If it does not, a new vertex normal is created.
n | The new normal to be added. |
s | The smoothing group information. |
Point3& GetNormal | ( | DWORD | s | ) |
Retrieves a normal if the smoothing groups overlap or there is only one in the list.
s | The smoothing group information. |
void Normalize | ( | ) |
Normalize each normal in the list.
The normal.
DWORD smooth |
The smoothing groups.
A pointer to the next normal -- this class is a linked list.
BOOL init |
The init variable is used as a flag to indicate if the first normal in the list has been initialized.