PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
skinned_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_mesh_internal
17{
19{
20 std::vector<SkinnedMeshVertex> vertices;
21 std::vector<uint32_t> indices;
22 std::vector<glm::mat4> inverse_bind_matrices;
23 MeshBounds bounds;
24 bool has_bounds = false;
25};
26
27void ResetLoadData(LoadData& data) noexcept;
28void IncludeBoundsPosition(LoadData& data, const glm::vec3& position) noexcept;
29void GenerateTangents(std::vector<SkinnedMeshVertex>& vertices, const std::vector<uint32_t>& indices,
30 const std::filesystem::path& resolved_path, uint32_t texcoord_index = 0u);
31
32[[nodiscard]] bool LoadSkinnedMeshData(const Filesystem& filesystem, const VirtualPath& asset_path, LoadData& data);
33[[nodiscard]] std::optional<MeshBounds> LoadSkinnedMeshBounds(const Filesystem& filesystem, const VirtualPath& asset_path);
34[[nodiscard]] bool SaveSkinnedMeshData(const Filesystem& filesystem, const VirtualPath& asset_path, const LoadData& data,
35 std::string* error_message = nullptr);
36} // namespace skinned_mesh_internal
37} // namespace pixelbullet
Definition filesystem.h:19
Definition virtual_path.h:10
Definition mesh_types.h:38
Definition skinned_mesh_internal.h:19