Module com.marginallyclever.ro3
Class TranslateToolOneAxis
java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttool.move.TranslateToolOneAxis
- All Implemented Interfaces:
ViewportTool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(SelectedItems list) This method is called when the tool is activated.voidForce cancel the tool.voidThis method is called when the tool is deactivated.voidgetComponents(List<JPanel> list) Build a Swing Component that represents this Tool.javax.vecmath.Point3dReturns the point on the tool clicked by the user.voidhandleMouseEvent(MouseEvent event) Handles mouse input events for the tool.booleanisInUse()Returns true if the tool is active (was clicked correctly and could be dragged)voidmouseDragged(MouseEvent event) voidmouseMoved(MouseEvent event) voidmousePressed(MouseEvent event) voidmouseReleased(MouseEvent event) voidrender(com.jogamp.opengl.GL3 gl, ShaderProgram shaderProgram) Renders any tool-specific visuals to the 3D scene.voidSets the frame of reference for the tool.voidsetPivotMatrix(javax.vecmath.Matrix4d pivot) voidsetTexture(TextureWithMetadata texture, Rectangle2D textureBounds) voidsetViewport(Viewport viewport) voidupdate(double deltaTime) Updates the tool's internal state, if necessary.
-
Constructor Details
-
TranslateToolOneAxis
-
-
Method Details
-
activate
Description copied from interface:ViewportToolThis method is called when the tool is activated. It receives a list containing the selected nodes and their initial world poses.- Specified by:
activatein interfaceViewportTool- Parameters:
list- The selected items to be manipulated by the tool.
-
setPivotMatrix
public void setPivotMatrix(javax.vecmath.Matrix4d pivot) -
deactivate
public void deactivate()Description copied from interface:ViewportToolThis method is called when the tool is deactivated. It allows the tool to perform any necessary cleanup actions before another tool takes over.- Specified by:
deactivatein interfaceViewportTool
-
handleMouseEvent
Description copied from interface:ViewportToolHandles mouse input events for the tool.- Specified by:
handleMouseEventin interfaceViewportTool- Parameters:
event- The MouseEvent object representing the input event.
-
mouseMoved
- Specified by:
mouseMovedin interfaceViewportTool
-
mousePressed
- Specified by:
mousePressedin interfaceViewportTool
-
mouseDragged
- Specified by:
mouseDraggedin interfaceViewportTool
-
mouseReleased
- Specified by:
mouseReleasedin interfaceViewportTool
-
setFrameOfReference
Sets the frame of reference for the tool.- Specified by:
setFrameOfReferencein interfaceViewportTool- Parameters:
index- 0 for world, 1 for local, 2 for camera.
-
update
public void update(double deltaTime) Description copied from interface:ViewportToolUpdates the tool's internal state, if necessary.- Specified by:
updatein interfaceViewportTool- Parameters:
deltaTime- Time elapsed since the last update.
-
render
Description copied from interface:ViewportToolRenders any tool-specific visuals to the 3D scene.- Specified by:
renderin interfaceViewportTool- Parameters:
gl- The OpenGL context.
-
setViewport
- Specified by:
setViewportin interfaceViewportTool
-
isInUse
public boolean isInUse()Description copied from interface:ViewportToolReturns true if the tool is active (was clicked correctly and could be dragged)- Specified by:
isInUsein interfaceViewportTool- Returns:
- true if the tool is active (was clicked correctly and could be dragged)
-
cancelUse
public void cancelUse()Description copied from interface:ViewportToolForce cancel the tool. useful if two viewporttools are activated at once.- Specified by:
cancelUsein interfaceViewportTool
-
getStartPoint
public javax.vecmath.Point3d getStartPoint()Description copied from interface:ViewportToolReturns the point on the tool clicked by the user. This is used to determine which tool is closer to the user.- Specified by:
getStartPointin interfaceViewportTool- Returns:
- the point on the tool clicked by the user.
-
setTexture
-
getComponents
Description copied from interface:ViewportToolBuild a Swing Component that represents this Tool.- Specified by:
getComponentsin interfaceViewportTool- Parameters:
list- the list to add components to.
-