载入中...
搜索中...
未找到
GpuAgentsDocument.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
8
9#include <string>
10#include <vector>
11
12namespace eve::gpuagents {
13class EffectBackend;
14class GpuAgentWorld;
15} // namespace eve::gpuagents
16
17namespace eve::gpuagents_editing {
18
23using editing::Result;
38
41 std::string kind = "Fish";
42 std::int64_t maxAgents = 128;
43 double fixedDt = 1.0 / 60.0;
44 double agentRadius = 0.25;
45 double obstaclePredictTime = 0.35;
46 std::int64_t seed = 1;
47
48 // Shared boid / life motion knobs (kind-specific consumers ignore unused fields).
49 double separationRadius = 1.5;
50 double cohesionRadius = 4.0;
51 double alignmentRadius = 3.0;
52 double separationWeight = 1.4;
53 double cohesionWeight = 0.8;
54 double alignmentWeight = 1.0;
55 double maxSpeed = 4.0;
56 double moveSpeed = 1.8;
57 double depositStrength = 0.35;
58 double trailDecayRate = 0.15;
59 double diffusionRate = 0.08;
60 double trailFollow = 1.2;
61 std::int64_t fieldResolution = 64;
62 double worldSize = 32.0;
63 double originX = -16.0;
64 double originY = 0.0;
65 double originZ = -16.0;
66 double minSurfaceNormalZ = 0.35;
67
68 // LifeField material binding labels.
69 std::string lifeFieldSampler = "LifeFieldTexture";
70 std::string surfaceDataSampler = "SurfaceDataTexture";
71
73 auto operator<=>(const GpuAgentsSettings&) const = default;
74};
75
78
81
84 public virtual IEditableTarget,
86 public IPropertyProvider {
87public:
89 explicit GpuAgentsDocumentTarget(std::string id);
91 TargetId targetId() const override { return TargetId(id_); }
93 TargetDescriptor describe() const override;
100 void* queryCapability(const CapabilityId& capability) override;
102 Result<void> applyDomainOperation(const DomainOperation& operation) override;
104 eve::Result<eve::Revision> currentRevision(const SelectionSnapshot& selection) const override;
106 PropertySchema schema(const SelectionSnapshot& selection) const override;
108 PropertyReadResult read(const SelectionSnapshot& selection, const PropertyPath& path) const override;
110 Result<DomainOperation> makeSet(const SelectionSnapshot& selection, const PropertyPath& path,
111 const EditorValue& value, PropertySetMode mode) const override;
113 Result<DomainOperation> makeReset(const SelectionSnapshot& selection,
114 const PropertyPath& path) const override;
115
117 GpuAgentsSettings settings() const { return settings_; }
119 std::vector<EditorDiagnostic> validate() const;
121 EditorValue snapshotValue() const;
123 Result<void> loadSnapshot(const EditorValue& snapshot);
124
125private:
127 bool matches(const SelectionSnapshot& selection) const;
128 std::string id_;
129 GpuAgentsSettings settings_;
130};
131
137public:
146 [[nodiscard("check runtime apply")]] Result<void> apply(const GpuAgentsDocumentTarget& target,
149};
150
151} // namespace eve::gpuagents_editing
LogicalId target
ActionParameterOperation operation
double value
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
TokenKind kind
World3D * world
std::string path
Definition PlayHost.cpp:110
std::uint32_t seed
Definition PointSet.cpp:807
TerrainThermalSettings settings
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Dirty region and revision shared by every editable document target.
Editable-target capability that applies owning domain operations.
IEditableTarget public API.
UI-independent property access for an immutable selection snapshot.
Dotted property path (layout.size) compared and persisted as text.
Definition EditingIds.h:78
Deterministic owning value tree shared by authoring hosts.
Binds an EffectProfile to a GpuAgentSimulation and optional renderer.
World-level registry for GPU agent simulations and environment semantics.
Reversible document for GPU Agents effect authoring.
GpuAgentsSettings settings() const
Immutable authored settings.
TargetId targetId() const override
Target id.
Optional bridge projecting a validated document into live World/Backend. @ownership Borrowed world/ba...
eve::Severity DiagnosticSeverity
std::uint64_t Revision
StrongId< TargetIdTag > TargetId
Definition EditingIds.h:57
eve::Diagnostic Diagnostic
StrongId< RuleIdTag > RuleId
Definition EditingIds.h:60
PropertySetMode
PropertySetMode public API.
eve::StatusCode Status
StrongId< CapabilityIdTag > CapabilityId
Definition EditingIds.h:61
PropertySchema gpuAgentsEffectSchema()
Build the UI-independent PropertySchema for gpuagents:effect-document v1.
gpuagents::EffectProfile toEffectProfile(const GpuAgentsSettings &settings)
Convert authoring settings into a runtime EffectProfile.
editing::Revision Revision
StatusCode
Stable outcome category for an operation.
Definition Status.h:27
Severity
Stable severity of a diagnostic, independent of its display text.
Definition Diagnostic.h:20
DomainOperation public API.
PropertyReadResult public API.
EVENGINE_API_PLATFORM public API.
SelectionSnapshot public API.
Stable discovery metadata exposed by every editable target.
Type-erased profile bundle owned by an EffectBackend.
Authoring values for one GPU Agents effect document.
auto operator<=>(const GpuAgentsSettings &) const =default
Operator <=>.