Public Types | Public Member Functions | Public Attributes

RVertex Class Reference

Search for all occurrences

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 fPos[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 hemi-spheres 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: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 RNormal, Class Mesh, Class GraphicsWindow.

#include <mesh.h>

Inheritance diagram for RVertex:
Inheritance graph
[legend]

List of all members.

Public Types

enum   { MAX_NUM_NORMALS = 0xff }

Public Member Functions

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

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.
int  pos [3]
RNormal  rn
  If used, a single RNormal will be stored here.
RNormal ern
  In some cases, there may be two or more RNormals per vertex.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

RVertex ( ) [inline]

Constructor.

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

{ rFlags = 0; ern = NULL; }
DllExport ~RVertex ( )

Destructor.


Member Data Documentation

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.

int pos[3]
Deprecated:
This position is no longer used.

If used, a single RNormal will be stored here.

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


RVertex RVertex RVertex RVertex RVertex RVertex RVertex RVertex RVertex RVertex
RVertex RVertex RVertex RVertex RVertex RVertex RVertex RVertex RVertex RVertex