Class SetXFormPacket

3DS Max Plug-In SDK

Class SetXFormPacket

See Also: Class Control, Class Matrix3, Class Quat, Class AngAxis, Class Point3.

class SetXFormPacket

Description:

This class is used to allow a transform (Matrix3) controller to know that it is being specifically moved, rotated, or scaled.

When SetValue() is called on a controller, the val pointer is passed in for a certain data type. For a transform (Matrix3) controller SetValue() passes in a pointer to an instance of this. This provides higher level information to the transform controller than what is provided by passing a matrix. For example, if rotation is taking place, the XFORM_ROTATE command would be used. In this way the PRS transform controller would not make position or scale keys since it knows only rotation is taking place. Typically one of the different constructors is used depending on the command needed. All methods of this class are implemented by the system.

Data Members:

public:

SetXFormCommand command;

The command. The transform controller takes the val pointer and casts it to an instance of this class and looks at this data member to see which operation is being performed.

One of the following values:

XFORM_MOVE

The move command. An incremental move is being applied to the matrix.

XFORM_ROTATE

The rotate command. An incremental rotation is being applied to the matrix.

XFORM_SCALE

The scale command. An incremental scaling is being applied to the matrix.

XFORM_SET

To just set the matrix without telling the controller any other higher level information this command may be used. This just sets the value of the matrix (it is not incremental). Any time a node modifies a Matrix3 controller, it will set the method to get CTRL_RELATIVE, and the packet command is set to XFORM_SET.

Matrix3 tmParent;

The parent matrix.

Matrix3 tmAxis;

This usually represents the coordinate system one is moving, rotating, or scaling in. However, if the command is XFORM_SET, then tmAxis is the actual matrix being set.

Point3 p;

If the command is XFORM_MOVE or XFORM_SCALE, then this contains the amount of the move or scale.

Quat q;

If the command is XFORM_ROTATE then this contains the amount of the rotation.

AngAxis aa;

If the command is XFORM_ROTATE this will also contain the amount of the rotation. This form can represent multiple revolutions however (as opposed to Quat q).

BOOL localOrigin;

Indicates the local axis is being used. If TRUE it is; otherwise it is not. If the rotation or scaling is occurring about the pivot point this is TRUE.

Methods:

Prototype:

SetXFormPacket(const Matrix3& mat,const Matrix3& par=Matrix3(1))

Remarks:

Constructor. The XFORM_SET command.

Parameters:

const Matrix3& mat

The tmAxis value.

const Matrix3& par=Matrix3(1)

The tmParent value.

Prototype:

SetXFormPacket(Point3 pt, const Matrix3& par=Matrix3(1),

 const Matrix3& a=Matrix3(1))

Remarks:

Constructor. The XFORM_MOVE command.

Parameters:

Point3 pt

The p value.

const Matrix3& par=Matrix3(1)

The tmParent value.

const Matrix3& a=Matrix3(1)

The tmAxis value.

Prototype:

SetXFormPacket(Quat qt, BOOL l, const Matrix3& par=Matrix3(1),

 const Matrix3& a=Matrix3(1))

Remarks:

Constructor. The XFORM_ROTATE command.

Parameters:

Quat qt

The q value.

BOOL l

The localOrigin value.

const Matrix3& par=Matrix3(1)

The tmParent value.

const Matrix3& a=Matrix3(1)

The tmAxis value.

Prototype:

SetXFormPacket(AngAxis aA, BOOL l, const Matrix3& par=Matrix3(1),

 const Matrix3& a=Matrix3(1))

Remarks:

Constructor. The XFORM_ROTATE command.

Parameters:

AngAxis aA

The aa value.

BOOL l

The localOrigin value.

const Matrix3& par=Matrix3(1)

The tmParent value.

const Matrix3& a=Matrix3(1)

The tmAxis value.

Prototype:

SetXFormPacket(Point3 pt, BOOL l, const Matrix3& par=Matrix3(1),

 const Matrix3& a=Matrix3(1))

Remarks:

Constructor. The XFORM_SCALE command.

Parameters:

Point3 pt

The p value.

BOOL l

The localOrigin value.

const Matrix3& par=Matrix3(1)

The tmParent value.

const Matrix3& a=Matrix3(1)

The tmAxis value.

Prototype:

SetXFormPacket();

Remarks:

Constructor. This constructor is provided in case you want to set the data members yourself.