Package com.simsilica.lemur.dnd
Class DefaultDraggable
java.lang.Object
com.simsilica.lemur.dnd.DefaultDraggable
- All Implemented Interfaces:
Draggable
A default draggable implementation that will simply move a spatial
in a particular plane based on a starting location and an x/y delta.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a DefaultDraggable that will set the location of the spatial in 3D space relative to the specified origin.DefaultDraggable
(ViewPort view, Spatial spatial, Vector2f start) Creates a 3D draggable that will move the specified spatial relative to its current translation in a plane relative to the current viewport camera. -
Method Summary
Modifier and TypeMethodDescriptionReturns the current location of the draggable in camera/viewport space.void
release()
Called when the drag session is done and the Draggable can clean up any of its internal stuff.void
setLocation
(float x, float y) Called by the drag session to update the position of the draggable in camera/viewport space.void
updateDragStatus
(DragStatus status) Called by the drag session to update the drag status.protected void
-
Constructor Details
-
DefaultDraggable
public DefaultDraggable(Vector2f start, Spatial spatial, Vector3f origin, Vector3f xAxis, Vector3f yAxis) Creates a DefaultDraggable that will set the location of the spatial in 3D space relative to the specified origin. -
DefaultDraggable
Creates a 3D draggable that will move the specified spatial relative to its current translation in a plane relative to the current viewport camera.
-
-
Method Details
-
getSpatial
-
updateTranslation
protected void updateTranslation() -
setLocation
public void setLocation(float x, float y) Description copied from interface:Draggable
Called by the drag session to update the position of the draggable in camera/viewport space.- Specified by:
setLocation
in interfaceDraggable
-
getLocation
Description copied from interface:Draggable
Returns the current location of the draggable in camera/viewport space.- Specified by:
getLocation
in interfaceDraggable
-
updateDragStatus
Description copied from interface:Draggable
Called by the drag session to update the drag status.- Specified by:
updateDragStatus
in interfaceDraggable
-
release
public void release()Description copied from interface:Draggable
Called when the drag session is done and the Draggable can clean up any of its internal stuff.
-