Class TVFace

3DS Max Plug-In SDK

Class TVFace

See Also: Class Mesh.

class TVFace

Description:

This class is used for texture faces as well as vertex colors. The class maintains an array of three indices into the object's tVerts array. See the Mesh class for details on how its array of TVFaces and tVerts relate. All methods of this class are implemented by the system.

Data Members:

public:

DWORD t[3];

These are indices into the mesh object's tVerts array.

Methods:

Prototype:

TVFace()

Remarks:

Constructor. No initialization is done.

Prototype:

TVFace(DWORD a, DWORD b, DWORD c);

Remarks:

Constructor.

Parameters:

DWORD a

Specifies the index into the tVerts array for vertex 0.

DWORD b

Specifies the index into the tVerts array for vertex 1.

DWORD c

Specifies the index into the tVerts array for vertex 2.

Prototype:

void setTVerts(DWORD *vrt);

Remarks:

Sets the texture vertices.

Parameters:

DWORD *vrt

An array of indices into the tVerts array for vertices 0, 1, and 2.

Prototype:

void setTVerts(int a, int b, int c);

Remarks:

Sets the textured vertices.

Parameters:

int a

Specifies the index into the tVerts array for vertex 0.

int b

Specifies the index into the tVerts array for vertex 1.

int c

Specifies the index into the tVerts array for vertex 2.

Prototype:

DWORD getTVert(int index);

Remarks:

Retrieves one of the texture vertices.

Parameters:

int index

Specifies the index of the texture vertex to retrieve. You may use 0, 1 or 2.

Return Value:

The texture vertex.

Prototype:

DWORD *getAllTVerts();

Remarks:

Returns a pointer to the array of texture vertices.

 

 

Prototype:

DWORD GetVertIndex(DWORD v0);

Remarks:

This method is available in release 3.0 and later only.

Returns the index of the specified texture vertex in this texture face's vertex list (0, 1 or 2). If not found 3 is returned.

Parameters:

DWORD v0

The zero based index of the texture vertex to check.

Prototype:

DWORD GetOtherIndex(DWORD v0, DWORD v1);

Remarks:

This method is available in release 3.0 and later only.

Returns the first texture vertex in this texture face that isn't v0 or v1.

Parameters:

DWORD v0

The zero based index of one of the vertices to check.

DWORD v1

The zero based index of the other vertex to check.

Prototype:

int Direction(DWORD v0, DWORD v1);

Remarks:

This method is available in release 3.0 and later only.

Indicates the order in which vertices v0 and v1 appear in the texture face.

Parameters:

DWORD v0

One vertex on this texture face.

DWORD v1

Another vertex on this texture face.

Return Value:

1 if v1 follows v0 in sequence.

-1 if v0 follows v1 in sequence.

0 if v0 or v1 are not on the face.

Prototype:

void OrderVerts(DWORD &v0, DWORD &v1);

Remarks:

This method is available in release 3.0 and later only.

This method switches v0,v1 if needed to put them in face-order. If v0 and v1 are in the order in which they appear in the texture face, or if one or both of them are not actually on the texture face, nothing happens. If however v0 follows v1, the values of the parameters are switched, so that they are then in the correct order for this texture face.

Parameters:

DWORD &v0

One vertex on this texture face.

DWORD &v1

Another vertex on this texture face.