GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::PerspectiveProjection3D Struct Reference

Configuration of a perspective projection in 3D. More...

#include <GREM/graphics_3d/Camera3D.hpp>

Public Member Functions

constexpr bool operator== (const PerspectiveProjection3D &other) const =default
 Compare these options to another set of options for equality.

Public Attributes

float verticalFieldOfView = 1.28700221758656877361f
 Vertical field of view of the projection, in radians.
float aspectRatio = 1.0f
 Aspect ratio of the projection, X/Y.
float nearZ = 0.01f
 Distance to the near plane of the projection, in view coordinates.
float farZ = 1000.0f
 Distance to the far plane of the projection, in view coordinates.

Detailed Description

Configuration of a perspective projection in 3D.

Member Function Documentation

◆ operator==()

bool grem::graphics::PerspectiveProjection3D::operator== ( const PerspectiveProjection3D & other) const
nodiscardconstexprdefault

Compare these options to another set of options for equality.

Parameters
otherthe options to compare these to.
Returns
true if the options are equal, false otherwise.

Member Data Documentation

◆ verticalFieldOfView

float grem::graphics::PerspectiveProjection3D::verticalFieldOfView = 1.28700221758656877361f

Vertical field of view of the projection, in radians.

Note
The default value corresponds to 90 degrees horizontally at 4:3, or ~106 degrees horizontally at 16:9, which is ~74 degrees vertically. This value was the default in many classic FPS games and is still common today.

◆ aspectRatio

float grem::graphics::PerspectiveProjection3D::aspectRatio = 1.0f

Aspect ratio of the projection, X/Y.

Note
This should typically be set to viewport.region.size.getAspectRatio().

◆ nearZ

float grem::graphics::PerspectiveProjection3D::nearZ = 0.01f

Distance to the near plane of the projection, in view coordinates.

◆ farZ

float grem::graphics::PerspectiveProjection3D::farZ = 1000.0f

Distance to the far plane of the projection, in view coordinates.

If less than or equal to nearZ, the depth will be infinite.


The documentation for this struct was generated from the following file: