3ds Max C++ API Reference
RVertex Class Reference

#include <mesh.h>

+ Inheritance diagram for RVertex:

Public Types

enum  { MAX_NUM_NORMALS = 0xff }
 

Public Member Functions

 RVertex ()
 Constructor. More...
 
DllExport ~RVertex ()
 Destructor. More...
 

Public Attributes

DWORD rFlags
 The flags contain the clip flags, the number of normals at the vertex, and the number of normals that have already been rendered. More...
 
int pos [3]
 The rendered vertex position. More...
 
RNormal rn
 If used, a single RNormal will be stored here. More...
 
RNormalern
 In some cases, there may be two or more RNormals per vertex. More...
 

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

Detailed Description

A RVertex is a rendered vertex. A vertex becomes a RVertex after it has been transformed. A RVertex has a position (x, y, z coordinate) that is stored in device coordinates. They are stored in the data member Pos[3]. One vertex in a Mesh can be shared between many different smoothing groups. In the 3ds Max Mesh database, the vertices are shared, however the normals are not. This is why an RVertex has a RNormal data member. For example, if you had a sphere that had the top and bottom hemispheres smoothed separately (i.e. not smoothed across the equator), then the vertices across the equator would have two RNormals for each RVertex while the other vertices would have one. There may be as many RNormals as there are smoothing groups colliding at a vertex. However, it is by far the most common case to have one, and anything other than one or two is very rare. For purposes of smoothing, as many RNormals are allocated as required and are stored in this class. RNormals are kept in this RVertex class since the RVertex is what gets rendered (lit). When you light a vertex you need to know its normal direction. Thus the RNormal(s) are stored in this class (using data member rn or *ern). All methods of this class are implemented by the system.

Note
For internal use only. 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 RNormal, Class Mesh, Class GraphicsWindow.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_NUM_NORMALS 
154  {
155  MAX_NUM_NORMALS = 0xff
156  };
@ MAX_NUM_NORMALS
Definition: mesh.h:155

Constructor & Destructor Documentation

◆ RVertex()

RVertex ( )
inline

Constructor.

The flags are set to zero and the ern pointer is set to NULL.

161 { rFlags = 0; ern = NULL; }
#define NULL
Definition: autoptr.h:18
RNormal * ern
In some cases, there may be two or more RNormals per vertex.
Definition: mesh.h:181
DWORD rFlags
The flags contain the clip flags, the number of normals at the vertex, and the number of normals that...
Definition: mesh.h:170

◆ ~RVertex()

Destructor.

Member Data Documentation

◆ rFlags

DWORD rFlags

The flags contain the clip flags, the number of normals at the vertex, and the number of normals that have already been rendered.

These are used internally. For example, the clipping flags are used to see if the RVertex can be either trivially accepted or rejected when rendering.

◆ pos

int pos[3]

The rendered vertex position.

◆ rn

RNormal rn

If used, a single RNormal will be stored here.

◆ ern

RNormal* ern

In some cases, there may be two or more RNormals per vertex.

If this is the case, these 'extra' RNormals are allocated and the pointer to the memory is stored here. If these are used, then data member rn is not used (rn is copied into ern[0]).