载入中...
搜索中...
未找到
ThunderStrike.cpp
浏览该文件的文档.
15 if (state.playing) return Result<ThunderStrikeReceipt>::failure(Diagnostic::error(DiagnosticCode::Conflict, "thunder strike is already playing", "weather.thunderStrike"));
20 return Result<ThunderStrikeReceipt>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "thunder strike inputs must be finite and non-negative", "weather.thunderStrike"));
37 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "thunder strike dt must be finite and non-negative", "weather.thunderStrike"));
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
constexpr HexDirection next(HexDirection d) noexcept
The next direction clockwise (NW wraps to NE).
Definition HexMetrics.h:76
Definition LightingTarget.h:19
Result< ThunderStrikeReceipt > triggerThunderStrike(ThunderStrikeState &state, const ThunderStrikeSettings &settings, float px, float py, float pz, std::uint32_t seed)
Start a Pcg-style strike around the supplied player position.
Definition ThunderStrike.cpp:13
Result< void > advanceThunderStrike(ThunderStrikeState &state, float dt)
Apply Pcg's clamped Lerp(intensity,0,dt*2) decay and 0.15 stop threshold.
Definition ThunderStrike.cpp:35
@ InvalidArgument
@ Conflict
Deterministic strike command consumed by scene, light and audio providers.
Definition ThunderStrike.h:26
Pcg ThunderStrike parameters independent of renderer and audio providers.
Definition ThunderStrike.h:12