LuciadCPillar 2026.1.02
Loading...
Searching...
No Matches
luciad::OrthographicCamera::Builder Class Referencefinal

Factory object that can create new OrthographicCamera instances. More...

#include <luciad/cameras/OrthographicCamera.h>

Public Member Functions

 Builder (Builder &&other) noexcept
 Builder (const Builder &other)
 Copy constructor.
 ~Builder ()
std::shared_ptr< OrthographicCamera > build () const
 Returns a new orthographic camera.
Builder & look2D (const Look2D &look)
 Sets up a 2D camera viewpoint, looking straight down (along the z axis to plane at z=0).
Builder & nearFar (double nearPlane, double farPlane)
 Sets the near and far clipping distances of the new camera.
Builder & operator= (Builder other) noexcept

Detailed Description

Factory object that can create new OrthographicCamera instances.

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::OrthographicCamera::Builder::Builder ( const Builder & other)

Copy constructor.

Parameters
otherthe builder to copy.

◆ Builder() [2/2]

luciad::OrthographicCamera::Builder::Builder ( Builder && other)
noexcept

◆ ~Builder()

luciad::OrthographicCamera::Builder::~Builder ( )

Member Function Documentation

◆ build()

std::shared_ptr< OrthographicCamera > luciad::OrthographicCamera::Builder::build ( ) const

Returns a new orthographic camera.

Returns
a new orthographic camera.

◆ look2D()

Builder & luciad::OrthographicCamera::Builder::look2D ( const Look2D & look)

Sets up a 2D camera viewpoint, looking straight down (along the z axis to plane at z=0).

Parameters
lookthe description of target, scaling and orientation description for the new camera.
Returns
this builder

◆ nearFar()

Builder & luciad::OrthographicCamera::Builder::nearFar ( double nearPlane,
double farPlane )

Sets the near and far clipping distances of the new camera.

These values only take effect when the map's automatic near/far adjustment is turned off (see Map::setAutoAdjustDepthRangeEnabled). With that adjustment on (the default), the map manages the near and far for you, so values set here apply only once you turn it off. A freshly built orthographic camera defaults to a near of -9000 and a far of 20000.

The near and far bound the depth range: the interval along the view direction, measured from the eye, that is kept. For an orthographic projection the view volume between them is a box (parallel, equally sized near and far planes), so unlike a perspective camera the near distance may be zero or negative, depth is linear, and the far to near ratio does not affect precision. The range only has to contain the geometry you want to keep visible, so bracketing your content with some margin is enough (for a top-down view, a range that is roughly symmetric around the plane you are looking at works well).

Practical note: the orthographic camera is currently only used for 2D (projected, grid) maps, where all content lies in the map plane (at z=0), so the exact near and far have little visible effect as long as the range contains that plane.

Parameters
nearPlanethe distance from the eye to the near clipping plane.
farPlanethe distance from the eye to the far clipping plane.
Returns
this builder
Since
2026.1

◆ operator=()

Builder & luciad::OrthographicCamera::Builder::operator= ( Builder other)
noexcept