java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttool.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)
      Cast a ray through the camera's viewport at the given x,y and find the intersection point on the translationPlane.
      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, Camera camera)
      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
      camera - the active camera
      Returns:
      the pivot matrix of the selected items, in world space. If no items are selected, returns the identity matrix.
    • listContainsAPose

      public static boolean listContainsAPose(List<Node> list)