Class NURBSTextureChannel

3DS Max Plug-In SDK

Class NURBSTextureChannel

See Also: Class NURBSTextureSurface, Class NURBSTextureChannelSet, Class NURBSSurface, Class Point2.

class NURBSTextureChannel

Description:

This class is available in release 3.0 and later only.

This class holds the data associated with a single texture channel. This includes the NURBSTextureSurface, texture vertices, channel number, tiling, offset, and rotation settings. The tiling, offset and angle values are applied after the texture surface is applied. This gives the user more control of the mapping.

Friend Classes:

friend class NURBSSurface;

friend class NURBSTextureChannelSet;

Data Members:

private:

int mChannel;

The UV coordinates channel. This value can range from 0 to 98. A single surface can use up to 99 texture channels.

BOOL mGenUVs;

TRUE if the generate UV setting is on for this channel; otherwise FALSE.

Point2 mTexUVs[4];

The texture vertices (UV coordinates).

float mUTile;

The U tiling.

float mVTile;

The V tiling.

float mUOffset;

The U offset.

float mVOffset;

The V offset.

float mAngle;

The rotation angle in radians.

NURBSTextureSurface mTexSurface;

The texture surface associated this channel.

Methods:

private:

Prototype:

NURBSTextureChannel(int channel);

Remarks:

Constructor. The data members are initialized as follows:

mChannel = channel;

mGenUVs = FALSE;

mTexUVs[0] = Point2(0.0f, 0.0f);

mTexUVs[1] = Point2(1.0f, 0.0f);

mTexUVs[2] = Point2(0.0f, 1.0f);

mTexUVs[3] = Point2(1.0f, 1.0f);

mUTile = 1.0f;

mVTile = 1.0f;

mUOffset = 0.0f;

mVOffset = 0.0f;

mAngle = 0.0f;

Prototype:

int GetChannel();

Remarks:

Returns the UV coordinate channel.

Prototype:

BOOL GenerateUVs();

Remarks:

Returns TRUE if the generate UVs state is on; otherwise FALSE.

Prototype:

void SetGenerateUVs(BOOL state);

Remarks:

Sets the generate UV state.

Parameters:

BOOL state

TRUE for on; FALSE for off.

Prototype:

Point2 GetTextureUVs(TimeValue t, int i);

Remarks:

Returns the 'i-th' texture corner at the specified time.

Parameters:

TimeValue t

The time at which to return the texture vertex.

int i

The index of the texture vertex. This is a value in the range 0 to 3.

Prototype:

void SetTextureUVs(TimeValue t, int i, Point2 pt);

Remarks:

Sets the specified texture coordinate.

Parameters:

TimeValue t

The time at which to set the texture UV.

int i

The index of the UV to set. This is a value in the range 0 to 3.

Point2 pt

The UV point to set.

Prototype:

void GetTileOffset(TimeValue t, float &ut, float &vt, float &uo, float &vo, float &a);

Remarks:

Retrieves the tiling, offset and angle values at the specified time.

Parameters:

TimeValue t

The time at which to get the values.

float &ut

The U tiling.

float &vt

The V tiling.

float &uo

The U offset.

float &vo

The V offset.

float &a

The angle.

Prototype:

void SetTileOffset(TimeValue t, float ut, float vt, float uo, float vo, float a);

Remarks:

Sets the tiling, offset and angle values at the specified time.

Parameters:

TimeValue t

The time at which to set the values.

float ut

The U tiling.

float vt

The V tiling.

float uo

The U offset.

float vo

The V offset.

float a

The angle.

Prototype:

NURBSTextureSurface& GetTextureSurface();

Remarks:

Returns a reference to the NURBSTextureSurface maintained by the class.

Prototype:

void SetTextureSurface(NURBSTextureSurface& texSurf);

Remarks:

Set the NURBSTextureSurface maintained by the class.

Parameters:

NURBSTextureSurface& texSurf

The texture surface to set.