载入中...
搜索中...
未找到
RibbonBuilder.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
5
6#include <cstdint>
7#include <vector>
8
9#include <glm/vec3.hpp>
10
11namespace eve::graphics::hair {
12
19struct RibbonMesh {
20 std::vector<float> posXYZ;
21 std::vector<float> nrmXYZ;
22 std::vector<float> uvST;
23 std::vector<uint32_t> indices;
24
26 [[nodiscard]] int vertexCount() const { return int(posXYZ.size() / 3u); }
28 [[nodiscard]] int indexCount() const { return int(indices.size()); }
29};
30
34 glm::vec3 sideHint{1.f, 0.f, 0.f};
36 float widthScale = 1.f;
38 float minWidth = 1e-5f;
39};
40
50 const RibbonParams &params = {});
51
56EVENGINE_API_BACKENDS void appendRibbonMesh(RibbonMesh &dst, const RibbonMesh &src);
57
58} // namespace eve::graphics::hair
int strands
#define EVENGINE_API_BACKENDS
Definition Export.h:108
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
CPU-authoritative strand buffer (UE FHairStrandsDatas analogue).
std::vector< ParamSpec > params
Procedural hair/fur card meshes + material/LOD helpers (no strand simulation).
Definition Graphics.h:58
Result< RibbonMesh > buildRibbons(const StrandsDatas &strands, const RibbonParams &params)
Expand validated strands into stable (non-view-facing) ribbons.
void appendRibbonMesh(RibbonMesh &dst, const RibbonMesh &src)
Append src into dst, rebasing triangle indices by dst vertex count. @ownership Both meshes remain cal...
Triangle-list ribbon mesh expanded from strand curves.
int indexCount() const
Index count.
std::vector< float > posXYZ
std::vector< float > nrmXYZ
int vertexCount() const
Vertex count.
std::vector< uint32_t > indices
RibbonParams public API.
float minWidth
Skip strands thinner than this after scaling.
glm::vec3 sideHint
World-space side hint used to extrude the ribbon (normalized internally).
float widthScale
Multiplier applied to each point radius.