![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
CPU-side geometry: indexed triangle mesh plus a cached local-space AABB. More...
#include <mesh_asset.h>
Public Member Functions | |
| Math::AABB | bounds () const noexcept |
| The local-space bounds as one box. | |
| void | computeAndSetBounds () |
| Compute the local-space AABB from vertex positions and store it in boundsMin / boundsMax. | |
| void | computeAndSetSkinRadius (const SkeletonAsset &rig) |
| Compute how far a vertex sits from the bones that drive it and store it in skinRadius. | |
| Public Member Functions inherited from Vkm::Engine::Resource | |
| Resource (const Resource &other) | |
Duplicate other's contents and name, but not its identity. | |
| const std::string & | name () const noexcept |
| Serializable identity; non-empty and unique within its type once added. | |
| uint64_t | uid () const noexcept |
| Process-unique id stamped by add(); names the asset, not the slot it sits in. | |
| uint64_t | version () const noexcept |
| Change counter the backend keys GPU re-uploads on; moved by commit(). | |
| bool | isHidden () const noexcept |
| Added by ResourceManager::addPrivate: not user-facing, not saved. | |
| nlohmann::json & | sourceJson () |
| Mutable source JSON, allocating a null document if there is none. | |
| const nlohmann::json & | sourceJson () const |
| Const source JSON; asserts hasSource(), so guard the call with it. | |
Public Attributes | |
| std::vector< SkinVertex > | skin = {} |
| Per-vertex rig binding: empty, or exactly vertices.size() long. | |
| std::string | skeleton = "" |
| Name of the rig skin's indices address; empty when unskinned. | |
| float | skinRadius = 0.0f |
| Largest distance from a vertex to any bone that influences it. | |
| glm::vec3 | boundsMin {0} |
| Local space. | |
| glm::vec3 | boundsMax {0} |
| Local space. | |
| bool | loading = false |
| True while an async decode is in flight. | |
CPU-side geometry: indexed triangle mesh plus a cached local-space AABB.
|
inlinenoexcept |
The local-space bounds as one box.
| void Vkm::Engine::MeshAsset::computeAndSetBounds | ( | ) |
Compute the local-space AABB from vertex positions and store it in boundsMin / boundsMax.
An empty mesh yields a zero-extent box at the origin.
| void Vkm::Engine::MeshAsset::computeAndSetSkinRadius | ( | const SkeletonAsset & | rig | ) |
Compute how far a vertex sits from the bones that drive it and store it in skinRadius.
Required after filling a skinned mesh: zero is a wrong box, not a small one (see VisibilitySystem). Zero when unskinned or the skin is not parallel.
| rig | The rig skin's bone indices address, for the bind-pose origins. |
| std::vector<SkinVertex> Vkm::Engine::MeshAsset::skin = {} |
Per-vertex rig binding: empty, or exactly vertices.size() long.
A mesh is skinned iff this is non-empty.
| std::string Vkm::Engine::MeshAsset::skeleton = "" |
Name of the rig skin's indices address; empty when unskinned.
A compatibility tag, not a dependency: the pose comes from whatever rig drives it. SkeletalAnimationSystem warns when the two names disagree.
| float Vkm::Engine::MeshAsset::skinRadius = 0.0f |
Largest distance from a vertex to any bone that influences it.
What a bone-origin box is inflated by to contain the skin. Zero when unskinned.
| bool Vkm::Engine::MeshAsset::loading = false |
True while an async decode is in flight.
Cleared by AsyncLoaderSystem; until then the mesh is empty and draws nothing.