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
FieldsModifier and TypeFieldDescriptionAffine transformations, applied each cycle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.math.Matrix4apply(com.badlogic.gdx.math.Matrix4 mat) voidclear()deepCopy()Produces a deep copy of the current affine transformations object.voidbooleanisEmpty()voidreplace(ITransform newTransform, int index) Replace the transformation at the current index with the given one.voidsetMatrix(double[] matrix) Sets a generic 4x4 transformation matrix in the chain.voidsetQuaternion(double[] axis, double angle) voidvoidsetRotate(double[] axisDegrees) voidsetScale(double[] sc) voidvoidsetTransformations(Object[] transformations) voidsetTransformations(Vector<ITransform> transformations) voidsetTransformMatrix(double[] matrix) voidsetTranslate(double[] translation) voidsetTranslateKm(double[] translation) voidsetTranslatePc(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.
-