JunkBox_Lib++ (for Windows) 1.10.1
Loading...
Searching...
No Matches
GLTFDataTool.h File Reference
#include "tools++.h"
#include "txml.h"
#include "tjson.h"
#include "TriBrep.h"
#include "Rotation.h"
#include "ContourBaseData.h"
#include "MaterialParam.h"
#include "MeshObjectData.h"
Include dependency graph for GLTFDataTool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gltfFacetMinMax
 
struct  glbFileHeader
 
struct  glbDataChunk
 
struct  glbTextureInfo
 
class  GLTFShellNode
 
class  GLTFData
 

Namespaces

namespace  jbxl
 

Macros

#define JBXL_GLTF_COPYRIGHT   "glTF/glb"
 
#define JBXL_GLTF_GENERATOR   "JBXL glTF/glb Tool Library (C) 2024 v1.0 by Fumi.Iseki and Austin Tate"
 
#define JBXL_GLTF_VERSION   "2.0"
 
#define JBXL_GLB_HEADER   "glTF"
 
#define JBXL_GLB_VERSION   2.0
 
#define JBXL_GLB_TYPE_JSON   "JSON"
 
#define JBXL_GLB_TYPE_BIN   "BIN\0"
 
#define JBXL_GLTF_BIN_AOS   1
 
#define JBXL_GLTF_BIN_SOA   2
 
#define JBXL_GLB_ACCESSORS_PNG_IMAGE   "{\"bufferView\":%d,\"mimeType\":\"image/png\"}"
 
#define JBXL_GLB_ACCESSORS_JPEG_IMAGE   "{\"bufferView\":%d,\"mimeType\":\"image/jpeg\"}"
 
#define JBXL_GLTF_BUFFERS_BIN   "{\"uri\":\"%s\",\"byteLength\":%u}"
 
#define JBXL_GLTF_BUFFERS_B64   "{\"uri\":\"data:application/octet-stream;base64,%s\",\"byteLength\":%u}"
 
#define JBXL_GLTF_VIEWS   "{\"buffer\":%d,\"byteOffset\":%u,\"byteLength\":%u,\"byteStride\":%u,\"target\":34962}"
 
#define JBXL_GLTF_VIEWS_ELEMENT   "{\"buffer\":%d,\"byteOffset\":%u,\"byteLength\":%u,\"target\":34963}"
 
#define JBXL_GLTF_VIEWS_DATA   "{\"buffer\":%d,\"byteOffset\":%u,\"byteLength\":%u}"
 
#define JBXL_GLTF_ACCESSORS   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\"}"
 
#define JBXL_GLTF_ACCESSORS_S   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\",\"max\":[%d],\"min\":[%d]}"
 
#define JBXL_GLTF_ACCESSORS_V2   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\",\"max\":[%f,%f],\"min\":[%f,%f]}"
 
#define JBXL_GLTF_ACCESSORS_V3   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\",\"max\":[%f,%f,%f],\"min\":[%f,%f,%f]}"
 
#define JBXL_GLTF_NODES_ROOT   "{\"name\":\"Root\"}"
 
#define JBXL_GLTF_NODES_ARMATURE   "{\"name\":\"Armature\"}"
 
#define JBXL_GLTF_NODES_MESH   "{\"name\":\"%s\",\"mesh\":%d}"
 
#define JBXL_GLTF_NODES_SKIN   "{\"skin\":%d}"
 
#define JBXL_GLTF_NODES_SKLTN   "{\"name\":%s}"
 
#define JBXL_GLTF_MESHES_PRIM   "{\"indices\":%d,\"attributes\":{\"POSITION\":%d,\"NORMAL\":%d,\"TEXCOORD_0\":%d},\"material\":%d,\"mode\":4}"
 
#define JBXL_GLTF_MESHES_PRIM_JW   "{\"indices\":%d,\"attributes\":{\"POSITION\":%d,\"NORMAL\":%d,\"TEXCOORD_0\":%d,\"JOINTS_0\":%d,\"WEIGHTS_0\":%d},\"material\":%d,\"mode\":4}"
 
#define JBXL_GLTF_SKINS   "{\"inverseBindMatrices\":%d,\"skeleton\":%d}"
 
#define JBXL_GLTF_TEXTURES   "{\"source\":%d}"
 
#define JBXL_GLTF_IMAGES   "{\"uri\":\"%s\"}"
 
#define JBXL_GLTF_MTLS_NAME_PBR   "{\"name\":\"%s\",\"pbrMetallicRoughness\":{\"baseColorTexture\":{\"index\":%d,\"texCoord\":0}}}"
 
#define JBXL_GLTF_MTLS_BCOLORF   "{\"baseColorFactor\":[%f,%f,%f,%f]}"
 
#define JBXL_GLTF_MTLS_METALF   "{\"metallicFactor\":%f}"
 
#define JBXL_GLTF_MTLS_ROUGHF   "{\"roughnessFactor\":%f}"
 
#define JBXL_GLTF_MTLS_CUTOFF   "{\"alphaCutoff\":%f}"
 
#define JBXL_GLTF_MTLS_EMISSIVE   "{\"emissiveFactor\":[%f,%f,%f]}"
 

