Retrieve the destination canvas
Retrieve the 2D-context attached to the destination canvas
Returns true if this viewport currently has focus and thus receives keyboard events
The rectangle of the canvas area in CSS pixels. Use this to access the canvas width and height, but without incuring browser internal garbage collection.
Adjusted internally by adjustFrames, do not modify.
The rectangle of the canvas area as displayed (considering css). Use this to access canvas clientWidth and clientHeight, but without incuring browser internal garbage collection.
Adjusted automatically on canvas resize, do not modify.
See EventTarget.addEventListener for reference. Works with EventListenerUnified and EventUnified
Optional_options: boolean | AddEventListenerOptionsAdjust the camera parameters to fit the rendering into the render viewport.
Adjust all frames involved in the rendering process from the display area in the client up to the renderer canvas.
Disconnect the resize observer from the canvas to allow garbage collection of the viewport.
See EventTarget.dispatchEvent for reference. Works with with EventUnified
Performs a pick on all ComponentPicks in the branch of this viewport
using a ray from its camera through the client coordinates given in the event.
Dispatches the event to all nodes hit.
If PICK.CAMERA was chosen as the method to pick, a pick property gets added to the event,
which holds the detailed information, but is overwritten for each node.
Draw this viewport displaying its branch. By default, the transforms in the branch are recalculated first.
Pass false if calculation was already done for this frame
Retrieve the branch this viewport renders
Retrieve the size of the destination canvas as a rectangle, x and y are always 0.
Use rectCanvas instead.
Retrieve the client rectangle the canvas is displayed and fit in, x and y are always 0.
Use rectClient instead.
Returns all the gizmos in the branch of this viewport that are active, filtered by gizmosFilter
Connects the viewport to the given canvas to render the given branch to using the given camera-component, and names the viewport as given.
Adjusts all frames and the camera to fit the current size of the canvas. Prepares the branch for rendering.
Prepares all nodes in the branch for rendering by updating their world transforms and supplying the gpu renderbuffers with the neccessary node and component data to draw a frame.
See EventTarget.removeEventListener for reference. Works with EventListenerUnified and EventUnified
Optional_options: boolean | AddEventListenerOptions
Controls the rendering of a branch, using the given ComponentCamera, and the propagation of the rendered image from the offscreen renderbuffer to the target canvas through a series of Framing objects. The stages involved are in order of rendering Render.viewport -> Viewport.source -> Viewport.destination -> DOM-Canvas -> Client(CSS)
Authors
Jascha Karagöl, HFU, 2019 | Jirka Dell'Oro-Friedl, HFU, 2019-2022 | Jonas Plotzky, HFU, 2023
Link
https://github.com/hs-furtwangen/FUDGE/wiki/Viewport