载入中...
搜索中...
未找到
EffectBackend.cpp
浏览该文件的文档.
2
3#include "common/Diagnostic.h"
4
5namespace eve::gpuagents {
6
7Result<void> EffectBackend::configure(const EffectProfile& profile, std::string displayName) {
8 name_ = std::move(displayName);
9 auto cfg = simulation_.configure(profile);
10 if (!cfg.ok()) return cfg;
11 renderer_.sync(simulation_.states());
12 return Result<void>::success();
13}
14
16 auto stepped = simulation_.step(dt, env);
17 if (!stepped.ok()) return stepped;
18 renderer_.sync(simulation_.states());
19 return Result<void>::success();
20}
21
22} // namespace eve::gpuagents
Stable, structured diagnostics shared by engine modules.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:164
int sync(const std::vector< AgentState > &states)
Rebuild instance buffers from simulation states.
Result< void > configure(const EffectProfile &profile, std::string displayName={})
Configure from a profile and initialize empty capacity.
Result< void > step(float dt, const EnvironmentSnapshot &env)
Advance simulation then refresh instance buffers.
Result< void > configure(const EffectProfile &profile)
Configure capacity and bind a solver for the profile kind.
const std::vector< AgentState > & states() const
Current front-buffer states (read-only).
Result< void > step(float dt, const EnvironmentSnapshot &env)
Advance wall-clock dt via fixed substeps.
Type-erased profile bundle owned by an EffectBackend.
Read-only environment semantics prepared by GpuAgentWorld each tick.