Functions

void freeGLTFData (GLTFData *gltf)
 

Macro Definition Documentation

◆ JBXL_GLB_ACCESSORS_JPEG_IMAGE

#define JBXL_GLB_ACCESSORS_JPEG_IMAGE   "{\"bufferView\":%d,\"mimeType\":\"image/jpeg\"}"

Definition at line 39 of file GLTFDataTool.h.

◆ JBXL_GLB_ACCESSORS_PNG_IMAGE

#define JBXL_GLB_ACCESSORS_PNG_IMAGE   "{\"bufferView\":%d,\"mimeType\":\"image/png\"}"

Definition at line 38 of file GLTFDataTool.h.

Referenced by GLTFData::convertJson_gltf2glb().

◆ JBXL_GLB_HEADER

#define JBXL_GLB_HEADER   "glTF"

Definition at line 28 of file GLTFDataTool.h.

Referenced by GLTFData::output_glb().

◆ JBXL_GLB_TYPE_BIN

#define JBXL_GLB_TYPE_BIN   "BIN\0"

Definition at line 31 of file GLTFDataTool.h.

Referenced by GLTFData::output_glb().

◆ JBXL_GLB_TYPE_JSON

#define JBXL_GLB_TYPE_JSON   "JSON"

Definition at line 30 of file GLTFDataTool.h.

Referenced by GLTFData::output_glb().

◆ JBXL_GLB_VERSION

#define JBXL_GLB_VERSION   2.0

Definition at line 29 of file GLTFDataTool.h.

◆ JBXL_GLTF_ACCESSORS

#define JBXL_GLTF_ACCESSORS   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\"}"

◆ JBXL_GLTF_ACCESSORS_S

#define JBXL_GLTF_ACCESSORS_S   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\",\"max\":[%d],\"min\":[%d]}"

Definition at line 50 of file GLTFDataTool.h.

◆ JBXL_GLTF_ACCESSORS_V2

#define JBXL_GLTF_ACCESSORS_V2   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\",\"max\":[%f,%f],\"min\":[%f,%f]}"

Definition at line 51 of file GLTFDataTool.h.

◆ JBXL_GLTF_ACCESSORS_V3

#define JBXL_GLTF_ACCESSORS_V3   "{\"bufferView\":%d,\"byteOffset\":%u,\"componentType\":%d,\"count\":%d,\"type\":\"%s\",\"max\":[%f,%f,%f],\"min\":[%f,%f,%f]}"

Definition at line 52 of file GLTFDataTool.h.

Referenced by GLTFData::addAccessorsAoS(), and GLTFData::addAccessorsSoA().

◆ JBXL_GLTF_BIN_AOS

#define JBXL_GLTF_BIN_AOS   1

Definition at line 33 of file GLTFDataTool.h.

Referenced by GLTFData::addShell(), and GLTFData::closeSolid().

◆ JBXL_GLTF_BIN_SOA

#define JBXL_GLTF_BIN_SOA   2

Definition at line 34 of file GLTFDataTool.h.

Referenced by GLTFData::init().

◆ JBXL_GLTF_BUFFERS_B64

#define JBXL_GLTF_BUFFERS_B64   "{\"uri\":\"data:application/octet-stream;base64,%s\",\"byteLength\":%u}"

Definition at line 42 of file GLTFDataTool.h.

◆ JBXL_GLTF_BUFFERS_BIN

#define JBXL_GLTF_BUFFERS_BIN   "{\"uri\":\"%s\",\"byteLength\":%u}"

Definition at line 41 of file GLTFDataTool.h.

Referenced by GLTFData::output_glb(), and GLTFData::output_gltf().

◆ JBXL_GLTF_COPYRIGHT

#define JBXL_GLTF_COPYRIGHT   "glTF/glb"

Definition at line 24 of file GLTFDataTool.h.

Referenced by GLTFData::initGLTF().

◆ JBXL_GLTF_GENERATOR

#define JBXL_GLTF_GENERATOR   "JBXL glTF/glb Tool Library (C) 2024 v1.0 by Fumi.Iseki and Austin Tate"

Definition at line 25 of file GLTFDataTool.h.

Referenced by GLTFData::initGLTF().

◆ JBXL_GLTF_IMAGES

#define JBXL_GLTF_IMAGES   "{\"uri\":\"%s\"}"

Definition at line 67 of file GLTFDataTool.h.

Referenced by GLTFData::addTextures().

◆ JBXL_GLTF_MESHES_PRIM

#define JBXL_GLTF_MESHES_PRIM   "{\"indices\":%d,\"attributes\":{\"POSITION\":%d,\"NORMAL\":%d,\"TEXCOORD_0\":%d},\"material\":%d,\"mode\":4}"

Definition at line 60 of file GLTFDataTool.h.

Referenced by GLTFData::addMeshes().

◆ JBXL_GLTF_MESHES_PRIM_JW

#define JBXL_GLTF_MESHES_PRIM_JW   "{\"indices\":%d,\"attributes\":{\"POSITION\":%d,\"NORMAL\":%d,\"TEXCOORD_0\":%d,\"JOINTS_0\":%d,\"WEIGHTS_0\":%d},\"material\":%d,\"mode\":4}"

