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

Projection matrix or configuration of a projection in 3D. More...

#include <GREM/graphics_3d/Camera3D.hpp>

Inheritance diagram for grem::graphics::Projection3D:

Public Member Functions

constexpr Variant () noexcept(std::is_nothrow_default_constructible_v< variant_alternative_t< 0, Variant > >)
 Default-construct a variant with the first variant alternative, if it is default-constructible.
template<typename U>
requires (!std::is_same_v<std::remove_cvref_t<U>, Variant> && variant_has_alternative_v<decltype(F(std::forward<U>(value))), Variant> && std::is_constructible_v<decltype(F(std::forward<U>(value))), U>)
constexpr Variant (U &&value) noexcept(std::is_nothrow_constructible_v< decltype(F(std::forward< U >(value))), U >)
 Converting constructor.
template<typename T, typename... Args>
requires (variant_has_alternative_v<T, Variant> && std::is_constructible_v<T, Args...>)
constexpr Variant (std::in_place_type_t< T > type, Args &&... args)
 Construct a variant alternative in-place given its type.
template<typename T, typename U, typename... Args>
requires (variant_has_alternative_v<T, Variant> && std::is_constructible_v<T, std::initializer_list<U>&, Args...>)
constexpr Variant (std::in_place_type_t< T > type, std::initializer_list< U > ilist, Args &&... args)
 Construct a variant alternative in-place given its type, with an initializer list as the first constructor argument.
template<std::size_t Index, typename... Args>
requires (Index < sizeof...(Ts) && std::is_constructible_v<variant_alternative_t<Index, Variant>, Args...>)
constexpr Variant (std::in_place_index_t< Index > index, Args &&... args)
 Construct a variant alternative in-place given its index.
template<std::size_t Index, typename U, typename... Args>
requires (Index < sizeof...(Ts) && std::is_constructible_v<variant_alternative_t<Index, Variant>, std::initializer_list<U>&, Args...>)
constexpr Variant (std::in_place_index_t< Index > index, std::initializer_list< U > ilist, Args &&... args)
 Construct a variant alternative in-place given its index, with an initializer list as the first constructor argument.
constexpr Variant (const Variant &other)=delete
 Deleted copy constructor.
constexpr Variant (Variant &&other) noexcept=default
 Trivial move constructor.
Public Member Functions inherited from grem::Variant< mat4, OrthographicProjection3D, PerspectiveProjection3D >
constexpr ~Variant ()
 Destructor.
constexpr Variant & operator= (const Variant &other)=delete
 Deleted copy assignment.
constexpr T & emplace (Args &&... args)
 Construct an alternative given its type, destroying the old value.
constexpr void swap (Variant &other) noexcept(((std::is_nothrow_move_constructible_v< Ts > &&std::is_nothrow_swappable_v< Ts >) &&...))
 Swap this variant's value with that of another.
constexpr index_type index () const noexcept
 Get the alternative index of the currently active value held by the variant.
constexpr bool valueless_by_exception () const noexcept
 Check if the variant is in the valueless by exception state.
constexpr bool is () const noexcept
 Check if the variant currently holds the alternative with the given type.
constexpr T & as () &noexcept
 Access the underlying value with the given type without a safety check.
constexpr T & get () &
 Access the underlying value with the given type.
constexpr T * get_if () noexcept
 Access the underlying value with the given type if it is the currently active alternative.

Additional Inherited Members

Public Types inherited from grem::Variant< mat4, OrthographicProjection3D, PerspectiveProjection3D >
using index_type
 Index type used to encode the active alternative type.
Static Public Member Functions inherited from grem::Variant< mat4, OrthographicProjection3D, PerspectiveProjection3D >
static constexpr decltype(auto) visit (Visitor &&visitor, V &&variant)
 Call a visitor functor with the currently active underlying value of a variant.
static constexpr decltype(auto) visitIndex (index_type index, Visitor &&visitor)
 Call a visitor functor with the type corresponding to a variant index.
static constexpr decltype(auto) apply (Function &&function)
 Call a functor with all alternative types.
Static Public Attributes inherited from grem::Variant< mat4, OrthographicProjection3D, PerspectiveProjection3D >
static constexpr index_type npos
 Invalid alternative index, representing the valueless by exception state.

