载入中...
搜索中...
未找到
GeometryStroke.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
4#include "procgen/MeshBuild.h"
5
6#include <cstdint>
7#include <string_view>
8#include <vector>
9
10namespace eve::procgen {
11
14 float x = 0.f;
15 float y = 0.f;
16 float z = 0.f;
17};
18
27public:
29 [[nodiscard]] Result<void> setShapeResult(std::string_view shape);
31 [[nodiscard]] Result<void> setInputSpaceResult(std::string_view inputSpace, float planeY = 0.f);
33 [[nodiscard]] Result<void> setSizeResult(float width, float depth);
35 [[nodiscard]] Result<void> setMinimumSpacingResult(float spacing);
37 [[nodiscard]] Result<bool> addPointResult(float x, float y, float z);
39 [[nodiscard]] Result<void> undoResult();
41 void clear() noexcept;
43 [[nodiscard]] Result<MeshBuild> buildMeshResult() const;
44
46 [[nodiscard]] int pointCount() const noexcept { return static_cast<int>(points_.size()); }
48 [[nodiscard]] std::string_view shape() const noexcept { return shape_; }
50 [[nodiscard]] std::string_view inputSpace() const noexcept { return inputSpace_; }
52 [[nodiscard]] std::uint64_t revision() const noexcept { return revision_; }
53
54private:
55 std::vector<GeometryStrokePoint> points_;
56 std::string shape_ = "quad";
57 std::string inputSpace_ = "spatial";
58 float planeY_ = 0.f;
59 float width_ = 0.25f;
60 float depth_ = 0.25f;
61 float spacing_ = 0.02f;
62 std::uint64_t revision_ = 0;
63};
64
65} // namespace eve::procgen
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
#define EVENGINE_API_DOMAINS
Definition Export.h:110
ShaderImageInput shape
std::uint32_t width
Move-only, checked operation results for the common layer.
int spacing
std::uint32_t depth
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Runtime/editor-neutral session that turns an input trail into mesh geometry.
std::uint64_t revision() const noexcept
Return monotonic mutation revision.
std::string_view shape() const noexcept
Return the selected cross-section name.
int pointCount() const noexcept
Return accepted point count.
std::string_view inputSpace() const noexcept
Return the selected input-space name.
One input sample owned by a procedural geometry stroke.