Interface Transformation.Builder

All Superinterfaces:
ResettableBuilder<Transformation,Transformation.Builder>
Enclosing interface:
Transformation

public static interface Transformation.Builder extends ResettableBuilder<Transformation,Transformation.Builder>
Creates transformations.

Apart from the origin transformation, all actions will be performed in the order specified in the builder. Thus, a translation then a rotation will not produce the same results as the reverse.

  • Method Details

    • origin

      Specifies the origin for position transformations.

      This is a special transform in that this translation is performed before the rest of the transformations are made. Once all transformations are performed, this transformation is undone. This is especially useful if you are only transforming around a given origin which is not at (0, 0, 0), as other transformations specified in this object will be performed around this origin instead.

      This does not affect Transformation.transformDirection(Vector3d)

      Parameters:
      origin - The origin to transform around
      Returns:
      This builder, for chaining
    • rotate

      Transformation.Builder rotate(Rotation rotation)
      Performs a rotation about the provided Axis around the given origin around the y-axis.
      Parameters:
      rotation - The Rotation to perform
      Returns:
      This builder, for chaining
    • mirror

      Performs a reflection of -1 in the direction of the given Axis, where the plane from which scaling is performed is normal to this axis and contains the origin(Vector3d).

      For example, for a point (1, 2, 3), using this transformation in the direction the x axis where the origin is at (0, 0, 0) will result in a transformation to (-1, 2, 3).

      This action is effectively a scaling of -1 in the axis direction.

      Parameters:
      axis - The axis that represents the direction of scaling
      Returns:
      This builder, for chaining
    • translate

      Transformation.Builder translate(Vector3d translate)
      Performs a simple additive translation of a position Vector3d by this supplied vector.

      This does not affect Transformation.transformDirection(Vector3d)

      Parameters:
      translate - The translation
      Returns:
      This builder, for chaining
    • performRounding

      Transformation.Builder performRounding(boolean round)
      Attempts to round the result to attempt to compensate for machine precision. Defaults to true.
      Parameters:
      round - Whether to perform rounding
      Returns:
      This builder, for chaining
      See Also:
    • build

      Returns:
      A Transformation