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.voidrelease()Called when the drag session is done and the Draggable can clean up any of its internal stuff.voidsetLocation(float x, float y) Called by the drag session to update the position of the draggable in camera/viewport space.voidupdateDragStatus(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:DraggableCalled by the drag session to update the position of the draggable in camera/viewport space.- Specified by:
setLocationin interfaceDraggable
-
getLocation
Description copied from interface:DraggableReturns the current location of the draggable in camera/viewport space.- Specified by:
getLocationin interfaceDraggable
-
updateDragStatus
Description copied from interface:DraggableCalled by the drag session to update the drag status.- Specified by:
updateDragStatusin interfaceDraggable
-
release
public void release()Description copied from interface:DraggableCalled when the drag session is done and the Draggable can clean up any of its internal stuff.
-