Module com.marginallyclever.ro3
Class MoveUtils
java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttool.move.MoveUtils
Convenience methods for the rotate and translate viewporttools.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javax.vecmath.Matrix4dgetLastItemSelectedMatrix(SelectedItems selectedItems) Returns the last selected item's world pose, or null if no items are selected.static javax.vecmath.Matrix4dgetPivotMatrix(FrameOfReference frameOfReference, SelectedItems selectedItems, Camera camera) Get the pivot matrix of the selected items.static javax.vecmath.Point3dgetPointOnPlaneFromCursor(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.static booleanlistContainsAPose(List<Node> list) static voidupdateUndoState(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) 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
-
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- theFrameOfReferenceto use.selectedItems- the list of selected itemscamera- the active camera- Returns:
- the pivot matrix of the selected items, in world space. If no items are selected, returns the identity matrix.
-
listContainsAPose
-