PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
skinned_morph_mesh_internal.h
1#pragma once
2
3#include "pixelbullet/graphics/mesh_types.h"
4
5#include <cstdint>
6#include <filesystem>
7#include <optional>
8#include <string>
9#include <vector>
10
11namespace pixelbullet
12{
13class Filesystem;
14class VirtualPath;
15
16namespace skinned_morph_mesh_internal
17{
19{
20 std::vector<SkinnedMeshVertex> vertices;
21 std::vector<uint32_t> indices;
22 std::vector<MeshMorphTarget> targets;
23 std::vector<glm::mat4> inverse_bind_matrices;
24 MeshBounds bounds;
25 bool has_bounds = false;
26};
27
28void ResetLoadData(LoadData& data) noexcept;
29void IncludeBoundsPosition(LoadData& data, const glm::vec3& position) noexcept;
30void GenerateTangents(std::vector<SkinnedMeshVertex>& vertices, const std::vector<uint32_t>& indices,
31 const std::filesystem::path& resolved_path, uint32_t texcoord_index = 0u);
32
33[[nodiscard]] bool LoadSkinnedMorphMeshData(const Filesystem& filesystem, const VirtualPath& asset_path, LoadData& data);
34[[nodiscard]] std::optional<MeshBounds> LoadSkinnedMorphMeshBounds(const Filesystem& filesystem, const VirtualPath& asset_path);
35[[nodiscard]] bool SaveSkinnedMorphMeshData(const Filesystem& filesystem, const VirtualPath& asset_path, const LoadData& data,
36 std::string* error_message = nullptr);
37} // namespace skinned_morph_mesh_internal
38} // namespace pixelbullet
Definition filesystem.h:19
Definition virtual_path.h:10
Definition mesh_types.h:38
Definition skinned_morph_mesh_internal.h:19