RNormal Class Reference

#include <mesh.h>

Class 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.
+ Inheritance diagram for RNormal:

Public Member Functions

 RNormal ()
 Constructor. More...
 
void setNormal (const Point3 &nor)
 Sets the normal to the specified value. More...
 
void addNormal (const Point3 &nor)
 Adds the specified value to the value of the normal. More...
 
void normalize (void)
 Converts the normal to a unit vector. More...
 
Point3getNormal (void)
 Returns the normal. More...
 
const Point3getNormal () const
 
void setSmGroup (DWORD g)
 Sets the smoothing group to the specified value. More...
 
void addSmGroup (DWORD g)
 ORs the specified smoothing group value to the existing value. More...
 
DWORD getSmGroup (void)
 Returns the smoothing group value. More...
 
void setMtlIndex (MtlID i)
 Sets the material index to the specified value. More...
 
MtlID getMtlIndex (void)
 Returns the material index. More...
 
void setRGB (Point3 &clr)
 Sets the RGB value. More...
 
Point3getRGB (void)
 Returns the RGB value. More...
 
const Point3getRGB () const
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

RNormal ( )
inline

Constructor.

The smoothing group and material index are set to zero.

74 { smGroup = mtlIndex = 0; }

Member Function Documentation

void setNormal ( const Point3 nor)
inline

Sets the normal to the specified value.

Parameters
norThe normal value to set.
77 { normal = nor; }
void addNormal ( const Point3 nor)
inline

Adds the specified value to the value of the normal.

Parameters
norThe normal value to add to the existing value.
80 { normal += nor; }
void normalize ( void  )
inline

Converts the normal to a unit vector.

82 { normal = Normalize(normal); }
DPoint2 Normalize(const DPoint2 &p)
Returns a unit vector.
Point3& getNormal ( void  )
inline

Returns the normal.

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

Sets the smoothing group to the specified value.

Parameters
gThe smoothing group value to set.
88 { smGroup = g; }
void addSmGroup ( DWORD  g)
inline

ORs the specified smoothing group value to the existing value.

Parameters
gThe smoothing group bits to set.
92 { smGroup |= g; }
DWORD getSmGroup ( void  )
inline

Returns the smoothing group value.

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

Sets the material index to the specified value.

Parameters
iThe material index value to set.
97 { mtlIndex = i; }
MtlID getMtlIndex ( void  )
inline

Returns the material index.

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

Sets the RGB value.

Parameters
clrThe RGB color to set.
102 { rgb = clr; };
Point3& getRGB ( void  )
inline

Returns the RGB value.

104 { return rgb; }
const Point3& getRGB ( ) const
inline
105 { return rgb; }