A structure that describes the scale, rotation and translation transformation in 2D space. More...
Public Member Functions | |
SRTValue2D () | |
Default constructor. | |
SRTValue2D (Vector2 scale, float rotationInRadians, Vector2 translation) | |
Constructor with supplied scale, rotation and translation. | |
synchronized void | delete () |
boolean | equals (Object obj) |
Indicates whether some other object is "equal to" this one. | |
float | getRotation () |
Returns the rotation. | |
Vector2 | getScale () |
Returns the scale. | |
float | getScaleX () |
Returns the scale along the x-axis. | |
float | getScaleY () |
Returns the scale along the y-axis. | |
Vector2 | getTranslation () |
Returns the translation. | |
float | getTranslationX () |
Returns the translation along the x-axis. | |
float | getTranslationY () |
Returns the translation along the y-axis. | |
int | hashCode () |
Returns a hash code value for the object. | |
void | rotate (float rotationInRadians) |
Adds a rotation angle to the current rotation. | |
SRTValue2D | rotated (float rotationInRadians) |
Rotates the SRT object. | |
void | scale (Vector2 factor) |
Multiplies the current scale with the provided scaling factor. | |
SRTValue2D | scaled (Vector2 scale) |
Scales the SRT object. | |
void | setRotation (float rotationInRadians) |
Sets the rotation. | |
void | setScale (Vector2 value) |
Sets the scale. | |
void | setScaleX (float value) |
Sets the scale along the x-axis. | |
void | setScaleY (float value) |
Sets the scale along the y-axis. | |
void | setTranslation (Vector2 value) |
Sets the translation. | |
void | setTranslationX (float value) |
Sets the translation along the x-axis. | |
void | setTranslationY (float value) |
Sets the translation along the y-axis. | |
Matrix3x3 | toMatrix () |
Converts the SRT representation to Matrix3x3 transform. | |
void | translate (Vector2 translation) |
Adds the provided translation to the current translation. | |
SRTValue2D | translated (Vector2 translation) |
Translates the SRT object. | |
void | uniformScale (float factor) |
Multiplies the current scale with the provided uniform scaling factor. | |
Static Public Member Functions | |
static SRTValue2D | create (Matrix3x3 matrix) |
Attempts to create a SRT object from a given transformation 3x3 matrix. | |
static SRTValue2D | createRotation (float rotationInRadians) |
Creates a rotation SRT. | |
static SRTValue2D | createScale (Vector2 scale) |
Creates a scale SRT. | |
static SRTValue2D | createTranslation (Vector2 translation) |
Creates a translation SRT. | |
Protected Member Functions | |
void | finalize () |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | |
Protected Attributes | |
transient boolean | swigCMemOwn |
Does this object own its native object. | |
A structure that describes the scale, rotation and translation transformation in 2D space.
Rotation is stored as angle in radians.
SRTValue2D | ( | Vector2 | scale, |
float | rotationInRadians, | ||
Vector2 | translation ) |
Constructor with supplied scale, rotation and translation.
scale | The scale. |
rotationInRadians | The rotation angle in radians. |
translation | The translation. |
|
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.
matrix | The transformation 3x3 matrix. |
|
static |
Creates a rotation SRT.
rotationInRadians | The rotation angle in radians. |
|
static |
Creates a scale SRT.
scale | The scale. |
|
static |
Creates a translation SRT.
translation | The translation. |
boolean equals | ( | Object | obj | ) |
Indicates whether some other object is "equal to" this one.
obj | The reference object with which to compare. |
|
protected |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
Finalization is deprecated and subject to removal in future.
float getRotation | ( | ) |
Returns the rotation.
Vector2 getScale | ( | ) |
Returns the scale.
float getScaleX | ( | ) |
Returns the scale along the x-axis.
float getScaleY | ( | ) |
Returns the scale along the y-axis.
Vector2 getTranslation | ( | ) |
Returns the translation.
float getTranslationX | ( | ) |
Returns the translation along the x-axis.
float getTranslationY | ( | ) |
Returns the translation along the y-axis.
int hashCode | ( | ) |
Returns a hash code value for the object.
Adds a rotation angle to the current rotation.
rotationInRadians | The rotation angle in radians. |
SRTValue2D rotated | ( | float | rotationInRadians | ) |
Rotates the SRT object.
rotationInRadians | The rotation angle in degrees. |
Multiplies the current scale with the provided scaling factor.
factor | The scaling factor. |
SRTValue2D scaled | ( | Vector2 | scale | ) |
Scales the SRT object.
scale | The scaling factor. |
Sets the rotation.
rotationInRadians | The rotation angle in radians. |
Sets the scale along the x-axis.
value | The x component of the scale. |
Sets the scale along the y-axis.
value | The y component of the scale. |
Sets the translation along the x-axis.
value | The x component of the translation. |
Sets the translation along the y-axis.
value | The y component of the translation. |
Matrix3x3 toMatrix | ( | ) |
Converts the SRT representation to Matrix3x3 transform.
Adds the provided translation to the current translation.
translation | The translation term. |
SRTValue2D translated | ( | Vector2 | translation | ) |
Translates the SRT object.
translation | The translation term. |