# class Transform3

Transform3 handles homogeneous 4x4 transforms, i.e. transformations which can be represented by multiplying a 4x4 matrix with a homogeneous 3D coordinate. Transform3 can either pre-multiply a matrix onto the transformation, which will add a transform around the current transform, or it can post-multiply the matrix, which will add a transform inside the current transform. Post-multiply is the default mode.

See also: Matrix4x4

# Properties

Property Description
Name The name of the Transform3 object. (Inherited from Object)

# Methods

Method Description
AddObserver Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
AddRotation Concatenates a rotation transform to the current transform.
AddScaling Concatenates a scaling transform to the current transform.
AddTransformation Concatenates a generic transform to the current transform.
AddTranslation Concatenates a translation transform to the current transform.
Clear Resets the transformation to the identity transform, resets the multiplication mode to PostMultiply, and clears the matrix stack.
GetClass Get the name of the Transform3 class. (Inherited from Object)
GetMatrix The matrix that is used to specify the transform.
GetStack The real array that is used to store the matrix stack.
IsA Returns true if Transform3 is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsNull Returns true if the Transform3 object is invalid. (Inherited from Object)
IsPostMultiply The transform concatenation mode.
IsPreMultiply The transform concatenation mode.
IsSameObjectAs Returns true if the Transform3 object is valid. (Inherited from Object)
NonNull Returns true if the Transform3 object is valid. (Inherited from Object)
Pop Pops the topmost matrix on the the matrix stack, and replaces the current transform with the popped matrix.
PostMultiply The transform concatenation mode to post-multiply, any added transform will be concatenated using this mode.
PreMultiply The transform concatenation mode to pre-multiply, any added transform will be concatenated using this mode.
PrintInfo Prints the content/info of the Transform3 object to the log. (Inherited from Object)
Push Pushes the current transform onto the matrix stack.
RemoveObserver Removes a previously added observer object. (Inherited from Object)

# Static methods

Method Description
IsClassA Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCast SafeCast makes sure the input object is of a class that can be cast into spTransform3, and if this is the case, returns the object cast into spTransform3. (Inherited from Object)

# Properties details

# Name

The name of the Transform3 object. (Inherited from Object)

# Syntax

// Setter
void SetName( const char * name ) const;

// Getter
spString GetName() const;

# SetName parameters

Type Name Min Max Description
const char * name New name of the object.

# GetName return value

Type: spString

# Methods details

# AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

# Syntax

rid AddObserver( const spObserver & observer ) const;

# Parameters

Type Name Min Max Description
Observer observer Observer is the object that will receive events.

# Return value

Type: rid

# AddRotation

Concatenates a rotation transform to the current transform.

# Syntax

void AddRotation( real angle , real rx , real ry , real rz ) const;

# Parameters

Type Name Min Max Description
real angle The rotation angle around the axis.
real rx The x axis rotation component.
real ry The y axis rotation component.
real rz The z axis rotation component.

# AddScaling

Concatenates a scaling transform to the current transform.

# Syntax

void AddScaling( real sx , real sy , real sz ) const;

# Parameters

Type Name Min Max Description
real sx The scaling vector x axis component.
real sy The scaling vector y axis component.
real sz The scaling vector z axis component.

# AddTransformation

Concatenates a generic transform to the current transform.

# Syntax

void AddTransformation( const spMatrix4x4 & transform ) const;

# Parameters

Type Name Min Max Description
Matrix4x4 transform The input transform matrix.

# AddTranslation

Concatenates a translation transform to the current transform.

# Syntax

void AddTranslation( real tx , real ty , real tz ) const;

# Parameters

Type Name Min Max Description
real tx The translation vector x component.
real ty The translation vector y component.
real tz The translation vector z component.

# Clear

Resets the transformation to the identity transform, resets the multiplication mode to PostMultiply, and clears the matrix stack.

# Syntax

void Clear() const;

# Parameters

Clear takes no parameters.

# GetClass

Get the name of the Transform3 class. (Inherited from Object)

# Syntax

spString GetClass() const;

# Parameters

GetClass takes no parameters.

# Return value

Type: spString

# GetMatrix

The matrix that is used to specify the transform.

# Syntax

spMatrix4x4 GetMatrix() const;

# Parameters

GetMatrix takes no parameters.

# Return value

Type: Matrix4x4

# GetStack

The real array that is used to store the matrix stack.

# Syntax

spRealArray GetStack() const;

# Parameters

GetStack takes no parameters.

# Return value

Type: RealArray

# IsA

Returns true if Transform3 is a or is a descendant of the class named as the type parameter. (Inherited from Object)

# Syntax

bool IsA( const char * type ) const;

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if Transform3 is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the Transform3 object is invalid. (Inherited from Object)

# Syntax

bool IsNull() const;

# Parameters

IsNull takes no parameters.

# Return value

Type: bool

# IsPostMultiply

The transform concatenation mode.

# Syntax

bool IsPostMultiply() const;

# Parameters

IsPostMultiply takes no parameters.

# Return value

Type: bool

# IsPreMultiply

The transform concatenation mode.

# Syntax

bool IsPreMultiply() const;

# Parameters

IsPreMultiply takes no parameters.

# Return value

Type: bool

# IsSameObjectAs

Returns true if the Transform3 object is valid. (Inherited from Object)

# Syntax

bool IsSameObjectAs( const spObject & object ) const;

# Parameters

Type Name Min Max Description
Object object Object to compare with.

# Return value

Type: bool

# NonNull

Returns true if the Transform3 object is valid. (Inherited from Object)

# Syntax

bool NonNull() const;

# Parameters

NonNull takes no parameters.

# Return value

Type: bool

# Pop

Pops the topmost matrix on the the matrix stack, and replaces the current transform with the popped matrix.

# Syntax

void Pop() const;

# Parameters

Pop takes no parameters.

# PostMultiply

The transform concatenation mode to post-multiply, any added transform will be concatenated using this mode.

# Syntax

void PostMultiply() const;

# Parameters

PostMultiply takes no parameters.

# PreMultiply

The transform concatenation mode to pre-multiply, any added transform will be concatenated using this mode.

# Syntax

void PreMultiply() const;

# Parameters

PreMultiply takes no parameters.

# PrintInfo

Prints the content/info of the Transform3 object to the log. (Inherited from Object)

# Syntax

void PrintInfo() const;

# Parameters

PrintInfo takes no parameters.

# Push

Pushes the current transform onto the matrix stack.

# Syntax

void Push() const;

# Parameters

Push takes no parameters.

# RemoveObserver

Removes a previously added observer object. (Inherited from Object)

# Syntax

void RemoveObserver( rid observerId ) const;

# Parameters

Type Name Min Max Description
rid observerId ObserverId is the id returned by AddObserver when the observer was added.

# Static methods details

# IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

# Syntax

static bool IsClassA( const char * type ) const;

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if the class is, or is a descendant of.

# Return value

Type: bool

# SafeCast

SafeCast makes sure the input object is of a class that can be cast into spTransform3, and if this is the case, returns the object cast into spTransform3. (Inherited from Object)

# Syntax

static spTransform3 SafeCast( const spObject & object ) const;

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: Transform3