Definition at line 61 of file GLTFDataTool.h.

Referenced by GLTFData::addMeshes().

◆ JBXL_GLTF_MTLS_BCOLORF

#define JBXL_GLTF_MTLS_BCOLORF   "{\"baseColorFactor\":[%f,%f,%f,%f]}"

Definition at line 70 of file GLTFDataTool.h.

Referenced by GLTFData::addMaterialParameters().

◆ JBXL_GLTF_MTLS_CUTOFF

#define JBXL_GLTF_MTLS_CUTOFF   "{\"alphaCutoff\":%f}"

Definition at line 74 of file GLTFDataTool.h.

Referenced by GLTFData::addMaterialParameters().

◆ JBXL_GLTF_MTLS_EMISSIVE

#define JBXL_GLTF_MTLS_EMISSIVE   "{\"emissiveFactor\":[%f,%f,%f]}"

Definition at line 75 of file GLTFDataTool.h.

Referenced by GLTFData::addMaterialParameters().

◆ JBXL_GLTF_MTLS_METALF

#define JBXL_GLTF_MTLS_METALF   "{\"metallicFactor\":%f}"

Definition at line 71 of file GLTFDataTool.h.

◆ JBXL_GLTF_MTLS_NAME_PBR

#define JBXL_GLTF_MTLS_NAME_PBR   "{\"name\":\"%s\",\"pbrMetallicRoughness\":{\"baseColorTexture\":{\"index\":%d,\"texCoord\":0}}}"

Definition at line 69 of file GLTFDataTool.h.

Referenced by GLTFData::addMaterials().

◆ JBXL_GLTF_MTLS_ROUGHF

#define JBXL_GLTF_MTLS_ROUGHF   "{\"roughnessFactor\":%f}"

Definition at line 72 of file GLTFDataTool.h.

Referenced by GLTFData::addMaterialParameters().

◆ JBXL_GLTF_NODES_ARMATURE

#define JBXL_GLTF_NODES_ARMATURE   "{\"name\":\"Armature\"}"

Definition at line 55 of file GLTFDataTool.h.

Referenced by GLTFData::addSkeletonNodes().

◆ JBXL_GLTF_NODES_MESH

#define JBXL_GLTF_NODES_MESH   "{\"name\":\"%s\",\"mesh\":%d}"

Definition at line 56 of file GLTFDataTool.h.

Referenced by GLTFData::addNodes().

◆ JBXL_GLTF_NODES_ROOT

#define JBXL_GLTF_NODES_ROOT   "{\"name\":\"Root\"}"

Definition at line 54 of file GLTFDataTool.h.

Referenced by GLTFData::addRootNode().

◆ JBXL_GLTF_NODES_SKIN

#define JBXL_GLTF_NODES_SKIN   "{\"skin\":%d}"

Definition at line 57 of file GLTFDataTool.h.

Referenced by GLTFData::addNodes().

◆ JBXL_GLTF_NODES_SKLTN

#define JBXL_GLTF_NODES_SKLTN   "{\"name\":%s}"

Definition at line 58 of file GLTFDataTool.h.

Referenced by GLTFData::addSkeletonNodes().

◆ JBXL_GLTF_SKINS

#define JBXL_GLTF_SKINS   "{\"inverseBindMatrices\":%d,\"skeleton\":%d}"

Definition at line 62 of file GLTFDataTool.h.

Referenced by GLTFData::addSkins().

◆ JBXL_GLTF_TEXTURES

#define JBXL_GLTF_TEXTURES   "{\"source\":%d}"

Definition at line 65 of file GLTFDataTool.h.

Referenced by GLTFData::addTextures().

◆ JBXL_GLTF_VERSION

#define JBXL_GLTF_VERSION   "2.0"

Definition at line 26 of file GLTFDataTool.h.

Referenced by GLTFData::initGLTF().

◆ JBXL_GLTF_VIEWS

#define JBXL_GLTF_VIEWS   "{\"buffer\":%d,\"byteOffset\":%u,\"byteLength\":%u,\"byteStride\":%u,\"target\":34962}"

Definition at line 44 of file GLTFDataTool.h.

Referenced by GLTFData::addBufferViewsAoS(), and GLTFData::addBufferViewsSoA().

◆ JBXL_GLTF_VIEWS_DATA

#define JBXL_GLTF_VIEWS_DATA   "{\"buffer\":%d,\"byteOffset\":%u,\"byteLength\":%u}"

Definition at line 47 of file GLTFDataTool.h.

Referenced by GLTFData::addBufferViewsIBM(), and GLTFData::convertJson_gltf2glb().

◆ JBXL_GLTF_VIEWS_ELEMENT

#define JBXL_GLTF_VIEWS_ELEMENT   "{\"buffer\":%d,\"byteOffset\":%u,\"byteLength\":%u,\"target\":34963}"

Definition at line 45 of file GLTFDataTool.h.

Referenced by GLTFData::addBufferViewsAoS(), and GLTFData::addBufferViewsSoA().