cesium-native 0.62.0
Loading...
Searching...
No Matches
CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataVecN< TTo >::value &&CesiumGltf::IsMetadataScalar< TFrom >::value > > Struct Template Reference

Converts from a scalar type to a vecN. More...

#include <CesiumGltf/MetadataConversions.h>

Static Public Member Functions

static std::optional< TTo > convert (TFrom from)
 Converts a scalar to a vecN. The returned vector is initialized with the value in all of its components. The value may lose precision during conversion depending on the type of the scalar and the component type of the matrix.
 
static std::optional< TTo > convert (TFrom)
 Converts between TFrom and TTo where no actual conversion is defined, returning std::nullopt.
 

Detailed Description

template<typename TTo, typename TFrom>
struct CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataVecN< TTo >::value &&CesiumGltf::IsMetadataScalar< TFrom >::value > >

Converts from a scalar type to a vecN.

Definition at line 666 of file MetadataConversions.h.

Member Function Documentation

◆ convert() [1/2]

template<typename TTo, typename TFrom>
static std::optional< TTo > CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataVecN< TTo >::value &&CesiumGltf::IsMetadataScalar< TFrom >::value > >::convert ( TFrom from)
inlinestatic

Converts a scalar to a vecN. The returned vector is initialized with the value in all of its components. The value may lose precision during conversion depending on the type of the scalar and the component type of the matrix.

If the scalar cannot be reasonably converted to the component type of the vecN, std::nullopt is returned.

Parameters
fromThe scalar value to be converted.

Definition at line 683 of file MetadataConversions.h.

◆ convert() [2/2]

static std::optional< TTo > CesiumGltf::MetadataConversions< TTo, TFrom, std::enable_if_t< CesiumGltf::IsMetadataVecN< TTo >::value &&CesiumGltf::IsMetadataScalar< TFrom >::value > >::convert ( TFrom )
inlinestatic

Converts between TFrom and TTo where no actual conversion is defined, returning std::nullopt.

Definition at line 26 of file MetadataConversions.h.


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