Package org.joml
Class Matrix3dStack
- java.lang.Object
-
- org.joml.Matrix3d
-
- org.joml.Matrix3dStack
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,Matrix3dc
public class Matrix3dStack extends Matrix3d
A stack of manyMatrix3d
instances. This resembles the matrix stack known from legacy OpenGL.This
Matrix3dStack
class inherits fromMatrix3d
, so the current/top matrix is always theMatrix3dStack
/Matrix3d
itself. This affects all operations inMatrix3d
that take anotherMatrix3d
as parameter. If aMatrix3dStack
is used as argument to those methods, the effective argument will always be the current matrix of the matrix stack.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Matrix3dStack()
Do not invoke manually! Only meant for serialization.Matrix3dStack(int stackSize)
Create a newMatrix3dStack
of the given size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matrix3dStack
clear()
Set the stack pointer to zero and set the current/bottom matrix toidentity
.java.lang.Object
clone()
boolean
equals(java.lang.Object obj)
int
hashCode()
Matrix3dStack
popMatrix()
Decrement the stack pointer by one.Matrix3dStack
pushMatrix()
Increment the stack pointer by one and set the values of the new current matrix to the one directly below it.void
readExternal(java.io.ObjectInput in)
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.joml.Matrix3d
add, add, cofactor, cofactor, determinant, equals, get, get, get, get, get, get, get, get, get, get, get, get, getColumn, getEulerAnglesXYZ, getEulerAnglesZYX, getFloats, getFloats, getNormalizedRotation, getNormalizedRotation, getRotation, getRow, getRowColumn, getScale, getToAddress, getTransposed, getTransposed, getTransposed, getTransposed, getTransposed, getTransposed, getTransposedFloats, getTransposedFloats, getUnnormalizedRotation, getUnnormalizedRotation, identity, invert, invert, isFinite, lerp, lerp, lookAlong, lookAlong, lookAlong, lookAlong, m00, m00, m01, m01, m02, m02, m10, m10, m11, m11, m12, m12, m20, m20, m21, m21, m22, m22, mapnXnYnZ, mapnXnYnZ, mapnXnYZ, mapnXnYZ, mapnXnZnY, mapnXnZnY, mapnXnZY, mapnXnZY, mapnXYnZ, mapnXYnZ, mapnXZnY, mapnXZnY, mapnXZY, mapnXZY, mapnYnXnZ, mapnYnXnZ, mapnYnXZ, mapnYnXZ, mapnYnZnX, mapnYnZnX, mapnYnZX, mapnYnZX, mapnYXnZ, mapnYXnZ, mapnYXZ, mapnYXZ, mapnYZnX, mapnYZnX, mapnYZX, mapnYZX, mapnZnXnY, mapnZnXnY, mapnZnXY, mapnZnXY, mapnZnYnX, mapnZnYnX, mapnZnYX, mapnZnYX, mapnZXnY, mapnZXnY, mapnZXY, mapnZXY, mapnZYnX, mapnZYnX, mapnZYX, mapnZYX, mapXnYnZ, mapXnYnZ, mapXnZnY, mapXnZnY, mapXnZY, mapXnZY, mapXZnY, mapXZnY, mapXZY, mapXZY, mapYnXnZ, mapYnXnZ, mapYnXZ, mapYnXZ, mapYnZnX, mapYnZnX, mapYnZX, mapYnZX, mapYXnZ, mapYXnZ, mapYXZ, mapYXZ, mapYZnX, mapYZnX, mapYZX, mapYZX, mapZnXnY, mapZnXnY, mapZnXY, mapZnXY, mapZnYnX, mapZnYnX, mapZnYX, mapZnYX, mapZXnY, mapZXnY, mapZXY, mapZXY, mapZYnX, mapZYnX, mapZYX, mapZYX, mul, mul, mul, mul, mulComponentWise, mulComponentWise, mulLocal, mulLocal, negateX, negateX, negateY, negateY, negateZ, negateZ, normal, normal, normalizedPositiveX, normalizedPositiveY, normalizedPositiveZ, obliqueZ, obliqueZ, positiveX, positiveY, positiveZ, quadraticFormProduct, quadraticFormProduct, quadraticFormProduct, reflect, reflect, reflect, reflect, reflect, reflect, reflection, reflection, reflection, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotateLocal, rotateLocal, rotateLocal, rotateLocal, rotateLocal, rotateLocal, rotateLocalX, rotateLocalX, rotateLocalY, rotateLocalY, rotateLocalZ, rotateLocalZ, rotateTowards, rotateTowards, rotateTowards, rotateTowards, rotateX, rotateX, rotateXYZ, rotateXYZ, rotateY, rotateY, rotateYXZ, rotateYXZ, rotateYXZ, rotateZ, rotateZ, rotateZYX, rotateZYX, rotation, rotation, rotation, rotation, rotation, rotation, rotation, rotationTowards, rotationTowards, rotationX, rotationXYZ, rotationY, rotationYXZ, rotationZ, rotationZYX, scale, scale, scale, scale, scale, scale, scaleLocal, scaleLocal, scaling, scaling, scaling, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setColumn, setColumn, setFloats, setFloats, setFromAddress, setLookAlong, setLookAlong, setRow, setRow, setRowColumn, setSkewSymmetric, setTransposed, setTransposed, sub, sub, swap, toString, toString, transform, transform, transform, transform, transform, transformTranspose, transformTranspose, transformTranspose, transpose, transpose, zero
-
-
-
-
Constructor Detail
-
Matrix3dStack
public Matrix3dStack(int stackSize)
Create a newMatrix3dStack
of the given size.Initially the stack pointer is at zero and the current matrix is set to identity.
- Parameters:
stackSize
- the size of the stack. This must be at least 1, in which case theMatrix3dStack
simply only consists ofthis
Matrix3d
-
Matrix3dStack
public Matrix3dStack()
Do not invoke manually! Only meant for serialization.Invoking this constructor from client code will result in an inconsistent state of the created
Matrix3dStack
instance.
-
-
Method Detail
-
clear
public Matrix3dStack clear()
Set the stack pointer to zero and set the current/bottom matrix toidentity
.- Returns:
- this
-
pushMatrix
public Matrix3dStack pushMatrix()
Increment the stack pointer by one and set the values of the new current matrix to the one directly below it.- Returns:
- this
-
popMatrix
public Matrix3dStack popMatrix()
Decrement the stack pointer by one.This will effectively dispose of the current matrix.
- Returns:
- this
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classMatrix3d
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classMatrix3d
- Throws:
java.io.IOException
-
-