Package gaiasky.scene.component
Class AffineTransformations
java.lang.Object
gaiasky.scene.component.AffineTransformations
- All Implemented Interfaces:
com.badlogic.ashley.core.Component
Represents an arbitrarily large sequence of affine transformations as a list of 4x4 matrices.
-
Field Summary
Modifier and TypeFieldDescriptionAffine transformations, applied each cycle -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.math.Matrix4
apply
(com.badlogic.gdx.math.Matrix4 mat) void
clear()
deepCopy()
Produces a deep copy of the current affine transformations object.void
boolean
isEmpty()
void
replace
(ITransform newTransform, int index) Replace the transformation at the current index with the given one.void
setMatrix
(double[] matrix) Sets a generic 4x4 transformation matrix in the chain.void
setQuaternion
(double[] axis, double angle) void
void
setRotate
(double[] axisDegrees) void
setScale
(double[] sc) void
void
setTransformations
(Object[] transformations) void
setTransformations
(Vector<ITransform> transformations) void
setTransformMatrix
(double[] matrix) void
setTranslate
(double[] translation) void
setTranslateKm
(double[] translation) void
setTranslatePc
(double[] translation)
-
Field Details
-
transformations
Affine transformations, applied each cycle
-
-
Constructor Details
-
AffineTransformations
public AffineTransformations()
-
-
Method Details
-
setTransformations
-
setTransformations
-
initialize
public void initialize() -
clear
public void clear() -
isEmpty
public boolean isEmpty() -
replace
Replace the transformation at the current index with the given one.- Parameters:
newTransform
- The new transformation.index
- The index.
-
setMatrix
public void setMatrix(double[] matrix) Sets a generic 4x4 transformation matrix in the chain.- Parameters:
matrix
- The matrix values in column-major order.
-
setTransformMatrix
public void setTransformMatrix(double[] matrix) -
setTranslate
public void setTranslate(double[] translation) -
setTranslatePc
public void setTranslatePc(double[] translation) -
setTranslateKm
public void setTranslateKm(double[] translation) -
setQuaternion
public void setQuaternion(double[] axis, double angle) -
setQuaternion
-
setRotate
public void setRotate(double[] axisDegrees) -
setScale
public void setScale(double[] sc) -
setScale
-
apply
public com.badlogic.gdx.math.Matrix4 apply(com.badlogic.gdx.math.Matrix4 mat) -
apply
-
getScaleTransform
-
getRotateTransform
-
getTranslateTransform
-
deepCopy
Produces a deep copy of the current affine transformations object.- Returns:
- A deep copy of this object.
-