载入中...
搜索中...
未找到
PrefabActionCapabilities.cpp
浏览该文件的文档.
86 return Result<PrefabLease>::failure(Diagnostic::error(DiagnosticCode::Failed, error.what(), "uri"));
162 Diagnostic::error(DiagnosticCode::NotFound, "Prefab instance handle is missing or stale", "instance"));
222 auto lease = pool_.spawn(binding.value().uri, previewWorldTransform(binding.value().spatial), false);
281 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
282 auto lease = instances->spawn(binding.value().uri, worldTransform(binding.value().spatial, pose.value()));
308 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
314 if (active.binding.spatial.mode != action::ActionSpatialAttachmentMode::WorldTransformAtStart) {
328 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
342 if (timed_[index].executionId != context.executionId || context.time < timed_[index].deadline) {
349 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
387 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
388 auto result = found->second.binding.lifecycle == action::PrefabSpawnLifecycle::RecycleOnBlockExit
406 Diagnostic::error(DiagnosticCode::NotFound, "Prefab target index is unavailable", "targetIndex"));
420 Diagnostic::error(DiagnosticCode::Unsupported, "Prefab bone requires an attachment source", "bone"));
439 static_cast<float>((pose.rotationYDegrees + spatial.rotationOffsetDegrees.y) * kDegreesToRadians),
440 static_cast<float>((pose.rotationXDegrees + spatial.rotationOffsetDegrees.x) * kDegreesToRadians),
441 static_cast<float>((pose.rotationZDegrees + spatial.rotationOffsetDegrees.z) * kDegreesToRadians),
468 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
469 return registry.registerHandler("gameplay:prefab-spawn", std::make_shared<PrefabActionHandler>(*this));
479 DiagnosticCode::NotFound, "SceneLoader prefab instance service is unavailable", "sceneloader"));
Extensible notify descriptors, validation and runtime routing.
Typed payload contract for prefab-spawn action states.
External ownership boundary for independent prefab spawns.
Presentation-neutral action preview frame contracts.
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
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
RuntimeHandle< PrefabInstanceHandleTag > PrefabInstanceHandle
Process-local, generation-qualified identity of one spawned prefab instance.
Definition ActionPrefabInstances.h:17
@ StateEnter
eve::detail::StrongUint64< ActionExecutionIdTag > ActionExecutionId
Definition Action.h:157
@ CustomDuration
The action block recycles the instance after customDuration.
@ RecycleOnBlockExit
The action block recycles the instance on Exit or interruption.
@ WorldTransformAtStart
Capture the complete world transform once on Enter.
@ FollowPositionOnly
Re-evaluate position only and retain the spawn rotation.
constexpr HexDirection next(HexDirection d) noexcept
The next direction clockwise (NW wraps to NE).
Definition HexMetrics.h:76
std::vector< Renderable3D * > buildRenderables(IResourceFactory &gfx, ModelData *model, const ModelRenderOptions &options)
Definition ModelRenderer.cpp:412
Definition SceneImportTarget.h:9
void shutdownPrefabActionCapabilities()
Release all provider-owned prefab instances during SceneLoader shutdown.
Definition PrefabActionCapabilities.cpp:514
void registerPrefabActionCapabilities()
Register the SceneLoader-backed prefab action provider.
Definition PrefabActionCapabilities.cpp:506
@ 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
double rotationYDegrees
Definition EntitySpatialResolver.h:19
double rotationZDegrees
Definition EntitySpatialResolver.h:20
double rotationXDegrees
Definition EntitySpatialResolver.h:18
static Result< ActionPrefabSpawnBinding > fromPayload(const Value::Object &payload)
Decode a prefab-spawn payload without mutating runtime state.
Definition ActionPrefabBlock.cpp:48
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