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
FieldsModifier and TypeFieldDescriptionstatic final intfinal Point2DCenter of the screen in screen space (pixels).intNumber of frame that is currently being rendered.final Graphics2Dfinal intHeight of the rendering area in pixels.final byte[]Pixels of the rendering area.final intWidth of the rendering area in pixels.final doubleZoom factor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidvoidsetCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor) Called when given object was detected under mouse cursor, while processingmouseEvent.voidsetMouseEvent(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:
trueif view update is needed as a consequence of this mouse event.
-