Class QTranslateMouseOwner
java.lang.Object
java.awt.event.MouseAdapter
com.j3d.engine.interact.input.mouse.MouseOwner
com.j3d.engine.interact.cmd.commands.transform.qtrans.QTranslateMouseOwner
- All Implemented Interfaces:
EventEmitterInterface, MouseListener, MouseMotionListener, MouseWheelListener, EventListener
A
MouseOwner responsible for handling "quick translate" functionality.
This class allows for displacing a group of selected GPoints by a mouse movement delta,
projecting the 2D mouse movement onto a 3D plane for intuitive translation.
It calculates the center of the selected points, establishes a projection plane based on the camera's view, and translates the points in 3D space according to the mouse's 2D movement.
- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Vector3(package private) AxisPlane(package private) Vector3(package private) PointReferenceConstraintCheckerFields inherited from class MouseOwner
registered -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Vector3voidclear()Resets the state of theMouseOwner.physicalMouseto its default (0,0) position.mouseLoc()voidvoidusing(ArrayList<GPoint> pointsToTransform, PointReferenceConstraintChecker pointReferenceConstraintChecker) Methods inherited from class MouseOwner
attachListener, broadcast, detachAll, detachListener, getMouseLoc, getMouseLocFromPhysical, getPhysicalMouse, getSelectionMouseLoc, isAttached, isNotOwner, mouseDragged, mouseDraggedUsingClickDelay, mouseReleased, requestOwnership, sendMouseToCentre, setOldPoint, wrapMethods inherited from class MouseAdapter
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseWheelMoved
-
Field Details
-
pointsToTransform
-
pointReferenceConstraintChecker
PointReferenceConstraintChecker pointReferenceConstraintChecker -
cachedPlane
AxisPlane cachedPlane -
cachedCentre
Vector3 cachedCentre -
mouseLoc
Vector3 mouseLoc
-
-
Constructor Details
-
QTranslateMouseOwner
public QTranslateMouseOwner()
-
-
Method Details
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classMouseOwner
-
calculateCentre
-
clear
public void clear()Description copied from class:MouseOwnerResets the state of theMouseOwner.physicalMouseto its default (0,0) position.- Overrides:
clearin classMouseOwner
-
using
public void using(ArrayList<GPoint> pointsToTransform, PointReferenceConstraintChecker pointReferenceConstraintChecker) -
mouseLoc
-