Package eu.svjatoslav.sixth.e3d.gui
Class RenderingContext
java.lang.Object
eu.svjatoslav.sixth.e3d.gui.RenderingContext
Rendering context that contains all the information that is needed to render the scene.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
final Point2D
Center of the screen in screen space (pixels).int
Number of frame that is currently being rendered.final Graphics2D
final int
Height of the rendering area in pixels.final byte[]
Pixels of the rendering area.final int
Width of the rendering area in pixels.final double
Zoom factor. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
void
setCurrentObjectUnderMouseCursor
(MouseInteractionController currentObjectUnderMouseCursor) Called when given object was detected under mouse cursor, while processingmouseEvent
.void
setMouseEvent
(MouseEvent mouseEvent)
-
Field Details
-
bufferedImageType
public static final int bufferedImageType- See Also:
-
graphics
-
pixels
public final byte[] pixelsPixels of the rendering area. Each pixel is represented by 4 bytes: alpha, blue, green, red. -
width
public final int widthWidth of the rendering area in pixels. -
height
public final int heightHeight of the rendering area in pixels. -
centerCoordinate
Center of the screen in screen space (pixels). This is the point where (0,0) coordinate of the world space is rendered. -
zoom
public final double zoomZoom factor. The bigger the value, the more zoomed in the view is. -
frameNumber
public int frameNumberNumber of frame that is currently being rendered. Every frame has its own number.
-
-
Constructor Details
-
RenderingContext
public RenderingContext(int width, int height)
-
-
Method Details
-
prepareForNewFrameRendering
public void prepareForNewFrameRendering() -
getMouseEvent
-
setMouseEvent
-
setCurrentObjectUnderMouseCursor
public void setCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor) Called when given object was detected under mouse cursor, while processingmouseEvent
. Because objects are rendered back to front. The last method caller will set the top-most object, if there are multiple objects under mouse cursor. -
handlePossibleComponentMouseEvent
public boolean handlePossibleComponentMouseEvent()- Returns:
true
if view update is needed as a consequence of this mouse event.
-