Meta_Viewport
Module: Metanodes / Definitions
A Viewport occupies a specified rectangle of a window (range 0 to 1) which renders the 3D scene from the specified eye points looking at the specified screen rectangles.
#include <meta_view.hpp>
Public Types
| Type | Name |
|---|---|
| enum | EyeOverride { EyeOverride_None = -1, EyeOverride_Mono = 0, EyeOverride_Left = 1, EyeOverride_Right = 2 } Values for Idx_EyeOverride. |
| enum | IDX { Idx_Enabled, Idx_Rectangle, Idx_Camera, Idx_ProjectionMode, Idx_Screen_Mono, Idx_Screen_Left, Idx_Screen_Right, Idx_FOV, Idx_ScreenWidth, Idx_ScreenOffset, Idx_HMD, Idx_OrthographicZoom, Idx_EyeOverride, Idx_Mirror } Property index. |
| enum | ProjectionMode { ProjectionMode_PhysicalScreen, ProjectionMode_FOVAndWidth, ProjectionMode_Orthographic } Values for Idx_ProjectionMode. |
Public Types Documentation
enum EyeOverride
| Enumerator | Value | Description |
|---|---|---|
| EyeOverride_None | -1 | No eye override, will draw both left and right as required (Symbols - C: "EyeOverrideNone", Lua: __Viewport_EyeOverrideNone) |
| EyeOverride_Mono | 0 | Drawing is done as mono (Symbols - C: "EyeOverrideMono", Lua: __Viewport_EyeOverrideMono) |
| EyeOverride_Left | 1 | Drawing is done only from the left eye (Symbols - C: "EyeOverrideLeft", Lua: __Viewport_EyeOverrideLeft) |
| EyeOverride_Right | 2 | Drawing is done only from the right eye (Symbols - C: "EyeOverrideRight", Lua: __Viewport_EyeOverrideRight) |
Values for Idx_EyeOverride.
enum IDX
| Enumerator | Value | Description |
|---|---|---|
| Idx_Enabled | bool - When enabled, viewport is drawn to the screen | |
| Idx_Rectangle | vec4f - The viewport bounds, scaled on the screen by the ViewportLayout size. (e.g. layout size 2.0, 1.0, and child viewport width 1.0 will fill half the screen with the viewport) | |
| Idx_Camera | link - The camera from which the scene is rendered | |
| Idx_ProjectionMode | ProjectionMode (int) - The projection mode | |
| Idx_Screen_Mono | link - (for PhysicalScreen mode) Link to the physical screen for rendering mono | |
| Idx_Screen_Left | link - (for PhysicalScreen mode) Link to the physical screen for rendering the left eye | |
| Idx_Screen_Right | link - (for PhysicalScreen mode) Link to the physical screen for rendering the right eye | |
| Idx_FOV | float - (for other modes) The field of view | |
| Idx_ScreenWidth | float - (for other modes) The physical width of the screen being displayed on (for stereo separation calculations) | |
| Idx_ScreenOffset | vec2f - (for other modes) The screen offset | |
| Idx_HMD | bool - (for other modes) Whether the viewport is being used in a HMD, which makes the viewport calculation affect the camera transform directly, rather than skewing the projection for wall-based setups | |
| Idx_OrthographicZoom | float - (for Orthographic mode) The zoom factor | |
| Idx_EyeOverride | EyeOverride (int) - Overrides the eye drawn by this viewport | |
| Idx_Mirror | bool - When enabled, viewport is mirrored, which can be helpful for aligning tracker inputs with assemblies |
Property index.
enum ProjectionMode
| Enumerator | Value | Description |
|---|---|---|
| ProjectionMode_PhysicalScreen | Projection is defined by eye position and physical screen node (Symbols - C: "ProjectionModePhysicalScreen", Lua: __Viewport_ProjectionModePhysicalScreen) | |
| ProjectionMode_FOVAndWidth | Projection is defined by eye position, FOV, screen width and HMD flag (Symbols - C: "ProjectionModeFOVAndWidth", Lua: __Viewport_ProjectionModeFOVAndWidth) | |
| ProjectionMode_Orthographic | Projection is orthographic, from the eye position (Symbols - C: "ProjectionModeOrthographic", Lua: __Viewport_ProjectionModeOrthographic) |
Values for Idx_ProjectionMode.