Public Member Functions

RNormal Class Reference

This reference page is linked to from the following overview topics: Computing Vertex Normals.


Search for all occurrences

Detailed Description

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".

See also:
Class Mesh, Class RVertex, Class GraphicsWindow.

#include <mesh.h>

Inheritance diagram for RNormal:
Inheritance graph
[legend]

List of all members.

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

Constructor & Destructor Documentation

RNormal ( ) [inline]

Constructor.

The smoothing group and material index are set to zero.

{ smGroup = mtlIndex = 0; }

Member Function Documentation

void setNormal ( const Point3 nor ) [inline]

Sets the normal to the specified value.

Parameters:
nor The normal value to set.
{ normal = nor; }
void addNormal ( const Point3 nor ) [inline]

Adds the specified value to the value of the normal.

Parameters:
nor The normal value to add to the existing value.
{ normal += nor; }  
void normalize ( void  ) [inline]

Converts the normal to a unit vector.

{ normal = Normalize(normal); }
Point3& getNormal ( void  ) [inline]

Returns the normal.

{ return normal; }
const Point3& getNormal ( void  ) const [inline]
{ return normal; }
void setSmGroup ( DWORD  g ) [inline]

Sets the smoothing group to the specified value.

Parameters:
g The smoothing group value to set.
{ smGroup = g; }
void addSmGroup ( DWORD  g ) [inline]

ORs the specified smoothing group value to the existing value.

Parameters:
g The smoothing group bits to set.
{ smGroup |= g; }
DWORD getSmGroup ( void  ) [inline]

Returns the smoothing group value.

{ return smGroup; }
void setMtlIndex ( MtlID  i ) [inline]

Sets the material index to the specified value.

Parameters:
i The material index value to set.
{ mtlIndex = i; }
MtlID getMtlIndex ( void  ) [inline]

Returns the material index.

{ return mtlIndex; }
void setRGB ( Point3 clr ) [inline]

Sets the RGB value.

Parameters:
clr The RGB color to set.
{ rgb = clr; };
Point3& getRGB ( void  ) [inline]

Returns the RGB value.

{ return rgb; }
const Point3& getRGB ( ) const [inline]
{ return rgb; }

RNormal RNormal RNormal RNormal RNormal RNormal RNormal RNormal RNormal RNormal
RNormal RNormal RNormal RNormal RNormal RNormal RNormal RNormal RNormal RNormal