载入中...
搜索中...
未找到
ClimbingSelection.cpp
浏览该文件的文档.
15 return phase != ClimbingPhase::Idle && phase != ClimbingPhase::Completed && phase != ClimbingPhase::Cancelled &&
31const ClimbingActionDefinition* findAction(const ClimbingProfileDefinition& profile, std::string_view id) {
38float length(Vec3 value) { return std::sqrt(value.x * value.x + value.y * value.y + value.z * value.z); }
40eve::Result<void> validateFullCapsulePath(physics::World3D& world, Vec3 start, const ClimbingCandidate& candidate,
52 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
74 eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation, "climbing.candidate.path_blocked",
83eve::Result<ClimbingRuntime::PreparedBegin> ClimbingRuntime::prepareBegin(physics::World3D& world,
106 physics::World3D& world, const ClimbingPose& pose, eve::SimulationTick tick, ClimbingCandidate candidate) {
108 return eve::Result<PreparedBegin>::failure(eve::Diagnostic::error(eve::DiagnosticCode::Conflict,
118 eve::Diagnostic::error(eve::DiagnosticCode::InvariantViolation, "selected action definition disappeared",
127 auto path = validateFullCapsulePath(world, pose.feet, candidate, *action, profile_, lastQueryCount_,
147 return eve::Result<ClimbingStart>::failure(eve::Diagnostic::error(eve::DiagnosticCode::Conflict,
151 return eve::Result<ClimbingStart>::failure(eve::Diagnostic::error(eve::DiagnosticCode::Conflict,
156 eve::DiagnosticCode::Unsupported, "required climbing conditions were not evaluated by a service authority",
179 enqueueEvent({ClimbingEventKind::Started, started.candidate.actionId, prepared.tick, started.executionId});
180 return eve::Result<ClimbingStart>::success(std::move(started), eve::Status::success(eve::StatusCode::Applied));
193eve::Result<ClimbingStart> ClimbingSelectionSystem::tryStart(ClimbingRuntime& runtime, physics::World3D& world,
199 eve::DiagnosticCode::NotFound, "climbing.input.no_match", "intent.commands", {}, "climbing.selection"));
215 auto consumed = ClimbingInputSystem::consume(intent, command, tick, prepared.value().executionId);
Tick-addressed command buffering for deterministic climbing input.
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
static ClimbingCoyoteState coyoteWindowState(eve::SimulationTick currentTick, eve::SimulationTick lastGroundedTick, std::uint64_t coyoteTicks) noexcept
Evaluate a grounded grace window without reading wall clock.
Definition ClimbingInput.cpp:87
static eve::Result< std::optional< BufferedClimbingCommand > > consume(ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick currentTick, ClimbingExecutionId executionId)
Atomically mark the oldest eligible command consumed by one committed execution.
Definition ClimbingInput.cpp:57
static std::optional< BufferedClimbingCommand > peek(const ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick currentTick) noexcept
Observe the oldest eligible command without consuming or pruning intent.
Definition ClimbingInput.cpp:78
Owner-thread climbing planner and executor for one character.
Definition Climbing.h:653
eve::Result< ClimbingCandidateSet > probe(physics::World3D &world, const ClimbingPose &pose) const
Probes, validates, and deterministically sorts all matching candidates.
Definition Climbing.cpp:166
eve::Result< ClimbingCandidate > tryBegin(physics::World3D &world, const ClimbingPose &pose, eve::SimulationTick tick)
Begins the best current candidate atomically, or returns NotFound without mutation.
Definition ClimbingSelection.cpp:183
static eve::Result< ClimbingStart > tryStart(ClimbingRuntime &runtime, physics::World3D &world, const ClimbingPose &pose, ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick tick, eve::SimulationTick lastGroundedTick)
Start the best candidate and consume its input edge exactly once.
Definition ClimbingSelection.cpp:193
void updateLatestCounters(ClimbingRuntimeCounters counters) noexcept
Replace counters on the most recent sample after a caller completes deferred hard validation.
Definition ClimbingTelemetry.cpp:24
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:63
Vec3 trajectoryPoint(Vec3 start, const ClimbingCandidate &candidate, const ClimbingActionDefinition &action, const ClimbingProfileDefinition &profile, float normalizedTime) noexcept
Trajectory point.
Definition ClimbingTrajectory.h:28
const ClimbingActionDefinition * findAction(const ClimbingProfile &profile, std::string_view id)
Optional action. @borrowed From profile; lifetime ends when the caller-owned profile changes or is de...
Definition ClimbingRuntimeInternal.h:192
Definition Climbing.cpp:19
eve::detail::StrongUint64< detail::ClimbingExecutionIdTag > ClimbingExecutionId
Stable non-zero identity assigned when a climbing selection transaction commits.
Definition ClimbingPrimitives.h:15
ClimbingPhase
Execution lifecycle visible to gameplay and animation adapters.
Definition Climbing.h:470
@ Completed
@ Cancelled
@ Requested
ClimbingCommandRequirement
Input edge required by an action definition; Any keeps legacy automatic selection.
Definition Climbing.h:79
ClimbingCommand
Edge and held commands understood by the climbing input phase.
Definition ClimbingInput.h:22
@ NotFound
@ PreconditionViolation
@ Unsupported
@ InvariantViolation
@ Conflict
@ Applied
Hot authoritative intent component; contains no device or callback pointers.
Definition ClimbingInput.h:39
Input pose used for one deterministic candidate probe.
Definition Climbing.h:275
static constexpr std::uint32_t CandidateProbe
Definition ClimbingTelemetry.h:29
std::uint32_t moverIterations
Definition ClimbingTelemetry.h:52
ClimbingQueryBudgetState budgetState
Definition ClimbingTelemetry.h:54
std::uint32_t queryCount
Definition ClimbingTelemetry.h:48