Class TeaRenderer
java.lang.Object
nl.colorize.multimedialib.renderer.teavm.TeaRenderer
- All Implemented Interfaces:
Renderer,SceneContext
Renderer based on TeaVM that is transpiled to
JavaScript and runs in the browser. Rendering graphics can switch between
different frameworks, the requested renderer can be indicated during the
build or at runtime using a URL parameter.
-
Constructor Summary
ConstructorsConstructorDescriptionTeaRenderer(TeaGraphics graphics) Initializes the TeaVM renderer using the specified graphics library. -
Method Summary
Modifier and TypeMethodDescriptionbooleancastPickRay(Point2D canvasPosition, Box area) Casts a pick ray from the specified 2D canvas position, and returns true if the pick ray intersects with the specified 3D world coordinates.createMesh(Shape3D shape, ColorRGB color) Programmatically creates a 3D polygon mesh with a solid color, based on the specified shape.getInput()Returns the display name for the underlying renderer.getStage()booleanisSupported(GraphicsMode graphicsMode) Returns the 3D world coordinates that correspond to the specified 2D canvas coordinates, based on the current camera position.voidstart(RenderConfig config, Scene initialScene) Starts this renderer based on the specified configuration.voidtakeScreenshot(File screenshotFile) Captures a screenshot of the renderer's current graphics and then exports the screenshot to a PNG file.voidTerminates the renderer, which will end the animation loop and quit the application.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.colorize.multimedialib.scene.SceneContext
attach, attach, attach, attachGlobal, changeScene, createMesh, getCanvas, getDebugInformation, getFrameStats
-
Constructor Details
-
TeaRenderer
Initializes the TeaVM renderer using the specified graphics library. Applications should use one of the factory methods rather than using this constructor directly.
-
-
Method Details
-
start
Description copied from interface:RendererStarts this renderer based on the specified configuration. The renderer will initially display the specified scene.This method can be called from any thread. The renderer will run in its own thread, which is started by calling this method. All callback methods will be called from the renderer thread.
-
terminate
public void terminate()Description copied from interface:SceneContextTerminates the renderer, which will end the animation loop and quit the application.- Specified by:
terminatein interfaceSceneContext
-
createMesh
Description copied from interface:SceneContextProgrammatically creates a 3D polygon mesh with a solid color, based on the specified shape.- Specified by:
createMeshin interfaceSceneContext
-
project
Description copied from interface:SceneContextReturns the 3D world coordinates that correspond to the specified 2D canvas coordinates, based on the current camera position.- Specified by:
projectin interfaceSceneContext
-
castPickRay
Description copied from interface:SceneContextCasts a pick ray from the specified 2D canvas position, and returns true if the pick ray intersects with the specified 3D world coordinates.- Specified by:
castPickRayin interfaceSceneContext
-
takeScreenshot
Description copied from interface:SceneContextCaptures a screenshot of the renderer's current graphics and then exports the screenshot to a PNG file.- Specified by:
takeScreenshotin interfaceSceneContext
-
getRendererName
Description copied from interface:SceneContextReturns the display name for the underlying renderer. The display name will not include the word "renderer".- Specified by:
getRendererNamein interfaceSceneContext
-
isSupported
- Specified by:
isSupportedin interfaceRenderer
-
getConfig
- Specified by:
getConfigin interfaceSceneContext
-
getGraphics
-
getInput
- Specified by:
getInputin interfaceSceneContext
-
getMediaLoader
- Specified by:
getMediaLoaderin interfaceSceneContext
-
getNetwork
- Specified by:
getNetworkin interfaceSceneContext
-
getSceneManager
- Specified by:
getSceneManagerin interfaceSceneContext
-
getStage
- Specified by:
getStagein interfaceSceneContext
-