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

Stores intermediate data from loading the asset from disk. These are the vertices, indices and material data. 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< VertexgetVertices () const
 Gets the vertices parsed for this primitive.
std::vector< uint32_t > getIndices () const
 Gets the raw unprocessed list of all indices.
GltfMaterialData getMaterialData () const
 Gets material data parsed for this primitive.
RuntimeTexturegetColorTexturePtr () 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()
RuntimeTexturecolorTexturePtr = nullptr
tinygltf::Primitive primitive
GltfMaterialData materialData
std::vector< Vertexvertices
std::vector< uint32_t > indices
std::vector< BoneVertexDataboneVertexData
 Empty for static meshes.

Detailed Description

Stores intermediate data from loading the asset from disk. These are the vertices, indices and material data.

Definition at line 732 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 793 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 texture of this primitive

◆ getIndices()

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

Gets the raw unprocessed list of all indices.

Returns
Index list of how to connect the vertices to tris

◆ 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 802 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 815 of file GltfLoader.h.

Referenced by getBoneVertexData(), and hasSkinData().

◆ colorTexturePtr

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

Definition at line 809 of file GltfLoader.h.

◆ indices

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

Definition at line 814 of file GltfLoader.h.

◆ materialData

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

Definition at line 812 of file GltfLoader.h.

◆ primitive

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

Definition at line 811 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 808 of file GltfLoader.h.

◆ vertices

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

Definition at line 813 of file GltfLoader.h.


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