Detailed Description

Projection matrix or configuration of a projection in 3D.

Member Function Documentation

◆ Variant() [1/8]

grem::Variant< Ts >::Variant ( )
inlineconstexprnoexcept

Default-construct a variant with the first variant alternative, if it is default-constructible.

Exceptions
anyexception thrown by the underlying constructor of the first alternative type.

◆ Variant() [2/8]

template<typename U>
requires (!std::is_same_v<std::remove_cvref_t<U>, Variant> && variant_has_alternative_v<decltype(F(std::forward<U>(value))), Variant> && std::is_constructible_v<decltype(F(std::forward<U>(value))), U>)
grem::Variant< Ts >::Variant ( U && value)
inlineconstexprnoexcept

Converting constructor.

Chooses the variant alternative type to construct based on the overloading rules specified by std::variant.

Parameters
valueunderlying value to construct the variant from. Must be convertible to one of the variant's listed alternative types.
Exceptions
anyexception thrown by the underlying constructor of the relevant alternative type.

◆ Variant() [3/8]

template<typename T, typename... Args>
requires (variant_has_alternative_v<T, Variant> && std::is_constructible_v<T, Args...>)
grem::Variant< Ts >::Variant ( std::in_place_type_t< T > type,
Args &&... args )
inlineexplicitconstexpr

Construct a variant alternative in-place given its type.

Parameters
typestd::in_place_type<T>, where T is the alternative type to construct, which must be one of the variant's listed alternative types.
argsarguments to pass to the underlying value's constructor.
Exceptions
anyexception thrown by the underlying constructor of the relevant alternative type.

◆ Variant() [4/8]

template<typename T, typename U, typename... Args>
requires (variant_has_alternative_v<T, Variant> && std::is_constructible_v<T, std::initializer_list<U>&, Args...>)
grem::Variant< Ts >::Variant ( std::in_place_type_t< T > type,
std::initializer_list< U > ilist,
Args &&... args )
inlineexplicitconstexpr

Construct a variant alternative in-place given its type, with an initializer list as the first constructor argument.

Parameters
typestd::in_place_type<T>, where T is the alternative type to construct, which must be one of the variant's listed alternative types.
ilistfirst argument to pass to the underlying value's constructor.
argssubsequent arguments to pass to the underlying value's constructor.
Exceptions
anyexception thrown by the underlying constructor of the relevant alternative type.

◆ Variant() [5/8]

template<std::size_t Index, typename... Args>
requires (Index < sizeof...(Ts) && std::is_constructible_v<variant_alternative_t<Index, Variant>, Args...>)
grem::Variant< Ts >::Variant ( std::in_place_index_t< Index > index,
Args &&... args )
inlineexplicitconstexpr

Construct a variant alternative in-place given its index.

Parameters
indexstd::in_place_index<Index>, where Index is the alternative index to construct, which must be within the range of the variant's list of alternative types.
argsarguments to pass to the underlying value's constructor.
Exceptions
anyexception thrown by the underlying constructor of the relevant alternative type.

◆ Variant() [6/8]

template<std::size_t Index, typename U, typename... Args>
requires (Index < sizeof...(Ts) && std::is_constructible_v<variant_alternative_t<Index, Variant>, std::initializer_list<U>&, Args...>)
grem::Variant< Ts >::Variant ( std::in_place_index_t< Index > index,
std::initializer_list< U > ilist,
Args &&... args )
inlineexplicitconstexpr

Construct a variant alternative in-place given its index, with an initializer list as the first constructor argument.

Parameters
indexstd::in_place_index<Index>, where Index is the alternative index to construct, which must be within the range of the variant's list of alternative types.
ilistfirst argument to pass to the underlying value's constructor.
argssubsequent arguments to pass to the underlying value's constructor.
Exceptions
anyexception thrown by the underlying constructor of the relevant alternative type.

◆ Variant() [7/8]

grem::Variant< Ts >::Variant ( const Variant & other)
constexprdelete

Deleted copy constructor.

◆ Variant() [8/8]

grem::Variant< Ts >::Variant ( Variant && other)
constexprdefaultnoexcept

Trivial move constructor.


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