    

 ## On this page

  

 

 # GLTFSampler

 Last update: 16.07.2025 

<a id="l00001" name="l00001"></a> 1 /\*

<a id="l00002" name="l00002"></a> 2  \* Copyright 2018-2021 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.

<a id="l00003" name="l00003"></a> 3  \* 

<a id="l00004" name="l00004"></a> 4  \* Restricted Rights Legend

<a id="l00005" name="l00005"></a> 5  \*

<a id="l00006" name="l00006"></a> 6  \* Use, duplication, or disclosure of this

<a id="l00007" name="l00007"></a> 7  \* software and its documentation by the

<a id="l00008" name="l00008"></a> 8  \* Government is subject to restrictions as

<a id="l00009" name="l00009"></a> 9  \* set forth in subdivision \[(b)(3)(ii)\] of

<a id="l00010" name="l00010"></a> 10  \* the Rights in Technical Data and Computer

<a id="l00011" name="l00011"></a> 11  \* Software clause at 52.227-7013.

<a id="l00012" name="l00012"></a> 12  \*/

<a id="l00013" name="l00013"></a> 13 \#ifndef \_\_INCLUDED\_GLTF\_GLTFSAMPLER\_\_

<a id="l00014" name="l00014"></a> 14 \#define \_\_INCLUDED\_GLTF\_GLTFSAMPLER\_\_

<a id="l00015" name="l00015"></a> 15 

<a id="l00016" name="l00016"></a> 16 \#include "GLTFCommon.h"

<a id="l00017" name="l00017"></a> 17 \#include "GLTFObject.h"

<a id="l00018" name="l00018"></a> 18 

<a id="l00019" name="l00019"></a> 19 namespace [ANSYS](namespace_a_n_s_y_s.xhtml) { namespace Nexus { namespace GLTFWriter {

<a id="l00020" name="l00020"></a> 20 class GLTF;

<a id="l00021" name="l00021"></a> 21 

<a id="l00025" name="l00025"></a>[ 25](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml) class [Sampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml) : public Object

<a id="l00026" name="l00026"></a> 26 {

<a id="l00027" name="l00027"></a> 27 public:

<a id="l00029" name="l00029"></a>[ 29](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2) enum [FilterType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2)

<a id="l00030" name="l00030"></a> 30 {

<a id="l00031" name="l00031"></a>[ 31](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a6939890bb36dae2b7400ec07dda505a3) [FT\_NEAREST](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a6939890bb36dae2b7400ec07dda505a3) = 9728, 

<a id="l00032" name="l00032"></a>[ 32](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a540209ea328f7641ded2ef95340a4df6) [FT\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a540209ea328f7641ded2ef95340a4df6) = 9729, 

<a id="l00033" name="l00033"></a>[ 33](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a3ca339eb7d704e0df6a5a70a56e38a9d) [FT\_NEAREST\_MIPMAP\_NEAREST](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a3ca339eb7d704e0df6a5a70a56e38a9d) = 9984, 

<a id="l00034" name="l00034"></a>[ 34](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2adaf913049a73b76f655fee7017fd9735) [FT\_LINEAR\_MIPMAP\_NEAREST](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2adaf913049a73b76f655fee7017fd9735) = 9985, 

<a id="l00035" name="l00035"></a>[ 35](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2af04c2a7d89ec1932406044358213053f) [FT\_NEAREST\_MIPMAP\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2af04c2a7d89ec1932406044358213053f) = 9986, 

<a id="l00036" name="l00036"></a> 36 [FT\_LINEAR\_MIPMAP\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2aeecfdb00bdb01409d41812961fca2ad8) = 9987 

<a id="l00037" name="l00037"></a>[ 37](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2aeecfdb00bdb01409d41812961fca2ad8) };

<a id="l00039" name="l00039"></a>[ 39](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443) enum [WrapType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443)

<a id="l00040" name="l00040"></a> 40 {

<a id="l00041" name="l00041"></a>[ 41](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443a75e8a28a9d155e09ff6b697429fa7a6e) [WT\_REPEAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443a75e8a28a9d155e09ff6b697429fa7a6e) = 10497, 

<a id="l00042" name="l00042"></a>[ 42](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443a9edafbff43bdb6b2e77fab3fd1b545aa) [WT\_CLAMP\_TO\_EDGE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443a9edafbff43bdb6b2e77fab3fd1b545aa) = 33071, 

<a id="l00043" name="l00043"></a> 43 [WT\_MIRRORED\_REPEAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443ab8da208d3e57f59504472b848fc24952) = 33648 

<a id="l00044" name="l00044"></a>[ 44](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443ab8da208d3e57f59504472b848fc24952) };

<a id="l00045" name="l00045"></a> 45 

<a id="l00046" name="l00046"></a> 46 protected:

<a id="l00047" name="l00047"></a> 47 virtual ~[Sampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml)() {}

<a id="l00048" name="l00048"></a> 48 

<a id="l00049" name="l00049"></a> 49 public:

<a id="l00052" name="l00052"></a>[ 52](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a30994f53bd92cc4280ee7e77ab764758) static GLTFWRITERSPEC [Sampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml) *[Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a30994f53bd92cc4280ee7e77ab764758)([GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml) *gltf, 

<a id="l00053" name="l00053"></a> 53 [FilterType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2) minFilter, 

<a id="l00054" name="l00054"></a> 54 [FilterType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2) magFilter, 

<a id="l00055" name="l00055"></a> 55 [WrapType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443) wrapS, 

<a id="l00056" name="l00056"></a> 56 [WrapType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443) wrapT 

<a id="l00057" name="l00057"></a> 57 );

<a id="l00058" name="l00058"></a> 58 };

<a id="l00059" name="l00059"></a> 59 

<a id="l00060" name="l00060"></a> 60 } } }

