Class SceneRenderer
java.lang.Object
com.j3d.engine.scene.draw.SceneRenderer
SceneRenderer is a class which has the sole responsibility of referencing a single
SortMethod
and hence drawing every single Pure wrapped in a RenderState
which is provided to it.
The "methods" which in reality are just plain ArrayList with special sorting done when things are
added. Examples include:
CamDistSortsorts by Euclidean distance to the cameraCamDepthSortsorts by camera's depth valueDDUUIDSortattempts to sort by Distance, then Depth, and finally falls back to UUID
- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SortMethodA list used for sortingRenderStateobjects based on whichever method SceneRenderer uses. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the SceneRenderer queue.voiddraw(Graphics2D g) Draws all the Render State that have been sorted within the queue.voidregister(RenderState<?, ?> renderState) Registers aRenderStatewith SceneRenderer.voidsetSortMethod(PureSortMethod method) Sets the sort method for SceneRenderer.
-
Field Details
-
queue
A list used for sortingRenderStateobjects based on whichever method SceneRenderer uses. The list is cleared after each render cycle.
-
-
Constructor Details
-
SceneRenderer
public SceneRenderer()
-
-
Method Details
-
setSortMethod
Sets the sort method for SceneRenderer.- Parameters:
method- The PureSortMethod to set.
-
register
Registers aRenderStatewith SceneRenderer.- Parameters:
renderState- The render state to register.
-
clearQueue
public void clearQueue()Clears the SceneRenderer queue. -
draw
Draws all the Render State that have been sorted within the queue.- Parameters:
g- The Graphics2D context.- See Also:
-