Class TranslateToolOneAxis
java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttools.move.TranslateToolOneAxis
- All Implemented Interfaces:
ViewportTool
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called when the tool is activated.void
Force cancel the tool.void
This method is called when the tool is deactivated.void
dispose
(com.jogamp.opengl.GL3 gl3) This is called when the OpenGL context is destroyed.javax.vecmath.Point3d
Returns the point on the tool clicked by the user.void
handleMouseEvent
(MouseEvent event) Handles mouse input events for the tool.void
init
(com.jogamp.opengl.GL3 gl3) This is called when the OpenGL context is created.boolean
isInUse()
Returns true if the tool is active (was clicked correctly and could be dragged)void
mouseDragged
(MouseEvent event) void
mouseMoved
(MouseEvent event) void
mousePressed
(MouseEvent event) void
mouseReleased
(MouseEvent event) void
render
(com.jogamp.opengl.GL3 gl, ShaderProgram shaderProgram) Renders any tool-specific visuals to the 3D scene.void
Sets the frame of reference for the tool.void
setPivotMatrix
(javax.vecmath.Matrix4d pivot) void
setViewport
(Viewport viewport) void
update
(double deltaTime) Updates the tool's internal state, if necessary.
-
Constructor Details
-
TranslateToolOneAxis
-
-
Method Details
-
activate
Description copied from interface:ViewportTool
This method is called when the tool is activated. It receives a list containing the selected nodes and their initial world poses.- Specified by:
activate
in 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:ViewportTool
This 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:
deactivate
in interfaceViewportTool
-
handleMouseEvent
Description copied from interface:ViewportTool
Handles mouse input events for the tool.- Specified by:
handleMouseEvent
in interfaceViewportTool
- Parameters:
event
- The MouseEvent object representing the input event.
-
mouseMoved
- Specified by:
mouseMoved
in interfaceViewportTool
-
mousePressed
- Specified by:
mousePressed
in interfaceViewportTool
-
mouseDragged
- Specified by:
mouseDragged
in interfaceViewportTool
-
mouseReleased
- Specified by:
mouseReleased
in interfaceViewportTool
-
setFrameOfReference
Sets the frame of reference for the tool.- Specified by:
setFrameOfReference
in interfaceViewportTool
- Parameters:
index
- 0 for world, 1 for local, 2 for camera.
-
update
public void update(double deltaTime) Description copied from interface:ViewportTool
Updates the tool's internal state, if necessary.- Specified by:
update
in interfaceViewportTool
- Parameters:
deltaTime
- Time elapsed since the last update.
-
render
Description copied from interface:ViewportTool
Renders any tool-specific visuals to the 3D scene.- Specified by:
render
in interfaceViewportTool
- Parameters:
gl
- The OpenGL context.
-
setViewport
- Specified by:
setViewport
in interfaceViewportTool
-
isInUse
public boolean isInUse()Description copied from interface:ViewportTool
Returns true if the tool is active (was clicked correctly and could be dragged)- Specified by:
isInUse
in interfaceViewportTool
- Returns:
- true if the tool is active (was clicked correctly and could be dragged)
-
cancelUse
public void cancelUse()Description copied from interface:ViewportTool
Force cancel the tool. useful if two viewporttools are activated at once.- Specified by:
cancelUse
in interfaceViewportTool
-
getStartPoint
public javax.vecmath.Point3d getStartPoint()Description copied from interface:ViewportTool
Returns the point on the tool clicked by the user. This is used to determine which tool is closer to the user.- Specified by:
getStartPoint
in interfaceViewportTool
- Returns:
- the point on the tool clicked by the user.
-
init
public void init(com.jogamp.opengl.GL3 gl3) Description copied from interface:ViewportTool
This is called when the OpenGL context is created. It should create any resources.- Specified by:
init
in interfaceViewportTool
- Parameters:
gl3
- the OpenGL context.
-
dispose
public void dispose(com.jogamp.opengl.GL3 gl3) Description copied from interface:ViewportTool
This is called when the OpenGL context is destroyed. It should release any resources.- Specified by:
dispose
in interfaceViewportTool
- Parameters:
gl3
- the OpenGL context.
-