    

 ## 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> 19namespace [ANSYS](namespace_a_n_s_y_s.xhtml) { namespace AVZ { 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_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml) class [Sampler](class_a_n_s_y_s_1_1_a_v_z_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_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7) enum [FilterType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<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_a_v_z_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_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#aa22201a92b9368c6ef996cfec50cfa07) static GLTFWRITERSPEC [Sampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml) *[Create](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#aa22201a92b9368c6ef996cfec50cfa07)([GLTF](class_a_n_s_y_s_1_1_a_v_z_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_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7) minFilter, 

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

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

<a id="l00056" name="l00056"></a> 56 [WrapType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a8e5e0b3dbe97502545bab842604c314e) 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::AVZ::GLTFWriter::GLTF](class_a_n_s_y_s_1_1_a_v_z_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::AVZ::GLTFWriter::Sampler](class_a_n_s_y_s_1_1_a_v_z_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::AVZ::GLTFWriter::Sampler::WrapType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a8e5e0b3dbe97502545bab842604c314e)

WrapType

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



[ANSYS::AVZ::GLTFWriter::Sampler::WT\_CLAMP\_TO\_EDGE](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a8e5e0b3dbe97502545bab842604c314ea7ee5d7d400880893f22ccf18a98a46b2)

@ 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::AVZ::GLTFWriter::Sampler::WT\_REPEAT](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a8e5e0b3dbe97502545bab842604c314ead109b60cfc9bbbb3b127d2c657f243e3)

@ WT_REPEAT

Fractional value of texture coordinate is used.

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



[ANSYS::AVZ::GLTFWriter::Sampler::WT\_MIRRORED\_REPEAT](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#a8e5e0b3dbe97502545bab842604c314eafea1c17edee1c96dd316536a292963f1)

@ 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::AVZ::GLTFWriter::Sampler::Create](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#aa22201a92b9368c6ef996cfec50cfa07)

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



[ANSYS::AVZ::GLTFWriter::Sampler::FilterType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7)

FilterType

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



[ANSYS::AVZ::GLTFWriter::Sampler::FT\_LINEAR](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7a00da2bd2c3f6389c83b221bb46a13e38)

@ FT_LINEAR

Linearly interpolate between the two nearest texels.

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



[ANSYS::AVZ::GLTFWriter::Sampler::FT\_LINEAR\_MIPMAP\_LINEAR](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7a587bcfcc7e376dbfcf0e614500224d83)

@ 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::AVZ::GLTFWriter::Sampler::FT\_NEAREST\_MIPMAP\_LINEAR](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7a979cf2f946060a8d99bd868d2e9e6d5b)

@ 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::AVZ::GLTFWriter::Sampler::FT\_LINEAR\_MIPMAP\_NEAREST](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7ab5b7f99f3cb2f01e6b67a61e2dc41f8f)

@ 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::AVZ::GLTFWriter::Sampler::FT\_NEAREST\_MIPMAP\_NEAREST](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7ac4445c73f3de4dd656e03b2c0bca2e33)

@ FT_NEAREST_MIPMAP_NEAREST

Choose nearest texel in nearest mipmap.

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



[ANSYS::AVZ::GLTFWriter::Sampler::FT\_NEAREST](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_sampler.xhtml#ad6e1c2114d7b97b1b087fc97326843b7acd3c6a961467beb0a99dae179d05f718)

@ FT_NEAREST

Choose nearest texel.

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



[ANSYS](namespace_a_n_s_y_s.xhtml)

GLTFWriter API Documentation.

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