    

 ## On this page

  

 

 # GLTFNode

 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\_GLTFNODE\_\_

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

<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 Nexus { namespace GLTFWriter {

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

<a id="l00021" name="l00021"></a> 21 class Camera;

<a id="l00022" name="l00022"></a> 22 class Legend;

<a id="l00023" name="l00023"></a> 23 class Light;

<a id="l00024" name="l00024"></a> 24 class Mesh;

<a id="l00025" name="l00025"></a> 25 class Image;

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

<a id="l00030" name="l00030"></a>[ 30](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) class [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) : public Object

<a id="l00031" name="l00031"></a> 31 {

<a id="l00032" name="l00032"></a> 32 protected:

<a id="l00033" name="l00033"></a> 33 virtual [~Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml)() {}

<a id="l00034" name="l00034"></a> 34 

<a id="l00035" name="l00035"></a> 35 public:

<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_node.xhtml#a971f3f45763d2ffea46ff200533f3a9a) static GLTFWRITERSPEC [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) *[CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a971f3f45763d2ffea46ff200533f3a9a)([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="l00043" name="l00043"></a> 43 const char *name = 0, 

<a id="l00044" name="l00044"></a> 44 bool visible = true, 

<a id="l00045" name="l00045"></a> 45 const double *matrix = 0 

<a id="l00046" name="l00046"></a> 46 );

<a id="l00051" name="l00051"></a>[ 51](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a0661ea032f468ce3b160d7c6b3881af7) static GLTFWRITERSPEC [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) *[CreateCamera](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a0661ea032f468ce3b160d7c6b3881af7)([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="l00052" name="l00052"></a> 52 [Camera](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_camera.xhtml) *camera, 

<a id="l00053" name="l00053"></a> 53 const char *name = 0, 

<a id="l00054" name="l00054"></a> 54 const double *matrix = 0 

<a id="l00055" name="l00055"></a> 55 );

<a id="l00057" name="l00057"></a>[ 57](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a9072424318811c6d563d515286d954c6) static GLTFWRITERSPEC [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) *[CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a9072424318811c6d563d515286d954c6)([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="l00058" name="l00058"></a> 58 [Legend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml) *legend, 

<a id="l00059" name="l00059"></a> 59 const char *name = 0, 

<a id="l00060" name="l00060"></a> 60 bool visible = true 

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

<a id="l00068" name="l00068"></a>[ 68](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af4830c613f678819db3aa3773ff8b49a) static GLTFWRITERSPEC [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) *[CreateLight](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af4830c613f678819db3aa3773ff8b49a)([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="l00069" name="l00069"></a> 69 );

<a id="l00073" name="l00073"></a>[ 73](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af105702b586195877db62a761c263d3f) static GLTFWRITERSPEC [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml)* [CreateProxyImage](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af105702b586195877db62a761c263d3f)([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="l00074" name="l00074"></a> 74 [Image](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_image.xhtml)* image, 

<a id="l00075" name="l00075"></a> 75 const char* name = 0 

<a id="l00076" name="l00076"></a> 76 );

<a id="l00077" name="l00077"></a> 77 

<a id="l00080" name="l00080"></a>[ 80](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a85f627158b9e2f1a6565ffe1305e7439) GLTFWRITERSPEC virtual bool [AppendChild](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a85f627158b9e2f1a6565ffe1305e7439)([Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) *node 

<a id="l00081" name="l00081"></a> 81 ) = 0;

<a id="l00084" name="l00084"></a>[ 84](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a353d1047251b29924de156f23e3f911a) GLTFWRITERSPEC virtual unsigned int [NumChildren](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a353d1047251b29924de156f23e3f911a)() const = 0;

<a id="l00087" name="l00087"></a>[ 87](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a29e43db3c3bd933a51c2e99e223e41bd) GLTFWRITERSPEC virtual bool [AppendMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a29e43db3c3bd933a51c2e99e223e41bd)([Mesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml) *mesh 

<a id="l00088" name="l00088"></a> 88 ) = 0;

<a id="l00091" name="l00091"></a>[ 91](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a9bcc098d4b34c70e49e1b898b5d995bc) GLTFWRITERSPEC virtual unsigned int [NumMeshes](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a9bcc098d4b34c70e49e1b898b5d995bc)() const = 0;

<a id="l00096" name="l00096"></a>[ 96](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a229725aed9694dd14f7023d5445bbc72) GLTFWRITERSPEC virtual bool [AppendLight](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a229725aed9694dd14f7023d5445bbc72)([Light](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_light.xhtml) *light 

<a id="l00097" name="l00097"></a> 97 ) = 0;

<a id="l00098" name="l00098"></a> 98 };

<a id="l00099" name="l00099"></a> 99 

<a id="l00100" name="l00100"></a> 100} } }

<a id="l00101" name="l00101"></a> 101 

<a id="l00102" name="l00102"></a> 102\#endif

[ANSYS::Nexus::GLTFWriter::Camera](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_camera.xhtml)

Cameras define an orthographic or perspective projection of the scene.

**Definition:** [GLTFCamera.h:28](_g_l_t_f_camera_8h_source.xhtml#l00027)



[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::Image](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_image.xhtml)

Images define texture data.

**Definition:** [GLTFImage.h:27](_g_l_t_f_image_8h_source.xhtml#l00026)



[ANSYS::Nexus::GLTFWriter::Legend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml)

Legends are colored bars with numbers at intervals along bar.

**Definition:** [GLTFLegend.h:27](_g_l_t_f_legend_8h_source.xhtml#l00026)



[ANSYS::Nexus::GLTFWriter::Light](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_light.xhtml)

Lights define the light objects that can be added to a light node.

**Definition:** [GLTFLight.h:31](_g_l_t_f_light_8h_source.xhtml#l00030)



[ANSYS::Nexus::GLTFWriter::Mesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml)

Meshes define the renderable objects that can be added to a node.

**Definition:** [GLTFMesh.h:104](_g_l_t_f_mesh_8h_source.xhtml#l00103)



[ANSYS::Nexus::GLTFWriter::Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml)

Nodes are the GLTFWriter class that contain the data that is defined in the GLTF file.

**Definition:** [GLTFNode.h:31](_g_l_t_f_node_8h_source.xhtml#l00030)



[ANSYS::Nexus::GLTFWriter::Node::CreateCamera](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a0661ea032f468ce3b160d7c6b3881af7)

static Node * CreateCamera(GLTF *gltf, Camera *camera, const char *name=0, const double *matrix=0)



[ANSYS::Nexus::GLTFWriter::Node::AppendLight](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a229725aed9694dd14f7023d5445bbc72)

virtual bool AppendLight(Light *light)=0



[ANSYS::Nexus::GLTFWriter::Node::AppendMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a29e43db3c3bd933a51c2e99e223e41bd)

virtual bool AppendMesh(Mesh *mesh)=0



[ANSYS::Nexus::GLTFWriter::Node::NumChildren](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a353d1047251b29924de156f23e3f911a)

virtual unsigned int NumChildren() const =0



[ANSYS::Nexus::GLTFWriter::Node::AppendChild](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a85f627158b9e2f1a6565ffe1305e7439)

virtual bool AppendChild(Node *node)=0



[ANSYS::Nexus::GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a9072424318811c6d563d515286d954c6)

static Node * CreateLegend(GLTF *gltf, Legend *legend, const char *name=0, bool visible=true)



[ANSYS::Nexus::GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a971f3f45763d2ffea46ff200533f3a9a)

static Node * CreateMesh(GLTF *gltf, const char *name=0, bool visible=true, const double *matrix=0)



[ANSYS::Nexus::GLTFWriter::Node::NumMeshes](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a9bcc098d4b34c70e49e1b898b5d995bc)

virtual unsigned int NumMeshes() const =0



[ANSYS::Nexus::GLTFWriter::Node::CreateProxyImage](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af105702b586195877db62a761c263d3f)

static Node * CreateProxyImage(GLTF *gltf, Image *image, const char *name=0)



[ANSYS::Nexus::GLTFWriter::Node::CreateLight](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af4830c613f678819db3aa3773ff8b49a)

static Node * CreateLight(GLTF *gltf)



[ANSYS](namespace_a_n_s_y_s.xhtml)

GLTFWriter API Documentation.

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