<a id="l00061" name="l00061"></a> 61 

<a id="l00062" name="l00062"></a> 62 \#endif

[ANSYS::Nexus::GLTFWriter::GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml)

This is the main class of the GLTFWriter.

**Definition:** [GLTFGLTF.h:32](_g_l_t_f_g_l_t_f_8h_source.xhtml#l00031)



[ANSYS::Nexus::GLTFWriter::Sampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml)

Samplers define how values are generated from textures with the give texture coordinates.

**Definition:** [GLTFSampler.h:26](_g_l_t_f_sampler_8h_source.xhtml#l00025)



[ANSYS::Nexus::GLTFWriter::Sampler::WrapType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443)

WrapType

**Definition:** [GLTFSampler.h:40](_g_l_t_f_sampler_8h_source.xhtml#l00039)



[ANSYS::Nexus::GLTFWriter::Sampler::WT\_REPEAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443a75e8a28a9d155e09ff6b697429fa7a6e)

@ WT_REPEAT

Fractional value of texture coordinate is used.

**Definition:** [GLTFSampler.h:41](_g_l_t_f_sampler_8h_source.xhtml#l00041)



[ANSYS::Nexus::GLTFWriter::Sampler::WT\_CLAMP\_TO\_EDGE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443a9edafbff43bdb6b2e77fab3fd1b545aa)

@ WT_CLAMP_TO_EDGE

0 is used for texture coordinates &lt; 0 and 1 is used for texture coordinates &gt; 1.

**Definition:** [GLTFSampler.h:42](_g_l_t_f_sampler_8h_source.xhtml#l00042)



[ANSYS::Nexus::GLTFWriter::Sampler::WT\_MIRRORED\_REPEAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a0be78b3605d660441f31d5a90e463443ab8da208d3e57f59504472b848fc24952)

@ WT_MIRRORED_REPEAT

fractional value of texture coordinate is used, but value alternates going from 0 to 1 and [1 - (0 to...

**Definition:** [GLTFSampler.h:43](_g_l_t_f_sampler_8h_source.xhtml#l00044)



[ANSYS::Nexus::GLTFWriter::Sampler::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a30994f53bd92cc4280ee7e77ab764758)

static Sampler * Create(GLTF *gltf, FilterType minFilter, FilterType magFilter, WrapType wrapS, WrapType wrapT)



[ANSYS::Nexus::GLTFWriter::Sampler::FilterType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2)

FilterType

**Definition:** [GLTFSampler.h:30](_g_l_t_f_sampler_8h_source.xhtml#l00029)



[ANSYS::Nexus::GLTFWriter::Sampler::FT\_NEAREST\_MIPMAP\_NEAREST](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a3ca339eb7d704e0df6a5a70a56e38a9d)

@ FT_NEAREST_MIPMAP_NEAREST

Choose nearest texel in nearest mipmap.

**Definition:** [GLTFSampler.h:33](_g_l_t_f_sampler_8h_source.xhtml#l00033)



[ANSYS::Nexus::GLTFWriter::Sampler::FT\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a540209ea328f7641ded2ef95340a4df6)

@ FT_LINEAR

Linearly interpolate between the two nearest texels.

**Definition:** [GLTFSampler.h:32](_g_l_t_f_sampler_8h_source.xhtml#l00032)



[ANSYS::Nexus::GLTFWriter::Sampler::FT\_NEAREST](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2a6939890bb36dae2b7400ec07dda505a3)

@ FT_NEAREST

Choose nearest texel.

**Definition:** [GLTFSampler.h:31](_g_l_t_f_sampler_8h_source.xhtml#l00031)



[ANSYS::Nexus::GLTFWriter::Sampler::FT\_LINEAR\_MIPMAP\_NEAREST](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2adaf913049a73b76f655fee7017fd9735)

@ FT_LINEAR_MIPMAP_NEAREST

Linearly interpolate between the two nearest texels of the nearest mipmap.

**Definition:** [GLTFSampler.h:34](_g_l_t_f_sampler_8h_source.xhtml#l00034)



[ANSYS::Nexus::GLTFWriter::Sampler::FT\_LINEAR\_MIPMAP\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2aeecfdb00bdb01409d41812961fca2ad8)

@ FT_LINEAR_MIPMAP_LINEAR

Linearly interpolate between the two nearest texels in the linearly interpolated mipmap between two n...

**Definition:** [GLTFSampler.h:36](_g_l_t_f_sampler_8h_source.xhtml#l00037)



[ANSYS::Nexus::GLTFWriter::Sampler::FT\_NEAREST\_MIPMAP\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a55783834d84736df773ee55e1e9068f2af04c2a7d89ec1932406044358213053f)

@ FT_NEAREST_MIPMAP_LINEAR

Choose nearest texel in linearly interpolated mipmap between two nearest mipmaps.

**Definition:** [GLTFSampler.h:35](_g_l_t_f_sampler_8h_source.xhtml#l00035)



[ANSYS](namespace_a_n_s_y_s.xhtml)

GLTFWriter API Documentation.

**Definition:** [GLTFAnimation.h:19](_g_l_t_f_animation_8h_source.xhtml#l00019)