This reference page is linked to from the following overview topics: Computing Vertex Normals.
The 'rendered' normal class. RNormals are stored as unit vectors in object space. An instance of this class is maintained by the RVertex class since the RVertex is what gets rendered (lit), and the lighting methods need to know about the normals. All methods of this class are implemented by the system. Note:This class is used internally by 3ds Max. Developers who need to compute face and vertex normals for a mesh should instead refer to the Advanced Topics section "Computing Face and Vertex Normals".
#include <mesh.h>
Public Member Functions |
|
RNormal () | |
Constructor. |
|
void | setNormal (const Point3 &nor) |
Sets the normal to the specified value.
|
|
void | addNormal (const Point3 &nor) |
Adds the specified value to the value of the
normal. |
|
void | normalize (void) |
Converts the normal to a unit vector.
|
|
Point3 & | getNormal (void) |
Returns the normal. |
|
const Point3 & | getNormal () const |
void | setSmGroup (DWORD g) |
Sets the smoothing group to the specified
value. |
|
void | addSmGroup (DWORD g) |
ORs the specified smoothing group value to
the existing value. |
|
DWORD | getSmGroup (void) |
Returns the smoothing group value. |
|
void | setMtlIndex (MtlID i) |
Sets the material index to the specified
value. |
|
MtlID | getMtlIndex (void) |
Returns the material index. |
|
void | setRGB (Point3 &clr) |
Sets the RGB value. |
|
Point3 & | getRGB (void) |
Returns the RGB value. |
|
const Point3 & | getRGB () const |
RNormal | ( | ) | [inline] |
Constructor.
The smoothing group and material index are set to zero.
{ smGroup = mtlIndex = 0; }
void setNormal | ( | const Point3 & | nor | ) | [inline] |
Sets the normal to the specified value.
nor | The normal value to set. |
{ normal = nor; }
void addNormal | ( | const Point3 & | nor | ) | [inline] |
Adds the specified value to the value of the normal.
nor | The normal value to add to the existing value. |
{ normal += nor; }
void normalize | ( | void | ) | [inline] |
Point3& getNormal | ( | void | ) | [inline] |
const Point3& getNormal | ( | void | ) | const [inline] |
{ return normal; }
void setSmGroup | ( | DWORD | g | ) | [inline] |
Sets the smoothing group to the specified value.
g | The smoothing group value to set. |
{ smGroup = g; }
void addSmGroup | ( | DWORD | g | ) | [inline] |
ORs the specified smoothing group value to the existing value.
g | The smoothing group bits to set. |
{ smGroup |= g; }
DWORD getSmGroup | ( | void | ) | [inline] |
void setMtlIndex | ( | MtlID | i | ) | [inline] |
Sets the material index to the specified value.
i | The material index value to set. |
{ mtlIndex = i; }
MtlID getMtlIndex | ( | void | ) | [inline] |
void setRGB | ( | Point3 & | clr | ) | [inline] |
Sets the RGB value.
clr | The RGB color to set. |
{ rgb = clr; };
Point3& getRGB | ( | void | ) | [inline] |
const Point3& getRGB | ( | ) | const [inline] |
{ return rgb; }