载入中...
搜索中...
未找到
ClimbingRuntimeInternal.h
浏览该文件的文档.
50inline bool isFinite(Vec3 value) { return isFinite(value.x) && isFinite(value.y) && isFinite(value.z); }
53inline float lengthSquared(Vec3 value) { return value.x * value.x + value.y * value.y + value.z * value.z; }
58inline Vec3 operator+(Vec3 lhs, Vec3 rhs) { return {lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z}; }
60inline Vec3 operator-(Vec3 lhs, Vec3 rhs) { return {lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z}; }
62inline Vec3 operator*(Vec3 value, float scale) { return {value.x * scale, value.y * scale, value.z * scale}; }
85inline WarpChannels activeWarpChannels(const ClimbingActionDefinition& action, float normalizedTime) {
103inline const std::string* activeBranchComboTag(const ClimbingActionDefinition& action, float normalizedTime) {
111inline float activeContactWeight(const ClimbingActionDefinition& action, ClimbingContactTarget target,
123inline Vec3 terminalVelocityFor(const ClimbingActionDefinition& action, Vec3 actualDelta, float inverseDelta) {
132 case ClimbingTerminalVelocityPolicy::ClampDownward: velocity.y = std::min(velocity.y, 0.f); break;
156 return phase != ClimbingPhase::Idle && phase != ClimbingPhase::Completed && phase != ClimbingPhase::Cancelled &&
192inline const ClimbingActionDefinition* findAction(const ClimbingProfile& profile, std::string_view id) {
207inline bool containsAnyTag(const std::vector<std::string>& actionTags, const std::vector<std::string>& policyTags) {
216inline bool isActionEnabledForPose(const ClimbingProfile& profile, const ClimbingActionDefinition& action,
218 if (!profile.defaultActionIds.empty() && std::find(profile.defaultActionIds.begin(), profile.defaultActionIds.end(),
221 if (!profile.allowedActionTags.empty() && !containsAnyTag(action.tags, profile.allowedActionTags)) return false;
223 const auto required = pose.grounded ? ClimbingSourceMode::Grounded : ClimbingSourceMode::Airborne;
234 return action.kind == ClimbingActionKind::LedgeGrab || action.kind == ClimbingActionKind::ClimbUp;
254inline bool isSupportSelectorMatch(const ClimbingActionDefinition& action, int shapeTag, int materialId) {
274inline std::int64_t selectionCost(const ClimbingProfile& profile, const ClimbingActionDefinition& action,
283 normalizedHorizontal(pose.inputMode == ClimbingInputMode::Precision ? pose.lookIntent : pose.moveIntent);
286 const float directionDot = std::clamp(forward.x * targetDirection.x + forward.z * targetDirection.z, -1.f, 1.f);
289 std::clamp(intentDirection.x * targetDirection.x + intentDirection.z * targetDirection.z, -1.f, 1.f);
297 const float horizontalDelta = std::sqrt(targetDelta.x * targetDelta.x + targetDelta.z * targetDelta.z);
298 const float warpTranslation = std::sqrt(horizontalDelta * horizontalDelta + targetDelta.y * targetDelta.y);
314 weightedMillimeters(warpTranslation * translationModeScale, profile.scoreWeights.warpTranslation) +
318 weightedMillimeters(intentMismatch * intentModeScale, profile.scoreWeights.intentMismatch) + stableTieBreak;
Deterministic climbing/parkour planning and capsule-constrained execution.
Runtime-owned fixed ring of performance samples.
Definition ClimbingTelemetry.h:82
void record(ClimbingTelemetrySample sample) noexcept
Append one sample, overwriting the oldest sample when full.
Definition ClimbingTelemetry.cpp:18
RuntimeTelemetryScope public API.
Definition ClimbingRuntimeInternal.h:17
RuntimeTelemetryScope(ClimbingTelemetryBuffer &buffer, ClimbingRuntimeCounters &counters, eve::SimulationTick tick) noexcept
Constructs a RuntimeTelemetryScope.
Definition ClimbingRuntimeInternal.h:20
~RuntimeTelemetryScope()
Releases RuntimeTelemetryScope resources.
Definition ClimbingRuntimeInternal.h:26
bool isActionEnabledForPose(const ClimbingProfile &profile, const ClimbingActionDefinition &action, const ClimbingPose &pose)
True when action enabled for pose.
Definition ClimbingRuntimeInternal.h:216
std::int64_t selectionCost(const ClimbingProfile &profile, const ClimbingActionDefinition &action, const ClimbingPose &pose, Vec3 targetDirection, Vec3 targetDelta, float heightError, float distance, std::int64_t stableTieBreak=0)
Selection cost.
Definition ClimbingRuntimeInternal.h:274
bool isCandidateLess(const ClimbingCandidate &lhs, const ClimbingCandidate &rhs)
True when candidate less.
Definition ClimbingRuntimeInternal.h:199
bool isRuntimeProbeKind(ClimbingActionKind kind)
True when runtime probe kind.
Definition ClimbingRuntimeInternal.h:161
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
std::int64_t quantizeMillimeters(float value)
Quantize millimeters.
Definition ClimbingRuntimeInternal.h:184
WarpChannels activeWarpChannels(const ClimbingActionDefinition &action, float normalizedTime)
Active warp channels.
Definition ClimbingRuntimeInternal.h:85
float activeContactWeight(const ClimbingActionDefinition &action, ClimbingContactTarget target, float normalizedTime)
Active contact weight.
Definition ClimbingRuntimeInternal.h:111
bool isProbeRecipeMatchingKind(const ClimbingActionDefinition &action)
True when probe recipe matching kind.
Definition ClimbingRuntimeInternal.h:228
const std::string * activeBranchComboTag(const ClimbingActionDefinition &action, float normalizedTime)
Optional combo tag. @borrowed From action; lifetime ends when the caller-owned action changes or is d...
Definition ClimbingRuntimeInternal.h:103
float finalWarpWindowEnd(const ClimbingActionDefinition &action)
Final warp window end.
Definition ClimbingRuntimeInternal.h:139
constexpr float epsilon
Definition ClimbingRuntimeInternal.h:13
bool isSupportSelectorMatch(const ClimbingActionDefinition &action, int shapeTag, int materialId)
True when support selector match.
Definition ClimbingRuntimeInternal.h:254
Vec3 clampMagnitude(Vec3 value, float maximum)
Clamp magnitude.
Definition ClimbingRuntimeInternal.h:72
bool containsAnyTag(const std::vector< std::string > &actionTags, const std::vector< std::string > &policyTags)
True if any tag.
Definition ClimbingRuntimeInternal.h:207
std::int64_t weightedMillimeters(float value, std::int32_t weight)
Weighted millimeters.
Definition ClimbingRuntimeInternal.h:268
void boundedDebugPush(std::vector< T > &values, T value)
Bounded debug push.
Definition ClimbingRuntimeInternal.h:42
bool isObstacleProbeKind(ClimbingActionKind kind)
True when obstacle probe kind.
Definition ClimbingRuntimeInternal.h:168
bool isActivePhase(ClimbingPhase phase)
True when active phase.
Definition ClimbingRuntimeInternal.h:155
bool activeBranchWindow(const ClimbingActionDefinition &action, float normalizedTime)
Active branch window.
Definition ClimbingRuntimeInternal.h:94
float signedHorizontalAngle(Vec3 from, Vec3 to)
Signed horizontal angle.
Definition ClimbingRuntimeInternal.h:144
Vec3 terminalVelocityFor(const ClimbingActionDefinition &action, Vec3 actualDelta, float inverseDelta)
Terminal velocity for.
Definition ClimbingRuntimeInternal.h:123
bool isAnchorHangEnd(ClimbingActionKind kind)
True when anchor hang end.
Definition ClimbingRuntimeInternal.h:174
std::optional< int > parseTagSelector(std::string_view selector, std::string_view prefix)
Parse tag selector.
Definition ClimbingRuntimeInternal.h:243
constexpr std::size_t maxDebugEntries
Definition ClimbingRuntimeInternal.h:14
@ PreserveMomentum
@ MatchGround
ClimbingPhase
Execution lifecycle visible to gameplay and animation adapters.
Definition Climbing.h:470
@ Completed
@ Cancelled
@ Precision
@ ClampDownward
ClimbingActionKind
Data-driven action family; stable action identity remains the definition id.
Definition Climbing.h:46
@ LedgeGrab
@ ClimbDown
@ LadderMount
@ PoleSwing
@ LadderClimb
@ CornerInner
@ BeamBalance
@ CornerOuter
@ LedgeJump
@ AnchorGraph
Definition of one geometry-compatible climbing action.
Definition Climbing.h:160
Owning, replayable climbing candidate; contains no borrowed query pointers.
Definition Climbing.h:290
Normalized contact interval and maximum constraint weight.
Definition Climbing.h:118
Input pose used for one deterministic candidate probe.
Definition Climbing.h:275
Runtime profile controlling capsule geometry and probe limits.
Definition Climbing.h:218
std::vector< std::string > deniedActionTags
Definition Climbing.h:250
std::vector< std::string > defaultActionIds
Definition Climbing.h:248
ClimbingScoreWeights scoreWeights
Definition Climbing.h:246
float autoAssistStrength
Definition Climbing.h:245
std::vector< ClimbingActionDefinition > actions
Definition Climbing.h:255
std::vector< std::string > allowedActionTags
Definition Climbing.h:249
Allocation-free counters produced by the latest runtime workload.
Definition ClimbingTelemetry.h:44
std::int32_t approachSpeed
Definition Climbing.h:128
std::int32_t intentMismatch
Definition Climbing.h:133
std::int32_t warpTranslation
Definition Climbing.h:131
Normalized action interval selecting which motion-warp channels may correct authored motion.
Definition Climbing.h:151
Small owning world-space vector used at climbing module boundaries.
Definition ClimbingPrimitives.h:18
WarpChannels public API.
Definition ClimbingRuntimeInternal.h:78
bool facing
Definition ClimbingRuntimeInternal.h:81
bool horizontal
Definition ClimbingRuntimeInternal.h:79
bool vertical
Definition ClimbingRuntimeInternal.h:80