Interface Transform
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescription"Adds" another transform to this one.static Transformstatic Transformstatic Transformdoublepitch()Gets the pitch component of this transform rotation.position()Gets the coordinates of this transform.doubleroll()Gets the roll component of this transform rotation.rotate(Quaterniond rotation) Adds a rotation to this transform.Adds a rotation to this transform.rotation()Gets the rotation of this transform, as aVector3d.Returns the rotation as a quaternion.scale()Gets the scale of the transform for each axis."Adds" a scale to this transform.toMatrix()Returns a matrix representation of this transform.Adds a translation to this transform.withPosition(Vector3d position) Creates a copy of this transform while setting the position of the new one.withRotation(Quaterniond rotation) Creates a copy of this transform and sets the rotation.withRotation(Vector3d rotation) Creates a copy of this transform and sets the rotation as a quaternion.Creates a copy of this transform and sets the scale for each axis.doubleyaw()Gets the yaw component of this transform rotation.
- 
Method Details- 
of
- 
of
- 
of
- 
positionVector3d position()Gets the coordinates of this transform.- Returns:
- The coordinates
 
- 
withPositionCreates a copy of this transform while setting the position of the new one.- Parameters:
- position- The position
- Returns:
- A new transform
 
- 
rotationVector3d rotation()Gets the rotation of this transform, as aVector3d.The format of the rotation is represented by: - x -> pitch
- y -> yaw
- z -> roll
 - Returns:
- The rotation vector
 
- 
withRotationCreates a copy of this transform and sets the rotation as a quaternion.Quaternions are objectively better than the Euler angles preferred by Minecraft. This is for compatibility with the flow-math library. - Parameters:
- rotation- The new rotation
- Returns:
- A new transform
 
- 
withRotationCreates a copy of this transform and sets the rotation.The format of the rotation is represented by: - x -> pitch
- y -> yaw
- z -> roll
 - Parameters:
- rotation- The new rotation
- Returns:
- A new transform
 
- 
rotationAsQuaternionQuaterniond rotationAsQuaternion()Returns the rotation as a quaternion.Quaternions are objectively better than the Euler angles preferred by Minecraft. This is for compatibility with the flow-math library. - Returns:
- The rotation
 
- 
pitchdouble pitch()Gets the pitch component of this transform rotation.- Returns:
- The pitch
 
- 
yawdouble yaw()Gets the yaw component of this transform rotation.- Returns:
- The yaw
 
- 
rolldouble roll()Gets the roll component of this transform rotation.- Returns:
- The roll
 
- 
scaleVector3d scale()Gets the scale of the transform for each axis.- Returns:
- The scale
 
- 
withScaleCreates a copy of this transform and sets the scale for each axis.- Parameters:
- scale- The scale
- Returns:
- A new transform
 
- 
add"Adds" another transform to this one. This is equivalent to adding the translation, rotation and scale individually.Returns the results as a new copy. - Parameters:
- other- The transform to add
- Returns:
- A new transform
 
- 
translateAdds a translation to this transform.Returns the results as a new copy. - Parameters:
- translation- The translation to add
- Returns:
- A new transform
 
- 
rotateAdds a rotation to this transform. Returns the results as a new copy.- Parameters:
- rotation- The rotation to add
- Returns:
- A new transform
 
- 
rotateAdds a rotation to this transform.Quaternions are objectively better than the Euler angles preferred by Minecraft. This is the preferred method when dealing with rotation additions. This is for compatibility with the flow-math library. Returns the results as a new copy. - Parameters:
- rotation- The rotation to add
- Returns:
- A new transform
 
- 
scale"Adds" a scale to this transform. Scales are multiplicative, so this actually multiplies the current scale.Returns the results as a new copy. - Parameters:
- scale- The scale to add
- Returns:
- A new transform
 
- 
toMatrixMatrix4d toMatrix()Returns a matrix representation of this transform.This includes the position, rotation and scale. To apply the transform to a vector, use the following: Vector3d original = ...;<br /> Transform transform = ...;<br /><br /> Vector3d transformed = transform.toMatrix().transform(original.toVector4(1)).toVector3();<br />}This converts the original 3D vector to 4D by appending 1 as the w coordinate, applies the transformation, then converts it back to 3D by dropping the w coordinate. Using a 4D matrix and a w coordinate with value 1 is what allows for the position to be included in the transformation applied by the matrix. - Returns:
- The transform as a matrix
 
 
-