Package org.eclipse.mosaic.lib.spatial
Class TransformationMatrix
java.lang.Object
org.eclipse.mosaic.lib.math.Matrix4d
org.eclipse.mosaic.lib.spatial.TransformationMatrix
- All Implemented Interfaces:
Serializable
An special version of the
Matrix4d
providing further methods to
describe scaling, rotation, and translation in the 3-dimensional space.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new transformation matrix.TransformationMatrix
(TransformationMatrix copyFrom) Creates a new transformation matrix with values from the given TransformationMatrix. -
Method Summary
Modifier and TypeMethodDescriptionAdds a matrix to this matrix.add
(Matrix4d mat, TransformationMatrix result) copy()
Creates copy of this matrix.Extracts a 3x3 sub-matrix containing rotation+scale from this transformation matrix.getRotation
(RotationMatrix result) Extracts a 3x3 sub-matrix containing rotation+scale from this transformation matrix.Extracts a 3 dimensional vector containing translation part from this transformation matrix.getTranslation
(Vector3d result) Extracts a 3 dimensional vector containing translation part from this transformation matrix.static TransformationMatrix
Creates a new transformation matrix.multiply
(Matrix4d mat, TransformationMatrix result) rotate
(double angleDeg, double axX, double axY, double axZ) Adds rotation to this transformation matrix.Adds rotation to this transformation matrix.scale
(double sx, double sy, double sz) Adds scaling to this transformation matrix.set
(double[] values, MatrixElementOrder inputOrder) Sets the values of the matrix by the given double array.set
(float[] values, MatrixElementOrder inputOrder) Sets the values of the matrix by the given float array.set
(int row, int col, double value) Sets a specific value in the matrix by row and column indexCopies the values from the given matrix to this matrix.Sets all values to match identity matrix.setRotation
(RotationMatrix rotation) Replaces the 3x3 sub-matrix containing the rotation+scale for this transformation matrix.setZero()
Sets all values to zero.Subtracts a matrix from this matrix.subtract
(Matrix4d mat, TransformationMatrix result) Applies this transformation matrix to the given vector.Applies this transformation matrix to the given vector.translate
(double x, double y, double z) Adds translation to this transformation matrix.Adds translation to this transformation matrix.Transposes this matrix.transpose
(TransformationMatrix result) Methods inherited from class org.eclipse.mosaic.lib.math.Matrix4d
add, equals, get, getAsDoubleArray, getAsFloatArray, hashCode, inverse, invert, isFuzzyEqual, multiply, subtract, toString, transpose
-
Constructor Details
-
TransformationMatrix
public TransformationMatrix()Creates a new transformation matrix. The initial values match the identity matrix. -
TransformationMatrix
Creates a new transformation matrix with values from the given TransformationMatrix.
-
-
Method Details
-
identityMatrix
Creates a new transformation matrix. The initial values match the identity matrix. -
getRotation
Extracts a 3x3 sub-matrix containing rotation+scale from this transformation matrix. -
getRotation
Extracts a 3x3 sub-matrix containing rotation+scale from this transformation matrix. The result is written into the result matrix. -
setRotation
Replaces the 3x3 sub-matrix containing the rotation+scale for this transformation matrix. -
getTranslation
Extracts a 3 dimensional vector containing translation part from this transformation matrix. -
getTranslation
Extracts a 3 dimensional vector containing translation part from this transformation matrix. The result is written into the result vector. -
transform
Applies this transformation matrix to the given vector. -
transform
Applies this transformation matrix to the given vector. -
translate
Adds translation to this transformation matrix. -
translate
Adds translation to this transformation matrix. -
scale
Adds scaling to this transformation matrix. -
rotate
Adds rotation to this transformation matrix. -
rotate
Adds rotation to this transformation matrix. -
copy
Description copied from class:Matrix4d
Creates copy of this matrix. -
set
Description copied from class:Matrix4d
Copies the values from the given matrix to this matrix. -
setIdentity
Description copied from class:Matrix4d
Sets all values to match identity matrix.- Overrides:
setIdentity
in classMatrix4d
-
setZero
Description copied from class:Matrix4d
Sets all values to zero. -
set
Description copied from class:Matrix4d
Sets the values of the matrix by the given float array. The order parameter defines how the values in the given array are arranged (either column or row-wise). -
set
Description copied from class:Matrix4d
Sets the values of the matrix by the given double array. The order parameter defines how the values in the given array are arranged (either column or row-wise). -
set
Description copied from class:Matrix4d
Sets a specific value in the matrix by row and column index -
transpose
Description copied from class:Matrix4d
Transposes this matrix. -
transpose
-
add
Description copied from class:Matrix4d
Adds a matrix to this matrix. -
add
-
subtract
Description copied from class:Matrix4d
Subtracts a matrix from this matrix. -
subtract
-
multiply
-