Viewport (interface)¶
The interface ‘Viewport‘ is implemented in case we require different kinds of Viewport objects to support the same interface. Currently only InlineViewport implements the Viewport interface.
Functions¶
Ray | calcRayFromScreenPos ? ( in Vec2 pos ) |
deregisterCallback ! ( in ViewportDrawPhase phase, in ViewportCallback callback ) | |
Camera | getCamera ? () |
Vec2 | getDimensions ? () |
String | getName ? () |
Mat44 | getProjectionMat ? () |
Mat44 | getViewMat ? () |
Boolean | invokeCallback ! ( in ViewportDrawPhase phase, io DrawContext context ) |
registerCallback ! ( in ViewportDrawPhase phase, in ViewportCallback callback ) | |
setCamera ! ( in Camera camera ) | |
setName ! ( in String name ) |
Functions in detail¶
Ray Viewport.calcRayFromScreenPos? ( in Vec2 pos )
compute a ray into the scene based on a mouse coordinate
Viewport.deregisterCallback! ( in ViewportDrawPhase phase, in ViewportCallback callback )
deregisters a callback for the viewport
returns the camera of this viewport
Vec2 Viewport.getDimensions? ()
returns the dimensions of the viewport in pixels.
returns the name of the viewport
Mat44 Viewport.getProjectionMat? ()
returns the camera’s projection matrix
returns the camera’s view matrix
Boolean Viewport.invokeCallback! ( in ViewportDrawPhase phase, io DrawContext context )
performs a registered callback, returns true if default behaviour should be skipped
Viewport.registerCallback! ( in ViewportDrawPhase phase, in ViewportCallback callback )
registers a callback for the viewport
Viewport.setCamera! ( in Camera camera )
sets the camera on this viewport
Viewport.setName! ( in String name )
sets the name of the viewport