Class AngAxis

3DS Max Plug-In SDK

Class AngAxis

See Also: Class Quat, Class Point3.

class AngAxis

Description:

This class provides a representation for orientation in three space using an angle and axis. This class is similar to a quaternion, except that a normalized quaternion only represents -PI to +PI rotation. This class will have the number of revolutions stored. All methods of this class are implemented by the system.

The rotation convention in the 3ds max API is the left-hand-rule. Note that this is different from the right-hand-rule used in the 3ds max user interface.

Data Members:

public:

Point3 axis;

The axis of rotation.

float angle;

The angle of rotation about the axis in radians. This angle is left handed.

Methods:

Prototype:

AngAxis()

Remarks:

Constructor. No initialization is performed.

Prototype:

AngAxis(const Point3& axis,float angle)

Remarks:

Constructor. Data members are initialized to the specified values.

Prototype:

AngAxis(float x, float y, float z, float ang);

Remarks:

This method is available in release 3.0 and later only.

Constructor. The AngAxis is initialized from the specified values.

Parameters:

float x

The x component of the axis.

float y

The y component of the axis.

float z

The z component of the axis.

float ang

The angle component in radians.

Prototype:

AngAxis(const Matrix3& m);

Remarks:

This method is available in release 3.0 and later only.

Constructor. The AngAxis is initialized with the rotation from the specified matrix.

Parameters:

const Matrix3& m

The rotation used to initialize the AngAxis.

Prototype:

AngAxis(const Quat &q);

Remarks:

Constructor. Data members are initialized equal to the specified Quat.

Prototype:

AngAxis& Set(float x, float y, float z, float ang);

Remarks:

This method is available in release 3.0 and later only.

Sets the angle and axis to the specified values.

Parameters:

float x

Specifies the x component of the axis.

float y

Specifies the xycomponent of the axis.

float z

Specifies the z component of the axis.

float ang

Specifies the angle to set in radians.

Return Value:

A reference to this AngAxis.

Prototype:

AngAxis& Set(const Point3& ax, float ang);

Remarks:

This method is available in release 3.0 and later only.

Sets the angle and axis to the specified values.

Parameters:

const Point3& ax

Specifies the axis to set.

float ang

Specifies the angle to set in radians.

Return Value:

A reference to this AngAxis.

Prototype:

AngAxis& Set(const Quat& q);

Remarks:

This method is available in release 3.0 and later only.

Sets the angle and axis based on the rotations from the specified quaternion.

Parameters:

const Quat& q

Specifies the angle and axis to use.

Return Value:

A reference to this AngAxis.

Prototype:

AngAxis& Set(const Matrix3& m);

Remarks:

This method is available in release 3.0 and later only.

Sets the angle and axis based on the rotations from the specified matrix.

Parameters:

const Matrix3& m

Specifies the angle and axis to use.

Return Value:

A reference to this AngAxis.

Prototype:

int GetNumRevs();

Remarks:

Returns the number of revolutions represented by the angle. This returns int(angle/TWOPI);

Prototype:

void SetNumRevs(int num);

Remarks:

Sets the number of revolution to num. This modifies angle: angle += float(num)*TWOPI;