Kanzi  3.9.7
Java API
SRTValue2D Class Reference

A structure that describes the scale, rotation and translation transformation in 2D space. More...

Public Member Functions

 SRTValue2D (long cPtr, boolean cMemoryOwn)
 
 SRTValue2D ()
 Default constructor.
 
 SRTValue2D (Vector2 scale, float rotationInRadians, Vector2 translation)
 Constructor with supplied scale, rotation and translation. More...
 
synchronized void delete ()
 
boolean equals (Object obj)
 
float getRotation ()
 Returns the rotation. More...
 
Vector2 getScale ()
 Returns the scale. More...
 
float getScaleX ()
 Returns the scale along the x-axis. More...
 
float getScaleY ()
 Returns the scale along the y-axis. More...
 
Vector2 getTranslation ()
 Returns the translation. More...
 
float getTranslationX ()
 Returns the translation along the x-axis. More...
 
float getTranslationY ()
 Returns the translation along the y-axis. More...
 
int hashCode ()
 
void rotate (float rotationInRadians)
 Adds a rotation angle to the current rotation. More...
 
SRTValue2D rotated (float rotationInRadians)
 Rotates the SRT object. More...
 
void scale (Vector2 factor)
 Multiplies the current scale with the provided scaling factor. More...
 
SRTValue2D scaled (Vector2 scale)
 Scales the SRT object. More...
 
void setRotation (float rotationInRadians)
 Sets the rotation. More...
 
void setScale (Vector2 value)
 Sets the scale. More...
 
void setScaleX (float value)
 Sets the scale along the x-axis. More...
 
void setScaleY (float value)
 Sets the scale along the y-axis. More...
 
void setTranslation (Vector2 value)
 Sets the translation. More...
 
void setTranslationX (float value)
 Sets the translation along the x-axis. More...
 
void setTranslationY (float value)
 Sets the translation along the y-axis. More...
 
Matrix3x3 toMatrix ()
 Converts the SRT representation to Matrix3x3 transform. More...
 
void translate (Vector2 translation)
 Adds the provided translation to the current translation. More...
 
SRTValue2D translated (Vector2 translation)
 Translates the SRT object. More...
 
void uniformScale (float factor)
 Multiplies the current scale with the provided uniform scaling factor. More...
 

Static Public Member Functions

static SRTValue2D create (Matrix3x3 matrix)
 Attempts to create a SRT object from a given transformation 3x3 matrix. More...
 
static SRTValue2D createRotation (float rotationInRadians)
 Creates a rotation SRT. More...
 
static SRTValue2D createScale (Vector2 scale)
 Creates a scale SRT. More...
 
static SRTValue2D createTranslation (Vector2 translation)
 Creates a translation SRT. More...
 
static long getCPtr (SRTValue2D obj)
 
static long swigRelease (SRTValue2D obj)
 

Protected Member Functions

void finalize ()
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

A structure that describes the scale, rotation and translation transformation in 2D space.


Rotation is stored as angle in radians.

Constructor & Destructor Documentation

SRTValue2D ( Vector2  scale,
float  rotationInRadians,
Vector2  translation 
)

Constructor with supplied scale, rotation and translation.


Parameters
scaleThe scale.
rotationInRadiansThe rotation angle in radians.
translationThe translation.

Member Function Documentation

static SRTValue2D create ( Matrix3x3  matrix)
static

Attempts to create a SRT object from a given transformation 3x3 matrix.

Note: A matrix is decomposable into SRT if its column vectors are orthogonal to each other.

Parameters
matrixThe transformation 3x3 matrix.
Returns
A SRTValue3D object if the matrix is decomposable, null otherwise.
static SRTValue2D createRotation ( float  rotationInRadians)
static

Creates a rotation SRT.


Parameters
rotationInRadiansThe rotation angle in radians.
Returns
An SRT object with rotation.
static SRTValue2D createScale ( Vector2  scale)
static

Creates a scale SRT.


Parameters
scaleThe scale.
Returns
An SRT object with scale.
static SRTValue2D createTranslation ( Vector2  translation)
static

Creates a translation SRT.


Parameters
translationThe translation.
Returns
An SRT object with translation.
float getRotation ( )

Returns the rotation.


Returns
The rotation angle in radians.
Vector2 getScale ( )

Returns the scale.


Returns
The scale.
float getScaleX ( )

Returns the scale along the x-axis.


Returns
The x component of the scale.
float getScaleY ( )

Returns the scale along the y-axis.


Returns
The y component of the scale.
Vector2 getTranslation ( )

Returns the translation.


Returns
The translation.
float getTranslationX ( )

Returns the translation along the x-axis.


Returns
The x component of the translation.
float getTranslationY ( )

Returns the translation along the y-axis.


Returns
The y component of the translation.
void rotate ( float  rotationInRadians)

Adds a rotation angle to the current rotation.


Parameters
rotationInRadiansThe rotation angle in radians.
SRTValue2D rotated ( float  rotationInRadians)

Rotates the SRT object.


Parameters
rotationInRadiansThe rotation angle in degrees.
Returns
A new SRT object with the rotation applied.
void scale ( Vector2  factor)

Multiplies the current scale with the provided scaling factor.


Parameters
factorThe scaling factor.
SRTValue2D scaled ( Vector2  scale)

Scales the SRT object.


Parameters
scaleThe scaling factor.
Returns
A new SRT object with the scale applied.
void setRotation ( float  rotationInRadians)

Sets the rotation.


Parameters
rotationInRadiansThe rotation angle in radians.
void setScale ( Vector2  value)

Sets the scale.


Parameters
valueThe scale.
void setScaleX ( float  value)

Sets the scale along the x-axis.


Parameters
valueThe x component of the scale.
void setScaleY ( float  value)

Sets the scale along the y-axis.


Parameters
valueThe y component of the scale.
void setTranslation ( Vector2  value)

Sets the translation.


Parameters
valueThe translation.
void setTranslationX ( float  value)

Sets the translation along the x-axis.


Parameters
valueThe x component of the translation.
void setTranslationY ( float  value)

Sets the translation along the y-axis.


Parameters
valueThe y component of the translation.
Matrix3x3 toMatrix ( )

Converts the SRT representation to Matrix3x3 transform.


Returns
A matrix representation of the SRT object.
void translate ( Vector2  translation)

Adds the provided translation to the current translation.


Parameters
translationThe translation term.
SRTValue2D translated ( Vector2  translation)

Translates the SRT object.


Parameters
translationThe translation term.
Returns
A new SRT object with the translation applied.
void uniformScale ( float  factor)

Multiplies the current scale with the provided uniform scaling factor.


Parameters
factorThe scaling factor.