16 GltfLoader::GltfMeshData( tinygltf::Model(), tinygltf::
Mesh(), tinygltf::Node(),
glm::mat4( 1 ) )
24 PLOGI <<
"=== Mesh CONSTRUCTOR STARTED ===";
25 PLOGI <<
"Mesh name: " <<
name;
26 PLOGI <<
"Mesh primitives count: " <<
meshData.getPrimitives().size();
28 for (
const auto & meshPrimitiveData :
meshData.getPrimitives() )
30 PLOGI <<
"MeshPrimitive color texture ptr: "
31 << ( meshPrimitiveData.getColorTexturePtr() ?
" is Valid" :
" is Invalid" );
34 PLOGI <<
"=== Mesh CONSTRUCTOR FINISHED ===";
40 PLOGI <<
"=== Create Mesh resources ===";
41 PLOGI <<
"Mesh name: " <<
name;
43 const uint32_t meshPrimitiveCount =
meshData.getPrimitives().size();
44 PLOGI <<
"Creating " << meshPrimitiveCount <<
" mesh primitives";
46 for ( uint32_t i = 0; i < meshPrimitiveCount; i++ )
48 PLOGI <<
"=== Creating mesh primitive " << i + 1 <<
" of " << meshPrimitiveCount <<
" ===";
52 PLOGI <<
"=== Mesh primitive " << i + 1 <<
" created successfully ===";
54 catch (
const std::exception & e )
56 PLOGE <<
"=== ERROR creating mesh primitive " << i + 1 <<
": " << e.what() <<
" ===";
60 PLOGI <<
"=== Mesh primitive data loaded ===";
61 glm::mat4 matrix =
meshData.getTransform();
67 glm::vec3 minCoordinates( std::numeric_limits<float>::max() );
68 glm::vec3 maxCoordinates( std::numeric_limits<float>::lowest() );
72 for (
const auto & vertex : primitive.getVertices() )
74 minCoordinates = glm::min( minCoordinates, glm::vec3(vertex.position) );
75 maxCoordinates = glm::max( maxCoordinates, glm::vec3(vertex.position) );
78 glm::vec3 extent = maxCoordinates - minCoordinates;
94 uint32_t indicesCount = 0u;
97 indicesCount += primitive.getIndices().size();
105 uint32_t primitiveCount = 0u;
108 primitiveCount += primitive.getMeshletTriangleCount();
110 return primitiveCount;
119 count += primitive.getMeshletsCount();
146 std::stringstream
name;
147 name << path.generic_string() <<
";" << meshName;
#define TRACY_ZONE_SCOPED_FUNCTION
#define TRACY_ZONE_SCOPED_NAMED(name)
The application context is the core class which stores the basic openxr and vulkan objects.
std::optional< PipelineNames > materialName
static const uint32_t textureCount
std::atomic< bool > isReady
ApplicationContext * context
std::string getName() const
const std::vector< MeshPrimitive > & getPrimitivesByReference() const
uint32_t getIndexCount() const
static std::string createMeshName(const std::filesystem::path &path, const std::string &meshName)
uint32_t getMeshletCount() const
GltfLoader::GltfMeshData meshData
uint32_t getMeshletTriangleCount() const
float boundingSphereRadius
static uint32_t getTextureCount()
Transform getSceneTransform() const
std::vector< MeshPrimitive > getPrimitives() const
std::vector< MeshPrimitive > meshPrimitives
PipelineNames getShaderName() const
Gets the name of the shader assigned to this object.
float getBoundingSphereRadius() const
Log category system implementation.
Converters from other number / vector systems into glm.