载入中...
搜索中...
未找到
ParticlesCapabilities.cpp
浏览该文件的文档.
74 const auto shape = instant ? eve::action::ActionVfxShape::Instant : eve::action::ActionVfxShape::State;
82 eve::Diagnostic::error(eve::DiagnosticCode::NotFound, "Particles module is unavailable", "particles"));
110 eve::Diagnostic::error(eve::DiagnosticCode::NotFound, "Active VFX state has no instance", "itemId"));
111 if (found->second.binding.spatial.mode != eve::action::ActionSpatialAttachmentMode::WorldTransformAtStart) {
114 if (found->second.binding.spatial.mode == eve::action::ActionSpatialAttachmentMode::FollowPositionOnly) {
129 const double externalRate = found->second.binding.playbackRateSynced ? context.playbackRate : 1.0;
158 const auto reaped = std::erase_if(residuals_, [](const std::unique_ptr<ParticleEffect>& effect) {
170 std::unique_ptr<ParticleEffect> effect;
181 const eve::action::ActionSpatialBinding& spatial, const eve::action::ActionNotifyContext& context) {
216 static void applyWorldTransform(ParticleEffect& effect, const eve::action::ActionSpatialBinding& spatial,
222 effect.setRotation(static_cast<float>((pose.rotationZDegrees + spatial.rotationOffsetDegrees.z) *
273 if (cue.kind != eve::action::ActionPreviewCueKind::Vfx || cue.type.format() != "presentation:vfx")
283 const auto elapsedNs = std::max<std::int64_t>(0, frame.current.nanoseconds() - cue.time.nanoseconds());
368 const double progress = duration > 0.0 ? std::clamp(localTime.seconds() / duration, 0.0, 1.0) : 0.0;
407 effect->setRotation(static_cast<float>(binding.spatial.rotationOffsetDegrees.z * 0.017453292519943295));
440 eve::Result<std::unique_ptr<eve::action::IActionPreviewSink>> createActionPreviewSink() override {
Extensible notify descriptors, validation and runtime routing.
Presentation-neutral action preview frame contracts.
Typed spatial payload shared by presentation action blocks.
Typed VFX action-block payload contract.
Optional VFX resource-duration query for action editors.
Optional ECS-entity to world-pose capability.
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
constexpr std::int64_t nanoseconds() const noexcept
Return the exact signed nanosecond representation.
Definition Time.h:69
static Result< Duration > fromSeconds(double seconds)
Convert finite seconds to the nearest nanosecond.
Definition Time.cpp:16
static constexpr Duration fromNanoseconds(std::int64_t nanoseconds) noexcept
Construct an exact duration from nanoseconds.
Definition Time.h:55
double seconds() const noexcept
Return this duration as seconds for legacy/presentation APIs.
Definition Time.cpp:28
Particle system query surface (provided by the particles module).
Definition ParticlesQuery.h:10
const std::string & format() const noexcept
Returns the canonical namespace:name representation.
Definition Identity.h:436
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
Canonical notify descriptor owner and runtime handler router.
Definition ActionNotifyRegistry.h:138
Result< void > registerHandler(std::string_view type, std::shared_ptr< IActionNotifyHandler > handler)
Register an owning handler for an existing descriptor.
Definition ActionNotifyRegistry.cpp:243
Consumer-owned handler for one registered notify type.
Definition ActionNotifyRegistry.h:68
Optional module provider that installs handlers into a new registry.
Definition ActionNotifyRegistry.h:117
Optional owner-thread provider of one independently owned action preview layer.
Definition ActionPreview.h:78
Host boundary for 3D animation, VFX, audio and camera preview.
Definition ActionPreview.h:59
Optional synchronous provider of authored VFX resource duration.
Definition ActionVfxDuration.h:19
@ Instant
@ ClearImmediately
@ StateEnter
@ WorldTransformAtStart
Capture the complete world transform once on Enter.
@ FollowPositionOnly
Re-evaluate position only and retain the spawn rotation.
Definition ParticleGraph.h:53
void registerParticlesAttackVfxExecutor()
Registers particles attack vfx executor.
Definition ParticlesAttackVfx.cpp:159
void stepEmitterSim(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt)
Step emitter sim.
Definition ParticleEmitter.cpp:415
void registerParticlesCapabilities()
Registers particles capabilities.
Definition ParticlesCapabilities.cpp:469
WidgetDesc progress(float fraction, std::string id, std::string overlay)
Progress bar; fraction is clamped to [0,1].
Definition Widget.cpp:395
@ InvalidArgument
@ NotFound
@ Unsupported
@ Failed
@ Conflict
Result< EntitySpatialPose > resolveEntitySpatialPose(ecs::EntityHandle entity, std::string_view bone)
Resolve through registered providers in deterministic registration order.
Definition EntitySpatialResolver.cpp:9
@ NoOp
@ Applied
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
Renderer-neutral owning world pose resolved for an ECS entity.
Definition EntitySpatialResolver.h:14
double rotationZDegrees
Definition EntitySpatialResolver.h:20
Owning per-step sample of one currently active timeline state.
Definition ActionTimeline.h:159
Context linking a routed event to its action execution.
Definition ActionNotifyRegistry.h:34
Complete frame atomically prepared and then presented by a preview host.
Definition ActionPreview.h:41
Validated spatial settings decoded from a notify payload.
Definition ActionSpatialBlock.h:47
std::size_t targetIndex
Definition ActionSpatialBlock.h:50
ActionSpatialVector3 scale
Definition ActionSpatialBlock.h:54
ActionSpatialVector3 positionOffset
Definition ActionSpatialBlock.h:52
ActionSpatialTarget target
Definition ActionSpatialBlock.h:49
ActionSpatialVector3 rotationOffsetDegrees
Definition ActionSpatialBlock.h:53
Owning event projection returned by the runtime sampler.
Definition ActionTimeline.h:146
Owning validated VFX settings shared by runtime and editor preview.
Definition ActionVfxBlock.h:21
static Result< ActionVfxBinding > fromPayload(const Value::Object &payload, ActionVfxShape shape)
Decode one dynamic VFX payload transactionally.
Definition ActionVfxBlock.cpp:29