The ICamera graph node interface. More...
#include "murl_graph_i_camera.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual ISubject * | GetSubjectInterface ()=0 |
Get the mutable ISubject interface. More... | |
virtual const ISubject * | GetSubjectInterface () const =0 |
Get the constant ISubject interface. More... | |
virtual ICameraNodeTarget * | GetSubCameraNodeTarget ()=0 |
Get the mutable container holding the optional child cameras. More... | |
virtual const ICameraNodeTarget * | GetSubCameraNodeTarget () const =0 |
Get the constant container holding the optional child cameras. More... | |
virtual IViewNodeTarget * | GetViewNodeTarget ()=0 |
Get the mutable IViewNodeTarget container. More... | |
virtual const IViewNodeTarget * | GetViewNodeTarget () const =0 |
Get the constant IViewNodeTarget container. More... | |
virtual Bool | SetProjectionType (IEnums::ProjectionType type)=0 |
Set the projection type. More... | |
virtual IEnums::ProjectionType | GetProjectionType () const =0 |
Get the projection type. More... | |
virtual Bool | SetDepthOrder (SInt32 depthOrder)=0 |
Set the camera's absolute depth order. More... | |
virtual SInt32 | GetDepthOrder () const =0 |
Get the camera's absolute depth order. More... | |
virtual Bool | SetFrontFacingVertexOrder (IEnums::VertexOrder order)=0 |
Set the winding order for front-facing polygons. More... | |
virtual IEnums::VertexOrder | GetFrontFacingVertexOrder () const =0 |
Get the winding order for front-facing polygons. More... | |
virtual Bool | SetDepthSortMode (IEnums::DepthSortMode mode)=0 |
Set the depth sort mode for geometries within this camera. More... | |
virtual IEnums::DepthSortMode | GetDepthSortMode () const =0 |
Get the depth sort mode for geometries within this camera. More... | |
virtual Bool | SetScreenOrientation (IEnums::ScreenOrientation orientation)=0 |
Set the allowed screen orientation of the camera. More... | |
virtual IEnums::ScreenOrientation | GetScreenOrientation () const =0 |
Get the depth sort mode for geometries within this camera. More... | |
virtual Bool | SetAutoDeactivationEnabled (Bool enabled)=0 |
Enable/disable automatic deactivation if no geometry is to be rendered. More... | |
virtual Bool | IsAutoDeactivationEnabled () const =0 |
Check if automatic deactivation is enabled if no geometry is to be rendered. More... | |
virtual Bool | SetColorBufferClearingEnabled (Bool enabled)=0 |
Enable/disable clearing of the render target's color buffer. More... | |
virtual Bool | IsColorBufferClearingEnabled () const =0 |
Check if clearing of the render target's color buffer is enabled. More... | |
virtual Bool | SetDepthBufferClearingEnabled (Bool enabled)=0 |
Enable/disable clearing of the render target's depth buffer. More... | |
virtual Bool | IsDepthBufferClearingEnabled () const =0 |
Check if clearing of the render target's depth buffer is enabled. More... | |
virtual Bool | SetStencilBufferClearingEnabled (Bool enabled)=0 |
Enable/disable clearing of the render target's stencil buffer. More... | |
virtual Bool | IsStencilBufferClearingEnabled () const =0 |
Check if clearing of the render target's stencil buffer is enabled. More... | |
virtual Bool | SetColorBufferClearValue (const Color &value)=0 |
Set the clear color in effect when color buffer clearing is enabled. More... | |
virtual const Color & | GetColorBufferClearValue () const =0 |
Get the clear color in effect when color buffer clearing is enabled. More... | |
virtual Bool | SetDepthBufferClearValue (Real value)=0 |
Set the clear value in effect when depth buffer clearing is enabled. More... | |
virtual Real | GetDepthBufferClearValue () const =0 |
Get the clear value in effect when depth buffer clearing is enabled. More... | |
virtual Bool | SetStencilBufferClearValue (UInt32 value)=0 |
Set the clear value in effect when stencil buffer clearing is enabled. More... | |
virtual UInt32 | GetStencilBufferClearValue () const =0 |
Get the clear value in effect when stencil buffer clearing is enabled. More... | |
virtual Bool | SetBorderCoords (SInt32 left, SInt32 right, SInt32 top, SInt32 bottom)=0 |
Set the camera's view volume border coordinates. More... | |
virtual Bool | SetBorderCoordsX (SInt32 left, SInt32 right)=0 |
Set the camera's horizontal view volume border coordinates. More... | |
virtual Bool | SetBorderCoordsY (SInt32 top, SInt32 bottom)=0 |
Set the camera's vertical view volume border coordinates. More... | |
virtual SInt32 | GetLeftBorderCoord () const =0 |
Get the camera's left view volume border coordinate. More... | |
virtual SInt32 | GetRightBorderCoord () const =0 |
Get the camera's right view volume border coordinate. More... | |
virtual SInt32 | GetTopBorderCoord () const =0 |
Get the camera's top view volume border coordinate. More... | |
virtual SInt32 | GetBottomBorderCoord () const =0 |
Get the camera's bottom view volume border coordinate. More... | |
virtual Bool | SetBorderAnchors (IEnums::AlignmentX left, IEnums::AlignmentX right, IEnums::AlignmentY top, IEnums::AlignmentY bottom)=0 |
Set the camera's view volume border anchors. More... | |
virtual Bool | SetBorderAnchorsX (IEnums::AlignmentX left, IEnums::AlignmentX right)=0 |
Set the camera's horizontal view volume border anchors. More... | |
virtual Bool | SetBorderAnchorsY (IEnums::AlignmentY top, IEnums::AlignmentY bottom)=0 |
Set the camera's vertical view volume border anchors. More... | |
virtual IEnums::AlignmentX | GetLeftBorderAnchor () const =0 |
Get the camera's left view volume border anchor. More... | |
virtual IEnums::AlignmentX | GetRightBorderAnchor () const =0 |
Get the camera's right view volume border anchor. More... | |
virtual IEnums::AlignmentY | GetTopBorderAnchor () const =0 |
Get the camera's top view volume border anchor. More... | |
virtual IEnums::AlignmentY | GetBottomBorderAnchor () const =0 |
Get the camera's bottom view volume border anchor. More... | |
virtual Bool | SetBorderMaskEnabled (Bool enabled)=0 |
Enable/disable border masking. More... | |
virtual Bool | IsBorderMaskEnabled () const =0 |
Check if border masking is enabled. More... | |
virtual Bool | SetAspectClippingEnabled (Bool enabled)=0 |
Enable/disable aspect clipping. More... | |
virtual Bool | IsAspectClippingEnabled () const =0 |
Check if aspect clipping is enabled. More... | |
virtual Bool | SetAspectRatio (Real ratio)=0 |
Set the camera's aspect ratio. More... | |
virtual Real | GetAspectRatio () const =0 |
Get the current aspect ratio. More... | |
virtual Bool | SetFieldOfView (Real fovX, Real fovY)=0 |
Set the field of view at the near plane. More... | |
virtual Bool | SetFieldOfViewX (Real fovX)=0 |
Set the horizontal field of view, at the near plane. More... | |
virtual Bool | SetFieldOfViewY (Real fovY)=0 |
Set the vertical field of view, at the near plane. More... | |
virtual Real | GetFieldOfViewX () const =0 |
Get the horizontal field of view. More... | |
virtual Real | GetFieldOfViewY () const =0 |
Get the vertical field of view. More... | |
virtual Bool | SetUnitSize (Real unitSizeX, Real unitSizeY)=0 |
Set the unit size, at the near plane. More... | |
virtual Bool | SetUnitSizeX (Real unitSizeX)=0 |
Set the horizontal unit size, at the near plane. More... | |
virtual Bool | SetUnitSizeY (Real unitSizeY)=0 |
Set the vertical unit size, at the near plane. More... | |
virtual Real | GetUnitSizeX () const =0 |
Get the horizontal unit size. More... | |
virtual Real | GetUnitSizeY () const =0 |
Get the vertical unit size. More... | |
virtual Bool | SetCenter (Real centerX, Real centerY)=0 |
Set the projection center. More... | |
virtual Bool | SetCenterX (Real centerX)=0 |
Set the horizontal projection center. More... | |
virtual Bool | SetCenterY (Real centerY)=0 |
Set the vertical projection center. More... | |
virtual Real | GetCenterX () const =0 |
Get the horizontal projection center. More... | |
virtual Real | GetCenterY () const =0 |
Get the vertical projection center. More... | |
virtual Bool | SetShear (Real shearX, Real shearY)=0 |
Set the projection shearing. More... | |
virtual Bool | SetShearX (Real shearX)=0 |
Set the horizontal projection shearing. More... | |
virtual Bool | SetShearY (Real shearY)=0 |
Set the vertical projection shearing. More... | |
virtual Real | GetShearX () const =0 |
Get the horizontal projection shearing. More... | |
virtual Real | GetShearY () const =0 |
Get the vertical projection shearing. More... | |
virtual Bool | SetPosition (Real posX, Real posY)=0 |
Set the relative position within the view. More... | |
virtual Bool | SetPositionX (Real posX)=0 |
Set the relative horizontal position within the view. More... | |
virtual Bool | SetPositionY (Real posY)=0 |
Set the relative vertical position within the view. More... | |
virtual Real | GetPositionX () const =0 |
Get the relative horizontal position within the view. More... | |
virtual Real | GetPositionY () const =0 |
Get the relative vertical position within the view. More... | |
virtual Bool | SetSize (Real sizeX, Real sizeY)=0 |
Set the relative size within the view. More... | |
virtual Bool | SetSizeX (Real sizeX)=0 |
Set the relative horizontal size within the view. More... | |
virtual Bool | SetSizeY (Real sizeY)=0 |
Set the relative vertical size within the view. More... | |
virtual Real | GetSizeX () const =0 |
Get the relative horizontal size within the view. More... | |
virtual Real | GetSizeY () const =0 |
Get the relative vertical size within the view. More... | |
virtual Bool | SetNearAndFarPlaneZ (Real nearZ, Real farZ)=0 |
Set the absolute distances for both near and far clipping planes. More... | |
virtual Bool | SetNearPlaneZ (Real nearZ)=0 |
Set the absolute distance for the near clipping plane. More... | |
virtual Bool | SetFarPlaneZ (Real farZ)=0 |
Set the absolute distance for the far clipping plane. More... | |
virtual Real | GetNearPlaneZ () const =0 |
Get the absolute distance for the near clipping plane. More... | |
virtual Real | GetFarPlaneZ () const =0 |
Get the absolute distance for the far clipping plane. More... | |
virtual Bool | SetClipPlane (const Vector &clipPlane)=0 |
Set a user-defined view volume clipping plane in world space. More... | |
virtual Bool | SetClipPlane (const Vector &position, const Vector &normal)=0 |
Set a user-defined view volume clipping plane in world space. More... | |
virtual const Vector & | GetClipPlane () const =0 |
Get the user-defined view volume clipping plane in world space. More... | |
virtual Vector | GetLocalPositionFromScreen (const Vector &screenCoord) const =0 |
Calculate the camera space position from given screen coordinates. More... | |
virtual Vector | GetLocalPositionFromScreen (Real screenX, Real screenY, Real distance) const =0 |
Calculate the camera space position from given screen coordinates. More... | |
virtual Vector | GetWorldPositionFromScreen (const Vector &screenCoord) const =0 |
Calculate the world-space position from given screen coordinates. More... | |
virtual Vector | GetWorldPositionFromScreen (Real screenX, Real screenY, Real distance) const =0 |
Calculate the world-space position from given screen coordinates. More... | |
virtual Vector | GetScreenPositionFromLocal (const Vector &localCoord) const =0 |
Calculate the screen coordinates from a given coordinate in camera space. More... | |
virtual Vector | GetScreenPositionFromLocal (Real localX, Real localY, Real localZ) const =0 |
Calculate the screen coordinates from a given coordinate in camera space. More... | |
virtual Vector | GetScreenPositionFromWorld (const Vector &worldCoord) const =0 |
Calculate the screen coordinates from a given coordinate in world space. More... | |
virtual Vector | GetScreenPositionFromWorld (Real worldX, Real worldY, Real worldZ) const =0 |
Calculate the screen coordinates from a given coordinate in world space. More... | |
virtual UInt32 | GetNumberOfStages () const =0 |
Get the camera's number of stages. More... | |
virtual Video::ICamera * | GetVideoCameraObject (UInt32 stage) const =0 |
Get the camera's internal video renderer object. More... | |
virtual Input::IProjection * | GetInputProjectionObject (UInt32 stage) const =0 |
Get the camera's internal input handler object. More... | |
virtual void | SetMaskCoords (Real left, Real right, Real top, Real bottom)=0 |
Set the camera mask's border coordinates. More... | |
virtual void | SetMaskCoordsX (Real left, Real right)=0 |
Set the view mask's horizontal border coordinates. More... | |
virtual void | SetMaskCoordsY (Real top, Real bottom)=0 |
Set the view mask's vertical border coordinates. More... | |
virtual Real | GetLeftMaskCoord () const =0 |
Get the view mask's left border coordinate. More... | |
virtual Real | GetRightMaskCoord () const =0 |
Get the view mask's right border coordinate. More... | |
virtual Real | GetTopMaskCoord () const =0 |
Get the view mask's top border coordinate. More... | |
virtual Real | GetBottomMaskCoord () const =0 |
Get the view mask's bottom border coordinate. More... | |
virtual void | SetMaskAnchors (IEnums::AlignmentX left, IEnums::AlignmentX right, IEnums::AlignmentY top, IEnums::AlignmentY bottom)=0 |
Set the view mask's border anchors. More... | |
virtual void | SetMaskAnchorsX (IEnums::AlignmentX left, IEnums::AlignmentX right)=0 |
Set the view mask's horizontal border anchors. More... | |
virtual void | SetMaskAnchorsY (IEnums::AlignmentY top, IEnums::AlignmentY bottom)=0 |
Set the view mask's vertical border anchors. More... | |
virtual IEnums::AlignmentX | GetLeftMaskAnchor () const =0 |
Get the view mask's left border anchor. More... | |
virtual IEnums::AlignmentX | GetRightMaskAnchor () const =0 |
Get the view mask's right border anchor. More... | |
virtual IEnums::AlignmentY | GetTopMaskAnchor () const =0 |
Get the view mask's top border anchor. More... | |
virtual IEnums::AlignmentY | GetBottomMaskAnchor () const =0 |
Get the view mask's bottom border anchor. More... | |
virtual void | SetMaskCoordScaleFactor (Real factor)=0 |
Set the view mask's coordinates scale factor. More... | |
Public Member Functions inherited from Murl::Graph::IStateSlot | |
virtual Bool | SetSlot (SInt32 slot)=0 |
Set the slot index to use. More... | |
virtual SInt32 | GetSlot () const =0 |
Get the slot index to use. More... | |
Detailed Description
The ICamera graph node interface.
A camera represents a node positioned in world space through which any renderable geometry can be viewed within its viewing volume. The view volume can either be a box for orthographic cameras or a frustum for perspective cameras.
Along the screen-space Z axis, the view volume is bounded by a near plane and a far plane, which can be set by SetNearAndFarPlaneZ() and related methods. The values for the near and far plane always represent positive (absolute) distances from the camera's eye point, regardless of the actual camera position and orientation in world space.
For the screen-space X (left-right) and Y (bottom-top) axes, defining the view volume can be done independently in one of two ways:
- Specifying a unit size results in a constant mapping between output pixels and virtual coordinates catch'd by the camera, with a value of 1.0 producing a 1:1 relationship. In other words, if the output window is enlarged, more of the virtual space becomes visible for that camera.
- Specifying a field-of-view value keeps a constant relationship between virtual coordinates and window size. In other words, enlarging the window will enlarge the rendered scene, but no additional geometry will become visible.
The actual meaning of the given values is different for each type of camera:
- Orthographic cameras:
- The fovX and fovY parameters of the SetFieldOfView() method (and related ones) simply represent the X and Y extent of the viewing box from the center in both directions (i.e. the actual width and height of the box are 2*fovX and 2*fovY, respectively).
- The unitSizeX and unitSizeY parameters of the SetUnitSize() method (and related ones) directly map pixels to virtual coordinates.
- Perspective cameras:
- The fovX and fovY parameters of the SetFieldOfView() method (and related ones) represent the horizontal and vertical extent of the viewing frustum at the near plane, measured from the center. A near plane distance of 10.0 and a fovX of 10.0 therefore represent a 45° angle between the center line to both the left and right front edges of the frustum, resulting in a total horizontal field of view of 90°, with the virtual coordinates ranging from -10.0 to +10.0 in X direction, at a distance of 10.0 units in front of the camera.
- The unitSizeX and unitSizeY parameters of the SetUnitSize() method (and related ones) directly map pixels to virtual coordinates, again at the near plane.
Note, that you cannot specify both FOV and unit size for the same axis. It is however possible to define a FOV in X direction and a unit size in Y direction (and vice versa).
If only one axis is defined by an FOV or unit size value, the bounds of the missing dimension can be automatically calculated to maintain a given coordinate aspect ratio, which can be defined via SetAspectRatio(). (default 1.0). In this case (only one axis given), the aspect ratio cannot be 0, and the view area of the automatically calculated axis is adjusted with respect to the actual window size.
If both axes are set and the aspect ratio is set to a value higher than 0.0, the engine tries to both respect the given ratio as well as the FOV/unit size values. There are two cases how this is done:
- If SetAspectClippingEnabled() is set to false, the system always fits the camera to its output surface so that the given field of view is always fully visible. This may mean that the FOV of either the horizontal or vertical axis is actually bigger than specified (if the aspect ratio of the output surface is different from the camera aspect). To clip away this (possibly undesired) extra space, SetBorderMaskEnabled(true) can be called.
- If SetAspectClippingEnabled() is set to true, the system fits the camera to the output surface so that none of the given FOV values can become bigger than specified. If the aspect ratio of the output surface is different from the camera aspect, this means that either the horizontal or vertical FOV value becomes actually smaller than specified, clipping away those portions that do not fit.
In order to use a camera, it must be attached to a Graph::IView node, which specifies the actually visible area within the output surface (either the back buffer or a custom frame buffer). Attaching the camera can be done via the camera's Graph::IViewNodeTarget retrieved from GetViewNodeTarget(). If multiple cameras are attached to a single view, their drawing order can be specified via SetDepthOrder(), with higher values being "nearer", i.e. rendered later.
It is possible to define an explicit rectangular area to which the camera's given field of view is related. Setting this rectangle can be done via the SetBorderCoords() and SetBorderAnchors() methods (and related ones), which behaves analogously to setting the mask rectangle of a Graph::IView. See Graph::IView::SetMaskCoords() for details. By default, the border area covers the whole output surface, which is equivalent to all border coordinates equaling zero, and the left, top, right and bottom anchors set to the corresponding alignment values (IEnums::ALIGNMENT_X_LEFT, IEnums::ALIGNMENT_Y_TOP and so on).
Note, that setting a camera border rectangle does not actually clip the output at the given border edges; instead, the border rectangle only defines the reference edges to which the view volume is anchored. In other words, the view volume actually extends beyond this rectangle; if clipping is desired, it must be enabled in the camera's view by specifying arbitrary values for that view's mask coordinates and anchors.
Within the given border rectangle, it is possible to also define the camera's projection center via SetCenter(), with values ranging from -1.0 to 1.0 for left/right and bottom/top edges.
See Output-States, Slots und Units for an overview of state handling during scene graph traversal.
See Graph::ICameraTransform for setting a camera's position and orientation.
See Graph::ICameraState for activating a camera for rendering.
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
- Returns
- The mutable Graph::INode interface, or null if not available
◆ GetNodeInterface() [2/2]
|
pure virtual |
Get the constant Graph::INode interface.
This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
- Returns
- The constant Graph::INode interface, or null if not available
◆ GetSubjectInterface() [1/2]
|
pure virtual |
◆ GetSubjectInterface() [2/2]
|
pure virtual |
◆ GetSubCameraNodeTarget() [1/2]
|
pure virtual |
Get the mutable container holding the optional child cameras.
This method returns a mutable pointer to the node's Graph::ICameraNodeTarget sub container, which is used to store multiple sub-cameras.
- Returns
- The mutable Graph::ICameraNodeTarget container, or null if not available.
◆ GetSubCameraNodeTarget() [2/2]
|
pure virtual |
Get the constant container holding the optional child cameras.
This method returns a constant pointer to the node's Graph::ICameraNodeTarget sub container, which is used to store multiple sub-cameras.
- Returns
- The constant Graph::ICameraNodeTarget container, or null if not available.
◆ GetViewNodeTarget() [1/2]
|
pure virtual |
Get the mutable IViewNodeTarget container.
This method returns a mutable pointer to the node's IViewNodeTarget container, which allows to set or query the view object the camera is attached to.
- Returns
- The mutable IViewNodeTarget container, or null if not available
◆ GetViewNodeTarget() [2/2]
|
pure virtual |
Get the constant IViewNodeTarget container.
This method returns a constant pointer to the node's IViewNodeTarget container, which allows to query the view object the camera is attached to.
- Returns
- The constant IViewNodeTarget container, or null if not available
◆ SetProjectionType()
|
pure virtual |
Set the projection type.
- Parameters
-
type The projection type.
- Returns
- true if successful.
◆ GetProjectionType()
|
pure virtual |
Get the projection type.
- Returns
- The projection type.
◆ SetDepthOrder()
Set the camera's absolute depth order.
When a Graph::IView contains more than one camera to render to, it may be necessary to define the exact order in which those cameras are overlaid. The given depth order value represents a 32 bit signed integer; higher values result in a "later" rendering on top of previous cameras, i.e. back-to-front rendering in ascending order of depth order values. See also Graph::IView::SetDepthOrder().
- Parameters
-
depthOrder The absolute order of this camera within its view.
- Returns
- true if successful.
◆ GetDepthOrder()
|
pure virtual |
Get the camera's absolute depth order.
- Returns
- The absolute order of this camera within its view.
◆ SetFrontFacingVertexOrder()
|
pure virtual |
Set the winding order for front-facing polygons.
- Parameters
-
order The winding order, either clockwise or counter-clockwise.
- Returns
- true if successful.
◆ GetFrontFacingVertexOrder()
|
pure virtual |
Get the winding order for front-facing polygons.
- Returns
- The winding order, either clockwise or counter-clockwise.
◆ SetDepthSortMode()
|
pure virtual |
Set the depth sort mode for geometries within this camera.
When rendering alpha blended geometries, it is often necessary to sort these from back to front, to maintain correct blending.
- Parameters
-
mode The depth sort mode used for this camera.
- Returns
- true if successful.
◆ GetDepthSortMode()
|
pure virtual |
Get the depth sort mode for geometries within this camera.
- Returns
- The depth sort mode used for this camera.
◆ SetScreenOrientation()
|
pure virtual |
Set the allowed screen orientation of the camera.
By default, all screen orientations are allowed. Use this method to restrict the camera's orientation to the given value.
- Parameters
-
orientation The desired screen orientation.
- Returns
- true if successful.
◆ GetScreenOrientation()
|
pure virtual |
Get the depth sort mode for geometries within this camera.
- Returns
- The depth sort mode used for this camera.
◆ SetAutoDeactivationEnabled()
Enable/disable automatic deactivation if no geometry is to be rendered.
When automatic deactivation is enabled, the renderer will not process that specific camera when it does not contain any visible geometry to render. In this case, the render target (e.g. frame buffer) will retain the most recently rendered image, and the target will not be cleared. When using an empty camera for e.g. clearing portions of the screen where no other camera is rendering to, this must be set to "false", otherwise this camera will never be processed.
- Parameters
-
enabled Set to true if auto deactivation is desired.
- Returns
- true if successful.
◆ IsAutoDeactivationEnabled()
|
pure virtual |
Check if automatic deactivation is enabled if no geometry is to be rendered.
- Returns
- true if auto deactivation is enabled.
◆ SetColorBufferClearingEnabled()
Enable/disable clearing of the render target's color buffer.
When multiple cameras are defined for a specific Graph::IView (e.g. one for rendering a 3D scene and the other one for rendering a heads-up display), color buffer clearing should be disabled for the second camera to prevent overwriting all previously rendered pixels. The same applies, when multiple views with different cameras are stacked atop each other; in most cases only the "farthest away" camera should have color buffer clearing enabled. See SetColorBufferClearValue() for setting the color used for clearing. See also SetDepthBufferClearingEnabled() and SetStencilBufferClearingEnabled().
- Parameters
-
enabled Set to false to disable color buffer clearing.
- Returns
- true if successful.
◆ IsColorBufferClearingEnabled()
|
pure virtual |
Check if clearing of the render target's color buffer is enabled.
- Returns
- true if color buffer clearing is enabled.
◆ SetDepthBufferClearingEnabled()
Enable/disable clearing of the render target's depth buffer.
In the example shown in SetColorBufferClearingEnabled(), color buffer clearing is intentionally disabled for the second camera. However, if the HUD rendered by the second camera also performs depth testing, it may be necessary to clear the depth buffer to prevent unwanted rendering artifacts. See SetDepthBufferClearValue() for setting the depth value used for clearing. See also SetStencilBufferClearingEnabled().
- Parameters
-
enabled Set to false to disable depth buffer clearing.
- Returns
- true if successful.
◆ IsDepthBufferClearingEnabled()
|
pure virtual |
Check if clearing of the render target's depth buffer is enabled.
- Returns
- true if depth buffer clearing is enabled.
◆ SetStencilBufferClearingEnabled()
Enable/disable clearing of the render target's stencil buffer.
See SetStencilBufferClearValue() for setting the stencil value used for clearing. See SetDepthBufferClearingEnabled() and SetColorBufferClearingEnabled().
- Parameters
-
enabled Set to false to disable stencil buffer clearing.
- Returns
- true if successful.
◆ IsStencilBufferClearingEnabled()
|
pure virtual |
Check if clearing of the render target's stencil buffer is enabled.
- Returns
- true if stencil buffer clearing is enabled.
◆ SetColorBufferClearValue()
Set the clear color in effect when color buffer clearing is enabled.
- Parameters
-
value The clear color.
- Returns
- true if successful.
◆ GetColorBufferClearValue()
|
pure virtual |
Get the clear color in effect when color buffer clearing is enabled.
- Returns
- The clear color.
◆ SetDepthBufferClearValue()
Set the clear value in effect when depth buffer clearing is enabled.
- Parameters
-
value The clear value.
- Returns
- true if successful.
◆ GetDepthBufferClearValue()
|
pure virtual |
Get the clear value in effect when depth buffer clearing is enabled.
- Returns
- The clear value.
◆ SetStencilBufferClearValue()
Set the clear value in effect when stencil buffer clearing is enabled.
- Parameters
-
value The clear value.
- Returns
- true if successful.
◆ GetStencilBufferClearValue()
|
pure virtual |
Get the clear value in effect when stencil buffer clearing is enabled.
- Returns
- The clear value.
◆ SetBorderCoords()
|
pure virtual |
Set the camera's view volume border coordinates.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Parameters
-
left The left border coordinate. Positive values run to the right. right The right border coordinate. Positive values run to the right. top The top border coordinate. Positive values run up. bottom The bottom border coordinate. Positive values run up.
- Returns
- true if successful.
◆ SetBorderCoordsX()
Set the camera's horizontal view volume border coordinates.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Parameters
-
left The left border coordinate. right The right border coordinate.
- Returns
- true if successful.
◆ SetBorderCoordsY()
Set the camera's vertical view volume border coordinates.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Parameters
-
top The top border coordinate. Positive values run up. bottom The bottom border coordinate. Positive values run up.
- Returns
- true if successful.
◆ GetLeftBorderCoord()
|
pure virtual |
Get the camera's left view volume border coordinate.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The left border coordinate.
◆ GetRightBorderCoord()
|
pure virtual |
Get the camera's right view volume border coordinate.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The right border coordinate.
◆ GetTopBorderCoord()
|
pure virtual |
Get the camera's top view volume border coordinate.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The top border coordinate.
◆ GetBottomBorderCoord()
|
pure virtual |
Get the camera's bottom view volume border coordinate.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The bottom border coordinate.
◆ SetBorderAnchors()
|
pure virtual |
Set the camera's view volume border anchors.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Parameters
-
left The left border anchor. right The right border anchor. top The top border anchor. bottom The bottom border anchor.
- Returns
- true if successful.
◆ SetBorderAnchorsX()
|
pure virtual |
Set the camera's horizontal view volume border anchors.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Parameters
-
left The left border anchor. right The right border anchor.
- Returns
- true if successful.
◆ SetBorderAnchorsY()
|
pure virtual |
Set the camera's vertical view volume border anchors.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Parameters
-
top The top border anchor. bottom The bottom border anchor.
- Returns
- true if successful.
◆ GetLeftBorderAnchor()
|
pure virtual |
Get the camera's left view volume border anchor.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The left border anchor.
◆ GetRightBorderAnchor()
|
pure virtual |
Get the camera's right view volume border anchor.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The right border anchor.
◆ GetTopBorderAnchor()
|
pure virtual |
Get the camera's top view volume border anchor.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The top border anchor.
◆ GetBottomBorderAnchor()
|
pure virtual |
Get the camera's bottom view volume border anchor.
See the Graph::ICamera description, and Graph::IView::SetMaskCoords().
- Returns
- The bottom border anchor.
◆ SetBorderMaskEnabled()
Enable/disable border masking.
See the Graph::ICamera description.
- Parameters
-
enabled If true, masking is enabled.
- Returns
- true if successful.
◆ IsBorderMaskEnabled()
|
pure virtual |
Check if border masking is enabled.
- Returns
- true if masking is enabled.
◆ SetAspectClippingEnabled()
Enable/disable aspect clipping.
See the Graph::ICamera description.
- Parameters
-
enabled If true, aspect clipping is enabled.
- Returns
- true if successful.
◆ IsAspectClippingEnabled()
|
pure virtual |
Check if aspect clipping is enabled.
- Returns
- true if clipping is enabled.
◆ SetAspectRatio()
Set the camera's aspect ratio.
The aspect ratio is used in different ways to calculate the actual field of view and border area, depending on the given FOV parameters:
- If only one axis is defined using a unit size value, the missing one is calculated so that the virtual coordinate system maintains the given X:Y aspect ratio.
- The same is true if only a single FOV value is given; in this case the FOV of the other axis grows or shrinks depending on the window size and window aspect.
- If both FOV axes are specified and the given aspect ratio is not 0, the FOV of both axes remains as defined. Here, the actual outcome depends on whether aspect clipping and/or border masking is enabled or not:
- If aspect clipping is enabled, the camera calculates the actual FOV so that the view area is always fully covered. If the window aspect is smaller than the FOV aspect (the window is taller than the FOV), the vertical FOV is clipped. If the window aspect is greater (wider than the FOV), the horizontal FOV is clipped.
- If aspect clipping is disabled, the camera always keeps both FOV axes fully within the view. If the window is taller than the FOV, borders are added vertically, and if it is wider, horizontal borders are added. Note, that it is necessary to enable border masking (see SetBorderMaskEnabled()) so that these borders actually have effect.
- If both FOV axes are specified and the given aspect ratio equals 0, the given FOV values are directly used regardless of the actual view size. In other words, the virtual coordinate system gets skewed, resulting in non-square coordinate units on screen.
- Parameters
-
ratio The X:Y aspect ratio.
- Returns
- true if successful.
◆ GetAspectRatio()
|
pure virtual |
Get the current aspect ratio.
- Returns
- The X:Y aspect ratio.
◆ SetFieldOfView()
Set the field of view at the near plane.
This method sets both the horizontal and vertical field of view values. See the detailed description above on how the camera's viewing volume is calculated from these values.
- Parameters
-
fovX The horizontal field of view. fovY The vertical field of view.
- Returns
- true if successful.
◆ SetFieldOfViewX()
Set the horizontal field of view, at the near plane.
See the detailed description above on how the camera's viewing volume is calculated.
- Parameters
-
fovX The horizontal field of view.
- Returns
- true if successful.
◆ SetFieldOfViewY()
Set the vertical field of view, at the near plane.
See the detailed description above on how the camera's viewing volume is calculated.
- Parameters
-
fovY The vertical field of view.
- Returns
- true if successful.
◆ GetFieldOfViewX()
|
pure virtual |
Get the horizontal field of view.
- Returns
- The horizontal field of view, or 0.0 if variable.
◆ GetFieldOfViewY()
|
pure virtual |
Get the vertical field of view.
- Returns
- The vertical field of view, or 0.0 if variable.
◆ SetUnitSize()
Set the unit size, at the near plane.
This method sets both the horizontal and vertical unit size. See the detailed description above on how the camera's viewing volume is calculated from these values.
- Parameters
-
unitSizeX The horizontal unit size. unitSizeY The vertical unit size.
- Returns
- true if successful.
◆ SetUnitSizeX()
Set the horizontal unit size, at the near plane.
See the detailed description above on how the camera's viewing volume is calculated.
- Parameters
-
unitSizeX The horizontal unit size.
- Returns
- true if successful.
◆ SetUnitSizeY()
Set the vertical unit size, at the near plane.
See the detailed description above on how the camera's viewing volume is calculated.
- Parameters
-
unitSizeY The vertical unit size.
- Returns
- true if successful.
◆ GetUnitSizeX()
|
pure virtual |
Get the horizontal unit size.
- Returns
- The horizontal unit size, or 0.0 if variable.
◆ GetUnitSizeY()
|
pure virtual |
Get the vertical unit size.
- Returns
- The vertical unit size, or 0.0 if variable.
◆ SetCenter()
Set the projection center.
- Parameters
-
centerX The horizontal projection center. centerY The vertical projection center.
- Returns
- true if successful.
◆ SetCenterX()
Set the horizontal projection center.
- Parameters
-
centerX The horizontal projection center.
- Returns
- true if successful.
◆ SetCenterY()
Set the vertical projection center.
- Parameters
-
centerY The vertical projection center.
- Returns
- true if successful.
◆ GetCenterX()
|
pure virtual |
Get the horizontal projection center.
- Returns
- The horizontal projection center.
◆ GetCenterY()
|
pure virtual |
Get the vertical projection center.
- Returns
- The vertical projection center.
◆ SetShear()
Set the projection shearing.
- Parameters
-
shearX The horizontal projection shearing. shearY The vertical projection shearing.
- Returns
- true if successful.
◆ SetShearX()
Set the horizontal projection shearing.
- Parameters
-
shearX The horizontal projection shearing.
- Returns
- true if successful.
◆ SetShearY()
Set the vertical projection shearing.
- Parameters
-
shearY The vertical projection shearing.
- Returns
- true if successful.
◆ GetShearX()
|
pure virtual |
Get the horizontal projection shearing.
- Returns
- The horizontal projection shearing.
◆ GetShearY()
|
pure virtual |
Get the vertical projection shearing.
- Returns
- The vertical projection shearing.
◆ SetPosition()
Set the relative position within the view.
- Parameters
-
posX The horizontal position. posY The vertical position.
- Returns
- true if successful.
◆ SetPositionX()
Set the relative horizontal position within the view.
- Parameters
-
posX The horizontal position.
- Returns
- true if successful.
◆ SetPositionY()
Set the relative vertical position within the view.
- Parameters
-
posY The vertical position.
- Returns
- true if successful.
◆ GetPositionX()
|
pure virtual |
Get the relative horizontal position within the view.
- Returns
- The horizontal position.
◆ GetPositionY()
|
pure virtual |
Get the relative vertical position within the view.
- Returns
- The vertical position.
◆ SetSize()
Set the relative size within the view.
- Parameters
-
sizeX The horizontal size. sizeY The vertical size.
- Returns
- true if successful.
◆ SetSizeX()
Set the relative horizontal size within the view.
- Parameters
-
sizeX The horizontal size.
- Returns
- true if successful.
◆ SetSizeY()
Set the relative vertical size within the view.
- Parameters
-
sizeY The vertical size.
- Returns
- true if successful.
◆ GetSizeX()
|
pure virtual |
Get the relative horizontal size within the view.
- Returns
- The horizontal size.
◆ GetSizeY()
|
pure virtual |
Get the relative vertical size within the view.
- Returns
- The vertical size.
◆ SetNearAndFarPlaneZ()
Set the absolute distances for both near and far clipping planes.
Both values must be positive, with 0 < nearZ < farZ.
- Parameters
-
nearZ The positive near plane distance. farZ The positive near plane distance.
- Returns
- true if successful.
◆ SetNearPlaneZ()
Set the absolute distance for the near clipping plane.
- Parameters
-
nearZ The positive near plane distance.
- Returns
- true if successful.
◆ SetFarPlaneZ()
Set the absolute distance for the far clipping plane.
- Parameters
-
farZ The positive near plane distance.
- Returns
- true if successful.
◆ GetNearPlaneZ()
|
pure virtual |
Get the absolute distance for the near clipping plane.
- Returns
- The positive near plane distance.
◆ GetFarPlaneZ()
|
pure virtual |
Get the absolute distance for the far clipping plane.
- Returns
- The positive far plane distance.
◆ SetClipPlane() [1/2]
Set a user-defined view volume clipping plane in world space.
- Parameters
-
clipPlane A vector holding the A, B, C and D coefficients from the plane equation defining the clipping plane, contained in the vector's x, y, z and w components, respectively. The x, y and z components represent the actual plane normal, where the w component represents the plane's normal distance from the origin.
- Returns
- true if successful.
◆ SetClipPlane() [2/2]
|
pure virtual |
Set a user-defined view volume clipping plane in world space.
- Parameters
-
position A vector holding the position of an arbitrary point in world space that is lying on the clip plane. normal A vector holding the clipping plane's normal vector in its x, y and z components.
- Returns
- true if successful.
◆ GetClipPlane()
|
pure virtual |
Get the user-defined view volume clipping plane in world space.
- Returns
- A vector holding the A, B, C and D coefficients from the plane equation defining the clipping plane, contained in the vector's x, y, z and w components, respectively.
◆ GetLocalPositionFromScreen() [1/2]
|
pure virtual |
Calculate the camera space position from given screen coordinates.
This method can be used to get a vector to a point in camera space, defined by a pair of X and Y screen coordinates, and a distance along the camera's viewing axis. As the viewing axis is always parallel to the Z axis, looking in the negative direction, the given distance must also be negative to represent a point in front of the camera.
- Parameters
-
screenCoord A vector containing the horizontal and vertical screen coordinates in the X and Y components, and the distance from the camera along its viewing axis in the Z component. A negative distance represents a point in front of the camera.
- Returns
- The camera-space position.
◆ GetLocalPositionFromScreen() [2/2]
|
pure virtual |
Calculate the camera space position from given screen coordinates.
See GetLocalPositionFromScreen(const Vector& screenCoord).
- Parameters
-
screenX The X coordinate on screen for which to calculate the local point. screenY The Y coordinate on screen for which to calculate the local point. distance The distance from the camera.
- Returns
- The camera-space position.
◆ GetWorldPositionFromScreen() [1/2]
|
pure virtual |
Calculate the world-space position from given screen coordinates.
This method first calculates the local position via GetLocalPositionFromScreen(), and then transforms the resulting point to world space by multiplying it with the camera's world transform.
- Parameters
-
screenCoord A vector containing the horizontal and vertical screen coordinates in the X and Y components, and the distance from the camera along its viewing axis in the Z component. A negative distance represents a point in front of the camera.
- Returns
- The world-space position.
◆ GetWorldPositionFromScreen() [2/2]
|
pure virtual |
Calculate the world-space position from given screen coordinates.
See GetWorldPositionFromScreen(const Vector& screenCoord).
- Parameters
-
screenX The X coordinate on screen for which to calculate the world point. screenY The Y coordinate on screen for which to calculate the world point. distance The distance from the camera.
- Returns
- The world-space position.
◆ GetScreenPositionFromLocal() [1/2]
|
pure virtual |
Calculate the screen coordinates from a given coordinate in camera space.
This method performs a regular view space to screen space transformation, using the projection matrix set for the camera. The input coordinate is relative to the camera itself.
- Parameters
-
localCoord The coordinate to transform, in camera space.
- Returns
- The camera space position.
◆ GetScreenPositionFromLocal() [2/2]
|
pure virtual |
Calculate the screen coordinates from a given coordinate in camera space.
See GetScreenPositionFromLocal(const Vector& localCoord).
- Parameters
-
localX The input coordinate's X component, in camera space. localY The input coordinate's Y component, in camera space. localZ The input coordinate's Z component, in camera space.
- Returns
- The camera space position.
◆ GetScreenPositionFromWorld() [1/2]
|
pure virtual |
Calculate the screen coordinates from a given coordinate in world space.
This method performs a regular world space to screen space transformation, using the inverse model matrix and the regular projection matrix set for the camera. The input coordinate represents an absolute world position.
- Parameters
-
worldCoord The coordinate to transform, in world space.
- Returns
- The camera space position.
◆ GetScreenPositionFromWorld() [2/2]
|
pure virtual |
Calculate the screen coordinates from a given coordinate in world space.
See GetScreenPositionFromWorld(const Vector& worldCoord).
- Parameters
-
worldX The input coordinate's X component, in world space. worldY The input coordinate's Y component, in world space. worldZ The input coordinate's Z component, in world space.
- Returns
- The camera space position.
◆ GetNumberOfStages()
|
pure virtual |
Get the camera's number of stages.
- Returns
- The number of stages.
◆ GetVideoCameraObject()
|
pure virtual |
Get the camera's internal video renderer object.
- Parameters
-
stage The stage to query.
- Returns
- The video renderer object.
◆ GetInputProjectionObject()
|
pure virtual |
Get the camera's internal input handler object.
- Parameters
-
stage The stage to query.
- Returns
- The input handler object.
◆ SetMaskCoords()
|
pure virtual |
Set the camera mask's border coordinates.
To define a rectangular mask for the view, it is necessary to specify 4 values, one for each edge of the desired rectangle: left, right, top and bottom. In addition, it is necessary to specify an anchor point for each of these edges, via SetMaskAnchors() or related methods, which represents the absolute origin for the respective coordinate value. For example, if the left coordinate value is set to a value of 50 and the left anchor is set to IEnums::ALIGNMENT_X_LEFT, the mask is always anchored at the left window edge with an offset of 50 units to the right. If the left coordinate has a value of -200 and the left anchor is set to IEnums::ALIGNMENT_X_RIGHT, the mask's left border will always be 200 units left of the right window border. Note that the engine's camera coordinate origin is at the center of the screen with positive Y values running up. Therefore, to define e.g. a vertical mask that clips 100 units from both top and bottom, it is necessary to specify a value of +100 for the bottom coordinate (with the bottom anchor set to IEnums::ALIGNMENT_Y_BOTTOM), and a value of -100 for the top coordinate, with IEnums::ALIGNMENT_Y_TOP for the top anchor.
- Parameters
-
left The left mask coordinate. Positive values run to the right. right The right mask coordinate. Positive values run to the right. top The top mask coordinate. Positive values run up. bottom The bottom mask coordinate. Positive values run up.
◆ SetMaskCoordsX()
Set the view mask's horizontal border coordinates.
See SetMaskCoords() for details.
- Parameters
-
left The left mask coordinate. right The right mask coordinate.
- Returns
- true if successful.
◆ SetMaskCoordsY()
Set the view mask's vertical border coordinates.
See SetMaskCoords() for details.
- Parameters
-
top The top mask coordinate. bottom The bottom mask coordinate.
◆ GetLeftMaskCoord()
|
pure virtual |
Get the view mask's left border coordinate.
See SetMaskCoords() for details.
- Returns
- The left mask coordinate.
◆ GetRightMaskCoord()
|
pure virtual |
Get the view mask's right border coordinate.
See SetMaskCoords() for details.
- Returns
- The right mask coordinate.
◆ GetTopMaskCoord()
|
pure virtual |
Get the view mask's top border coordinate.
See SetMaskCoords() for details.
- Returns
- The top mask coordinate.
◆ GetBottomMaskCoord()
|
pure virtual |
Get the view mask's bottom border coordinate.
See SetMaskCoords() for details.
- Returns
- The bottom mask coordinate.
◆ SetMaskAnchors()
|
pure virtual |
Set the view mask's border anchors.
See SetMaskCoords() for details.
- Parameters
-
left The left mask anchor. right The right mask anchor. top The top mask anchor. bottom The bottom mask anchor.
◆ SetMaskAnchorsX()
|
pure virtual |
Set the view mask's horizontal border anchors.
See SetMaskCoords() for details.
- Parameters
-
left The left mask anchor. right The right mask anchor.
◆ SetMaskAnchorsY()
|
pure virtual |
Set the view mask's vertical border anchors.
See SetMaskCoords() for details.
- Parameters
-
top The top mask anchor. bottom The bottom mask anchor.
◆ GetLeftMaskAnchor()
|
pure virtual |
Get the view mask's left border anchor.
See SetMaskCoords() for details.
- Returns
- The left mask anchor.
◆ GetRightMaskAnchor()
|
pure virtual |
Get the view mask's right border anchor.
See SetMaskCoords() for details.
- Returns
- The right mask anchor.
◆ GetTopMaskAnchor()
|
pure virtual |
◆ GetBottomMaskAnchor()
|
pure virtual |
Get the view mask's bottom border anchor.
See SetMaskCoords() for details.
- Returns
- The bottom mask anchor.
◆ SetMaskCoordScaleFactor()
|
pure virtual |
Set the view mask's coordinates scale factor.
See SetMaskCoords() for details.
- Parameters
-
factor mask coordinates will be multiplied by 1/factor.
The documentation for this interface was generated from the following file:
- murl_graph_i_camera.h