Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData Struct Reference

Geometry, material, and optional skinning data parsed from one glTF primitive. More...

#include <GltfLoader.h>

Collaboration diagram for Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData:

Public Member Functions

 GltfMeshPrimitiveData ()=default
 Creates empty primitive data.
 GltfMeshPrimitiveData (tinygltf::Model model, tinygltf::Primitive primitive, StaticMeshExtensions meshSettings)
 Extracts primitive geometry and material data from tinygltf objects.
std::vector< Vertex > getVertices () const
 Gets the vertices parsed for this primitive.
std::vector< uint32_t > getIndices () const
 Gets local primitive indices.
GltfMaterialData getMaterialData () const
 Gets material data parsed for this primitive.
RuntimeTexture * getColorTexturePtr () const
 Gets the pointer to the primitive of the color texture.
uint32_t getColorTextureIndex () const
 Gets the glTF color texture index referenced by this primitive.
const std::vector< BoneVertexData > & getBoneVertexData () const
 Gets per-vertex bone weights and joint indices.
bool hasSkinData () const
 Checks whether this primitive has skinning data.

Private Attributes

uint32_t textureIndex = std::numeric_limits<uint32_t>::max()
RuntimeTexture * colorTexturePtr = nullptr
tinygltf::Primitive primitive
GltfMaterialData materialData
std::vector< Vertex > vertices
std::vector< uint32_t > indices
std::vector< BoneVertexData > boneVertexData
 Empty for static meshes.

Detailed Description

Geometry, material, and optional skinning data parsed from one glTF primitive.

Definition at line 1068 of file GltfLoader.h.

Constructor & Destructor Documentation

◆ GltfMeshPrimitiveData() [1/2]

Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::GltfMeshPrimitiveData ( )
default

Creates empty primitive data.

◆ GltfMeshPrimitiveData() [2/2]

Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::GltfMeshPrimitiveData ( tinygltf::Model model,
tinygltf::Primitive primitive,
StaticMeshExtensions meshSettings )

Extracts primitive geometry and material data from tinygltf objects.

Parameters
modelSource glTF model.
primitivePrimitive to parse.
meshSettingsParsed mesh or node extension data.

References primitive.

Member Function Documentation

◆ getBoneVertexData()

const std::vector< BoneVertexData > & Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::getBoneVertexData ( ) const
inlinenodiscard

Gets per-vertex bone weights and joint indices.

Returns
Bone vertex data. Empty for static mesh primitives.

Definition at line 1127 of file GltfLoader.h.

References boneVertexData.

◆ getColorTextureIndex()

uint32_t Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::getColorTextureIndex ( ) const
nodiscard

Gets the glTF color texture index referenced by this primitive.

Returns
Texture index, or std::numeric_limits<uint32_t>::max() when no texture is present.

◆ getColorTexturePtr()

RuntimeTexture * Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::getColorTexturePtr ( ) const
nodiscard

Gets the pointer to the primitive of the color texture.

This is only a valid pointer after it has been set by the asset manager.

Returns
Pointer to the runtime color texture, or nullptr before the asset manager resolves it.

◆ getIndices()

std::vector< uint32_t > Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::getIndices ( ) const
nodiscard

Gets local primitive indices.

Returns
Index list that forms the primitive triangles.

◆ getMaterialData()

GltfMaterialData Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::getMaterialData ( ) const
nodiscard

Gets material data parsed for this primitive.

Returns
Material data extracted from the glTF material and engine extensions.

◆ getVertices()

std::vector< Vertex > Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::getVertices ( ) const
nodiscard

Gets the vertices parsed for this primitive.

Returns
Vertex list for this primitive.

◆ hasSkinData()

bool Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::hasSkinData ( ) const
inlinenodiscard

Checks whether this primitive has skinning data.

Returns
True when bone vertex data was parsed.

Definition at line 1136 of file GltfLoader.h.

References boneVertexData.

Member Data Documentation

◆ boneVertexData

std::vector<BoneVertexData> Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::boneVertexData
private

Empty for static meshes.

Definition at line 1149 of file GltfLoader.h.

Referenced by getBoneVertexData(), and hasSkinData().

◆ colorTexturePtr

RuntimeTexture* Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::colorTexturePtr = nullptr
private

Definition at line 1143 of file GltfLoader.h.

◆ indices

std::vector<uint32_t> Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::indices
private

Definition at line 1148 of file GltfLoader.h.

◆ materialData

GltfMaterialData Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::materialData
private

Definition at line 1146 of file GltfLoader.h.

◆ primitive

tinygltf::Primitive Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::primitive
private

Definition at line 1145 of file GltfLoader.h.

Referenced by GltfMeshPrimitiveData().

◆ textureIndex

uint32_t Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::textureIndex = std::numeric_limits<uint32_t>::max()
private

Definition at line 1142 of file GltfLoader.h.

◆ vertices

std::vector<Vertex> Engine::Assets::Loaders::GltfLoader::GltfMeshPrimitiveData::vertices
private

Definition at line 1147 of file GltfLoader.h.


The documentation for this struct was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Mesh/GltfLoader.h