java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttools.move.MoveUtils

public class MoveUtils extends Object
Convenience methods for the rotate and translate viewporttools.
  • Constructor Details

    • MoveUtils

      public MoveUtils()
  • Method Details

    • getLastItemSelectedMatrix

      public static javax.vecmath.Matrix4d getLastItemSelectedMatrix(SelectedItems selectedItems)
      Returns the last selected item's world pose, or null if no items are selected.
      Parameters:
      selectedItems - the list of selected items
      Returns:
      the last selected item's world pose, or null if no items are selected.
    • getPointOnPlaneFromCursor

      public static javax.vecmath.Point3d getPointOnPlaneFromCursor(Plane translationPlane, Viewport viewport, double x, double y)
      Looks through the camera's viewport and returns the point on the translationPlane, if any.
      Parameters:
      x - the x coordinate of the viewport, in screen coordinates [-1,1]
      y - the y coordinate of the viewport, in screen coordinates [-1,1]
      Returns:
      the point on the translationPlane, or null if no intersection
    • updateUndoState

      public static void updateUndoState(SelectedItems selectedItems)
    • getPivotMatrix

      public static javax.vecmath.Matrix4d getPivotMatrix(FrameOfReference frameOfReference, SelectedItems selectedItems)
      Get the pivot matrix of the selected items. The matrix should be returned in world space.
      Parameters:
      frameOfReference - the FrameOfReference to use.
      selectedItems - the list of selected items
      Returns:
      the pivot matrix of the selected items, in world space. If no items are selected, returns the identity matrix.