Public Member Functions | Public Attributes

SetXFormPacket Class Reference

This reference page is linked to from the following overview topics: Controller API Elements.


Search for all occurrences

Detailed Description

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

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

#include <control.h>

Inheritance diagram for SetXFormPacket:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  SetXFormPacket (const Matrix3 &mat, const Matrix3 &par=Matrix3(1))
  SetXFormPacket (Point3 pt, const Matrix3 &par=Matrix3(1), const Matrix3 &a=Matrix3(1))
  SetXFormPacket (Quat qt, BOOL l, const Matrix3 &par=Matrix3(1), const Matrix3 &a=Matrix3(1))
  SetXFormPacket (AngAxis aA, BOOL l, const Matrix3 &par=Matrix3(1), const Matrix3 &a=Matrix3(1))
  SetXFormPacket (Point3 pt, BOOL l, const Matrix3 &par=Matrix3(1), const Matrix3 &a=Matrix3(1))
  SetXFormPacket ()

Public Attributes

SetXFormCommand  command
Matrix3  tmParent
Matrix3  tmAxis
Point3  p
Quat  q
AngAxis  aa
BOOL  localOrigin

Constructor & Destructor Documentation

SetXFormPacket ( const Matrix3 mat,
const Matrix3 par = Matrix3(1) 
) [inline]
Remarks:
Constructor. The XFORM_SET command.
Parameters:
const Matrix3& mat

The tmAxis value.

const Matrix3& par=Matrix3(1)

The tmParent value.
         {command=XFORM_SET,tmParent=par,tmAxis=mat;}
SetXFormPacket ( Point3  pt,
const Matrix3 par = Matrix3(1),
const Matrix3 a = Matrix3(1) 
) [inline]
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.
         {command=XFORM_MOVE;tmParent=par;tmAxis=a;p=pt;localOrigin=FALSE;}
SetXFormPacket ( Quat  qt,
BOOL  l,
const Matrix3 par = Matrix3(1),
const Matrix3 a = Matrix3(1) 
) [inline]
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.
         {command=XFORM_ROTATE;tmParent=par;tmAxis=a;q=qt;aa=AngAxis(q);localOrigin=l;}
SetXFormPacket ( AngAxis  aA,
BOOL  l,
const Matrix3 par = Matrix3(1),
const Matrix3 a = Matrix3(1) 
) [inline]
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.
         {command=XFORM_ROTATE;tmParent=par;tmAxis=a;q=Quat(aA);aa=aA;localOrigin=l;}
SetXFormPacket ( Point3  pt,
BOOL  l,
const Matrix3 par = Matrix3(1),
const Matrix3 a = Matrix3(1) 
) [inline]
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.
         {command=XFORM_SCALE;tmParent=par;tmAxis=a;p=pt;localOrigin=l;}
SetXFormPacket ( ) [inline]
Remarks:
Constructor. This constructor is provided in case you want to set the data members yourself.
{};

Member Data Documentation

SetXFormCommand command

SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket
SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket SetXFormPacket