载入中...
搜索中...
未找到
PcgSkinnedMesh.h
浏览该文件的文档.
1#pragma once
2
4#include "common/Result.h"
6
7#include <memory>
8#include <string>
9#include <vector>
10
11namespace eve::procgen_animation {
12
15public:
17 [[nodiscard]] Result<void> appendSource(const procgen::MeshBuild& mesh,
18 const animation::AnimSkin& skin,
19 const procgen::PcgMeshTransform& transform,
20 const std::string& defaultMaterialId);
22 void clear() noexcept { sources_.clear(); }
24 [[nodiscard]] int getSourceCount() const noexcept { return static_cast<int>(sources_.size()); }
25
26private:
27 struct Source {
30 std::string defaultMaterialId;
32 };
33 friend EVENGINE_API_ORCHESTRATION Result<void> combinePcgSkinnedMeshesInto(class PcgSkinnedMeshResult&,
34 const PcgSkinnedMeshPlan&);
35 std::vector<Source> sources_;
36};
37
40public:
44 [[nodiscard]] const procgen::MeshBuild* mesh() const noexcept { return skin_ ? &mesh_ : nullptr; }
48 [[nodiscard]] animation::AnimSkin* skin() const noexcept { return skin_.get(); }
50 [[nodiscard]] bool valid() const noexcept { return skin_ != nullptr; }
51
52private:
54 const PcgSkinnedMeshPlan&);
56 std::unique_ptr<animation::AnimSkin> skin_;
57};
58
67 const PcgSkinnedMeshPlan& plan);
68
69} // namespace eve::procgen_animation
std::string output
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
Mesh * mesh
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
CPU linear-blend skinning binding for one mesh against an AnimSkeleton.
Definition AnimSkin.h:47
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:19
Row-major affine matrix used by Pcg's root-relative static mesh combination.
Definition PcgMeshLod.h:43
Owned ordered inputs for Pcg's skinned MeshCombiner path.
int getSourceCount() const noexcept
Return the ordered source count.
void clear() noexcept
Remove all sources.
Atomically published combined mesh and matching owned AnimSkin.
const procgen::MeshBuild * mesh() const noexcept
Borrow the combined CPU mesh. @ownership This result retains ownership. @lifetime Valid until the nex...
animation::AnimSkin * skin() const noexcept
Borrow the skin whose vertex order exactly matches mesh(). @ownership This result retains ownership....
bool valid() const noexcept
Return whether a complete mesh/skin pair is present.
friend EVENGINE_API_ORCHESTRATION Result< void > combinePcgSkinnedMeshesInto(PcgSkinnedMeshResult &, const PcgSkinnedMeshPlan &)
Combine Pcg skinned meshes, preserving its bone and bindpose remap semantics.
Result< void > combinePcgSkinnedMeshesInto(PcgSkinnedMeshResult &output, const PcgSkinnedMeshPlan &plan)
Combine Pcg skinned meshes, preserving its bone and bindpose remap semantics.
Owned native streams for constructing a skin outside the model importer.
Definition AnimSkin.h:28