Package limn.math
Record Class Transform3D
java.lang.Object
java.lang.Record
limn.math.Transform3D
A translation/rotation/scale transform, the human-friendly way to place a
node in 3D.
toMatrix() composes it into a model matrix (T·R·S).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTransform3D(Vec3 translation, Quat rotation, Vec3 scale) Creates an instance of aTransform3Drecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Transform3DA transform with only a translation: no rotation, unit scale.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.rotation()Returns the value of therotationrecord component.scale()Returns the value of thescalerecord component.toMatrix()The composed matrix, applied scale first, then rotation, then translation.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationrecord component.withRotation(Quat r) A copy with a different rotation.A copy with a different scale.A copy with a different translation.
-
Field Details
-
IDENTITY
-
-
Constructor Details
-
Transform3D
Creates an instance of aTransform3Drecord class.- Parameters:
translation- the value for thetranslationrecord componentrotation- the value for therotationrecord componentscale- the value for thescalerecord component
-
-
Method Details
-
at
A transform with only a translation: no rotation, unit scale. -
withTranslation
A copy with a different translation. -
withRotation
A copy with a different rotation. -
withScale
A copy with a different scale. -
toMatrix
The composed matrix, applied scale first, then rotation, then translation. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
translation
Returns the value of thetranslationrecord component.- Returns:
- the value of the
translationrecord component
-
rotation
Returns the value of therotationrecord component.- Returns:
- the value of the
rotationrecord component
-
scale
Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-