Package heronarts.glx.ui
Class UI3dContext
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI3dContext
- All Implemented Interfaces:
UILayer,UITabFocus,LXLoopTask,LXSerializable
- Direct Known Subclasses:
UIPreviewWindow
This is a layer that contains a 3d scene with a camera. Mouse movements
control the camera, and the scene can contain components.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumclassstatic enumMode of mouse interactionstatic interfacestatic enumNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BooleanParameterWhether to animate between camera positionsfinal BooleanParameterfinal BoundedParameterfinal BoundedParameterfinal BoundedParameterfinal BoundedParameterAnimation timefinal UI3dContext.Camerafinal MutableParameterAcceleration used to change camera radius (zoom)final MutableParameterMax velocity used to damp changes to radius (zoom)final UI3dContext.Camera[]final BoundedParameterDepth of perspective field, exponential factor of radius by exp(10, Depth)Mouse interaction modestatic final intfinal BoundedParameterPerspective of viewProjection modefinal MutableParameterAcceleration used to change rotation (theta/phi)final MutableParameterMax velocity used to damp changes to rotation (theta/phi)protected final View -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal UI3dContextaddComponent(UI3dComponent component) Adds a component to the layerfinal voidclearCamera(int index) Clears the camera stored at the given indexvoiddispose()final voidorg.joml.Vector3fGets the center position of the sceneorg.joml.Vector3fgetEye()Gets the latest computed eye positionfloatorg.joml.Matrix4ffloatGets the radius from camera eye to center positionorg.joml.Matrix4ffloatgetWidth()floatgetX()floatgetY()voidload(LX lx, JsonObject object) Restores this instance from a JSON objectprotected voidonKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected voidonMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected voidonMousePressed(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsprotected voidonMouseReleased(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsprotected voidonMouseScroll(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsfinal UI3dContextremoveComponent(UI3dComponent component) Removes a component from the layerfinal voidvoidsave(LX lx, JsonObject object) Serializes this instance into the JSON objectsetCamera(int index) Sets the cue position index of the camerasetCameraAcceleration(float cameraAcceleration) Set's the camera's zoom acceleration, 0 is infinitesetCameraVelocity(float cameraVelocity) Sets the camera's maximum zoom speedsetCenter(float x, float y, float z) Sets the center of the scene, only respected in ZOOM modesetMaxRadius(float maxRadius) Set maximum radiussetMinRadius(float minRadius) Set minimum radiussetPerspective(float perspective) Sets perspective angle of the camera in degreessetPhi(float phi) Set the phi angle of viewingsetPosition(float x, float y) setRadius(float radius) Set radius of the camerasetRadiusBounds(float minRadius, float maxRadius) Sets bounds on the radiussetRect(float x, float y, float width, float height) setRotationAcceleration(float rotationAcceleration) Set's the camera's rotational acceleration, 0 is infinitesetRotationVelocity(float rotationVelocity) Sets the camera's maximum rotation speedsetSize(float width, float height) setTheta(double theta) Set the theta angle of viewingMethods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, addLoopTask, blur, bringToFront, contains, focus, getDescription, getFocusedChild, getLX, getParent, getUI, hasDirectFocus, hasFocus, isVisible, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, setConsumeMousePress, setDebugId, setDescription, setMouseCursor, setVisible, toggleVisible, toStringMethods inherited from class heronarts.glx.ui.UIEventHandler
onGamepadAxisChanged, onGamepadButtonPressed, onGamepadButtonReleased, onKeyReleased, onMouseMoved, onMouseOut, onMouseOver
-
Field Details
-
NUM_CAMERA_POSITIONS
public static final int NUM_CAMERA_POSITIONS- See Also:
-
mouseMode
Mouse interaction mode -
projection
Projection mode -
perspective
Perspective of view -
depth
Depth of perspective field, exponential factor of radius by exp(10, Depth) -
animation
Whether to animate between camera positions -
animationTime
Animation time -
animationEase
-
animationEaseShape
-
animationClampY
-
animationMinY
-
animationMaxY
-
cameraVelocity
Max velocity used to damp changes to radius (zoom) -
cameraAcceleration
Acceleration used to change camera radius (zoom) -
rotationVelocity
Max velocity used to damp changes to rotation (theta/phi) -
rotationAcceleration
Acceleration used to change rotation (theta/phi) -
cue
-
focusCamera
-
camera
-
autopilot
-
animationProgress
-
view
-
-
Constructor Details
-
UI3dContext
-
-
Method Details
-
addMovementListener
-
removeMovementListener
-
dispose
public void dispose() -
getX
public float getX() -
getY
public float getY() -
getWidth
public float getWidth() -
getHeight
public float getHeight() -
setPosition
-
setSize
-
setRect
-
addComponent
Adds a component to the layer- Parameters:
component- Component- Returns:
- this
-
removeComponent
Removes a component from the layer- Parameters:
component- Component- Returns:
- this
-
clearCamera
Clears the camera stored at the given index- Parameters:
index- Camera index to clear- Returns:
- this
-
setCamera
Sets the cue position index of the camera- Parameters:
index- Camera index- Returns:
- this
-
setRadius
Set radius of the camera- Parameters:
radius- Camera radius- Returns:
- this
-
setPerspective
Sets perspective angle of the camera in degrees- Parameters:
perspective- Angle in degrees- Returns:
- this
-
setCameraVelocity
Sets the camera's maximum zoom speed- Parameters:
cameraVelocity- Max units/per second radius may change by- Returns:
- this
-
setCameraAcceleration
Set's the camera's zoom acceleration, 0 is infinite- Parameters:
cameraAcceleration- Acceleration for camera- Returns:
- this
-
setRotationVelocity
Sets the camera's maximum rotation speed- Parameters:
rotationVelocity- Max radians/per second viewing angle may change by- Returns:
- this
-
setRotationAcceleration
Set's the camera's rotational acceleration, 0 is infinite- Parameters:
rotationAcceleration- Acceleration of camera rotation- Returns:
- this
-
setTheta
Set the theta angle of viewing- Parameters:
theta- Angle about the y axis- Returns:
- this
-
setPhi
Set the phi angle of viewing- Parameters:
phi- Angle about the y axis- Returns:
- this
-
setRadiusBounds
Sets bounds on the radius- Parameters:
minRadius- Minimum camera radiusmaxRadius- Maximum camera radius- Returns:
- this
-
setMinRadius
Set minimum radius- Parameters:
minRadius- Minimum camera radius- Returns:
- this
-
setMaxRadius
Set maximum radius- Parameters:
maxRadius- Maximum camera radius- Returns:
- this
-
setCenter
Sets the center of the scene, only respected in ZOOM mode- Parameters:
x- X-coordinatey- Y-coordinatez- Z-coordinate- Returns:
- this
-
getCenter
public org.joml.Vector3f getCenter()Gets the center position of the scene- Returns:
- center of scene
-
getEye
public org.joml.Vector3f getEye()Gets the latest computed eye position- Returns:
- eye position
-
getRadius
public float getRadius()Gets the radius from camera eye to center position- Returns:
- Camera radius
-
draw
-
getViewMatrix
public org.joml.Matrix4f getViewMatrix() -
getProjectionMatrix
public org.joml.Matrix4f getProjectionMatrix() -
onMousePressed
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMousePressedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-
onMouseDragged
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseDraggedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinatedx- movement in xdy- movement in y
-
onMouseReleased
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseReleasedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-
onMouseScroll
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseScrollin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinatedx- Amount of horizontal scrolldy- Amount of vertical scroll
-
onKeyPressed
Description copied from class:UIEventHandlerSubclasses override to receive key events- Overrides:
onKeyPressedin classUIEventHandler- Parameters:
keyEvent- Key eventkeyChar- Key characterkeyCode- Key code value
-
save
Description copied from interface:LXSerializableSerializes this instance into the JSON object- Specified by:
savein interfaceLXSerializable- Parameters:
lx- LX instanceobject- Object to serialize into
-
load
Description copied from interface:LXSerializableRestores this instance from a JSON object- Specified by:
loadin interfaceLXSerializable- Parameters:
lx- LX instanceobject- Object to deserialize
-