Class MoveUtils
java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttools.move.MoveUtils
Convenience methods for the rotate and translate viewporttools.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic javax.vecmath.Matrix4d
getLastItemSelectedMatrix
(SelectedItems selectedItems) Returns the last selected item's world pose, or null if no items are selected.static javax.vecmath.Matrix4d
getPivotMatrix
(FrameOfReference frameOfReference, SelectedItems selectedItems) Get the pivot matrix of the selected items.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.static void
updateUndoState
(SelectedItems selectedItems)
-
Constructor Details
-
MoveUtils
public MoveUtils()
-
-
Method Details
-
getLastItemSelectedMatrix
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
-
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
- theFrameOfReference
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.
-