cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumGltf::TexCoordFromAccessor Struct Reference

#include <CesiumGltf/AccessorUtility.h>

Public Member Functions

std::optional< glm::dvec2 > operator() (const AccessorView< AccessorTypes::VEC2< float > > &value)
 Attempts to obtain a glm::dvec2 at the given index from an accessor over a vec2 of floats. If the index is invalid, std::nullopt is returned instead.
 
template<typename T >
std::optional< glm::dvec2 > operator() (const AccessorView< AccessorTypes::VEC2< T > > &value)
 Attempts to obtain a glm::dvec2 at the given index from an accessor over a vec2. The values will be cast to double and normalized based on std::numeric_limits<T>::max(). If the index is invalid, std::nullopt is returned instead.
 

Public Attributes

int64_t index
 The index of texcoords to obtain.
 

Detailed Description

Visitor that retrieves the texture coordinates from the given accessor type as a glm::dvec2. This should be initialized with the target index.

There are technically no invalid UV values because of clamp / wrap behavior, so we use std::nullopt to denote an erroneous value.

Definition at line 319 of file AccessorUtility.h.

Member Function Documentation

◆ operator()() [1/2]

std::optional< glm::dvec2 > CesiumGltf::TexCoordFromAccessor::operator() ( const AccessorView< AccessorTypes::VEC2< float > > & value)
inline

Attempts to obtain a glm::dvec2 at the given index from an accessor over a vec2 of floats. If the index is invalid, std::nullopt is returned instead.

Definition at line 326 of file AccessorUtility.h.

◆ operator()() [2/2]

template<typename T >
std::optional< glm::dvec2 > CesiumGltf::TexCoordFromAccessor::operator() ( const AccessorView< AccessorTypes::VEC2< T > > & value)
inline

Attempts to obtain a glm::dvec2 at the given index from an accessor over a vec2. The values will be cast to double and normalized based on std::numeric_limits<T>::max(). If the index is invalid, std::nullopt is returned instead.

Definition at line 342 of file AccessorUtility.h.

Member Data Documentation

◆ index

int64_t CesiumGltf::TexCoordFromAccessor::index

The index of texcoords to obtain.

Definition at line 358 of file AccessorUtility.h.


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