载入中...
搜索中...
未找到
GroomAsset.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
5
6#include <cstddef>
7#include <cstdint>
8#include <string>
9#include <vector>
10
11namespace eve::graphics::hair {
12
14enum class Representation : uint8_t { Strands = 0, Cards = 1, Meshes = 2, None = 3 };
15
26
31struct GroomGroup {
32 std::string name;
33 uint32_t groupId = 0;
40 std::vector<GroomLod> lods;
41};
42
53public:
58 [[nodiscard]] Result<void> addGroup(GroomGroup group);
59
60 [[nodiscard]] size_t groupCount() const { return groups_.size(); }
61 [[nodiscard]] const GroomGroup *groupAt(size_t index) const;
62 [[nodiscard]] const GroomGroup *findGroupById(uint32_t groupId) const;
63
64 void clear();
65
67 [[nodiscard]] Result<void> validate() const;
68
69private:
70 std::vector<GroomGroup> groups_;
71};
72
77[[nodiscard]] EVENGINE_API_BACKENDS size_t selectLodIndex(const std::vector<GroomLod> &lods, float screenSize);
78
79} // namespace eve::graphics::hair
building::EdgeCurveGroup group
#define EVENGINE_API_BACKENDS
Definition Export.h:108
Move-only, checked operation results for the common layer.
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Shared CPU groom container (UE UGroomAsset analogue).
Definition GroomAsset.h:52
CPU-authoritative strand buffer (UE FHairStrandsDatas analogue).
Procedural hair/fur card meshes + material/LOD helpers (no strand simulation).
Definition Graphics.h:58
Representation
Geometry representation selected by a groom LOD (UE GeometryType analogue).
Definition GroomAsset.h:14
size_t selectLodIndex(const std::vector< GroomLod > &lods, float screenSize)
Pick the LOD index for a given screen size (largest screenSize ≤ query).
One groom group (UE hair group analogue: bangs / scalp / beard …). @ownership Owned by GroomAsset.
Definition GroomAsset.h:31
std::vector< GroomLod > lods
Definition GroomAsset.h:40
StrandsDatas guides
Optional simulation / interpolation guides (may be empty). When empty, callers can derive guides via ...
Definition GroomAsset.h:39
One LOD entry for a groom group.
Definition GroomAsset.h:17
float screenSize
Switch to this LOD when screen size falls below this value (0..1).
Definition GroomAsset.h:19
Representation representation
Definition GroomAsset.h:20
float thicknessScale
Extra thickness scale applied when curves are decimated.
Definition GroomAsset.h:24
float curveFraction
Keep this fraction of curves when baking ribbons (1 = all).
Definition GroomAsset.h:22