12#include <simplesquirrel/simplesquirrel.hpp>
20eve::Value candidateValue(ClimbingCandidate candidate) {
22 {
"actionId", std::move(candidate.actionId)},
23 {
"definitionGeneration", std::to_string(candidate.definitionGeneration)},
24 {
"world",
static_cast<std::int64_t
>(candidate.world.packed())},
25 {
"obstacleBody",
static_cast<std::int64_t
>(candidate.obstacleBody.packed())},
26 {
"obstacleShape",
static_cast<std::int64_t
>(candidate.obstacleShape.packed())},
27 {
"obstacleBodyId", candidate.obstacleBodyId},
28 {
"obstacleShapeId", candidate.obstacleShapeId},
29 {
"ignoredBodyId", candidate.ignoredBodyId},
30 {
"frontPoint", vecValue(candidate.frontPoint)},
31 {
"topPoint", vecValue(candidate.topPoint)},
32 {
"landingFeet", vecValue(candidate.landingFeet)},
33 {
"surfaceNormal", vecValue(candidate.surfaceNormal)},
34 {
"surfaceTangent", vecValue(candidate.surfaceTangent)},
35 {
"leftHandAnchor", vecValue(candidate.leftHandAnchor)},
36 {
"rightHandAnchor", vecValue(candidate.rightHandAnchor)},
37 {
"bodyLocalTop", vecValue(candidate.bodyLocalTop)},
38 {
"bodyLocalLanding", vecValue(candidate.bodyLocalLanding)},
39 {
"obstacleHeight", candidate.obstacleHeight},
40 {
"obstacleDepth", candidate.obstacleDepth},
41 {
"score", candidate.score},
42 {
"kind",
static_cast<std::int64_t
>(candidate.kind)},
43 {
"support",
static_cast<std::int64_t
>(candidate.support)},
69eve::Value advanceValue(ClimbingAdvance advance) {
72 {
"actionId", std::move(advance.actionId)},
73 {
"feet", vecValue(advance.feet)},
74 {
"desiredDelta", vecValue(advance.desiredDelta)},
75 {
"actualDelta", vecValue(advance.actualDelta)},
76 {
"warpResidual", vecValue(advance.warpResidual)},
77 {
"normalizedTime", advance.normalizedTime},
78 {
"constrained", advance.constrained},
79 {
"grounded", advance.grounded},
80 {
"support",
static_cast<std::int64_t
>(advance.support)},
81 {
"leftHandAnchor", vecValue(advance.leftHandAnchor)},
82 {
"rightHandAnchor", vecValue(advance.rightHandAnchor)},
83 {
"contactWeight", advance.contactWeight},
84 {
"leftHandWeight", advance.leftHandWeight},
85 {
"rightHandWeight", advance.rightHandWeight},
86 {
"leftFootAnchor", vecValue(advance.leftFootAnchor)},
87 {
"rightFootAnchor", vecValue(advance.rightFootAnchor)},
88 {
"hasLeftFootAnchor", advance.hasLeftFootAnchor},
89 {
"hasRightFootAnchor", advance.hasRightFootAnchor},
90 {
"leftFootWeight", advance.leftFootWeight},
91 {
"rightFootWeight", advance.rightFootWeight},
92 {
"pelvisWeight", advance.pelvisWeight},
93 {
"compactCollisionRequested", advance.compactCollisionRequested},
94 {
"compactCollisionActive", advance.compactCollisionActive},
95 {
"branchWindowOpen", advance.branchWindowOpen},
96 {
"branchComboTag", std::move(advance.branchComboTag)},
97 {
"executionId", std::to_string(advance.executionId.value())},
98 {
"appliedWarp", vecValue(advance.appliedWarp)},
99 {
"desiredYawDelta", advance.desiredYawDelta},
100 {
"cameraCueProfile", std::move(advance.cameraCueProfile)},
101 {
"cameraCue", std::move(advance.cameraCue)},
102 {
"animationClipId", std::move(advance.animationClipId)},
103 {
"animationGraphNodeId", std::move(advance.animationGraphNodeId)},
104 {
"animationMirrored", advance.animationMirrored},
105 {
"terminalVelocity", vecValue(advance.terminalVelocity)},
106 {
"hasTerminalVelocity", advance.hasTerminalVelocity},
110eve::Value debugValue(ClimbingDebugSnapshot snapshot) {
115 queries.reserve(
snapshot.queries.size());
116 for (
auto& query :
snapshot.queries)
118 {
"code", std::move(
query.code)},
119 {
"start", vecValue(
query.start)},
120 {
"end", vecValue(
query.end)},
121 {
"radius",
query.radius},
122 {
"height",
query.height}}));
127 {
"code", std::move(item.code)},
128 {
"biasCost", item.biasCost},
129 {
"heightCost", item.heightCost},
130 {
"distanceCost", item.distanceCost},
131 {
"totalCost", item.totalCost}}));
133 motion.reserve(
snapshot.motion.size());
134 for (
const auto& item :
snapshot.motion)
135 motion.push_back(
eve::
Value::
object({{
"tick", std::to_string(item.tick.value())},
136 {
"plannedFeet", vecValue(item.plannedFeet)},
137 {
"actualFeet", vecValue(item.actualFeet)},
138 {
"residual", vecValue(item.residual)},
139 {
"capsuleHeight", item.capsuleHeight},
140 {
"constrained", item.constrained}}));
144 {
"accumulatedWarpResidual", vecValue(
snapshot.accumulatedWarpResidual)},
145 {
"broadPhaseQueryCount",
static_cast<std::int64_t
>(
snapshot.broadPhaseQueryCount)},
146 {
"broadPhaseHitCount",
static_cast<std::int64_t
>(
snapshot.broadPhaseHitCount)},
147 {
"queryCount",
static_cast<std::int64_t
>(
snapshot.queryCount)},
148 {
"terminalCode", std::move(
snapshot.terminalCode)},
149 {
"executionId",
static_cast<std::int64_t
>(
snapshot.executionId.value())},
156std::optional<ClimbingActionKind> parseActionKind(std::string_view
value) {
177std::optional<ClimbingAnchorEdgeKind> parseAnchorEdgeKind(std::string_view
value) {
192 {
"graphId", std::move(
reference.graphId)},
194 {
"graphGeneration", std::to_string(
reference.graphGeneration)},
198eve::Value graphReloadValue(ClimbingAnchorGraphReload reload) {
200 invalidated.reserve(reload.invalidatedOccupants.size());
201 for (
const auto& occupant : reload.invalidatedOccupants)
203 {
"agentId", std::to_string(occupant.agentId.value())},
204 {
"executionId", std::to_string(occupant.executionId.value())},
207 {
"oldGeneration", std::to_string(reload.oldGeneration)},
208 {
"newGeneration", std::to_string(reload.newGeneration)},
209 {
"invalidatedOccupants",
eve::Value(std::move(invalidated))},
215eve::Value anchorRouteValue(ClimbingAnchorRoute route) {
217 nodes.reserve(route.nodes.size());
220 steps.reserve(route.steps.size());
223 {
"from", anchorNodeValue(std::move(
step.from))},
224 {
"to", anchorNodeValue(std::move(
step.to))},
225 {
"kind", anchorEdgeKindName(
step.kind)},
228 {
"graphId", std::move(route.graphId)},
229 {
"graphGeneration", std::to_string(route.graphGeneration)},
263eve::Value anchorOverlayValue(ClimbingAnchorAuthoringOverlay overlay) {
265 nodes.reserve(overlay.nodes.size());
268 {
"id", std::move(
node.id)},
269 {
"kind", anchorKindName(
node.kind)},
270 {
"position", vecValue(
node.position)},
271 {
"normal", vecValue(
node.normal)},
272 {
"tangent", vecValue(
node.tangent)},
273 {
"leftHandSocket", vecValue(
node.leftHandSocket)},
274 {
"rightHandSocket", vecValue(
node.rightHandSocket)},
275 {
"feetSocket", vecValue(
node.feetSocket)},
276 {
"occupancySlots",
static_cast<std::int64_t
>(
node.occupancySlots)},
279 edges.reserve(overlay.edges.size());
282 {
"from", std::move(
edge.from)},
283 {
"to", std::move(
edge.to)},
284 {
"kind", anchorEdgeKindName(
edge.kind)},
285 {
"bidirectional",
edge.bidirectional},
288 {
"graphId", std::move(overlay.graphId)},
289 {
"buildSettingsHash", std::move(overlay.buildSettingsHash)},
298 auto json = encoded.value().toJson();
301 {
"graphJson", std::move(json).takeValue()},
302 {
"buildSettingsHash", std::move(
result.graph.buildSettingsHash)},
303 {
"ledgeNodeCount",
static_cast<std::int64_t
>(
result.ledgeNodeCount)},
304 {
"ladderNodeCount",
static_cast<std::int64_t
>(
result.ladderNodeCount)},
324 return {
"contact.left_hand",
"contact.right_hand",
"land"};
334std::optional<ClimbingCancelReason> parseCancelReason(std::string_view
value) {
345template <
class Ref,
class Proxy,
class Release>
348 const Ref ref = std::move(
reference).takeValue();
349 auto object = eve::script::makeOwnedSquirrelInstance<Proxy>(
vm, std::make_unique<Proxy>(ref));
352 object.ignore(
"failed to create owned climbing proxy");
353 std::invoke(std::forward<Release>(release), ref).ignore(
"rollback failed climbing allocation");
356 ssq::Object
owned = std::move(
object).takeValue();
359 result.set(
"ownership", std::string(
"owned"));
360 result.set(
"ownerEpoch",
static_cast<std::int64_t
>(ref.ownerEpoch));
361 result.set(
"handle",
static_cast<std::int64_t
>(ref.packed()));
366struct ScriptClimbingAnchorGraph {
368 ~ScriptClimbingAnchorGraph() noexcept {
380void Climbing::expose(ssq::Table& table) {
382 auto graph = table.addClass<ScriptClimbingAnchorGraph>(
383 "ClimbingAnchorGraph", std::function<ScriptClimbingAnchorGraph*()>([]() {
return nullptr; }),
false);
384 graph.addFunc(
"ownership", [](ScriptClimbingAnchorGraph*) {
return std::string(
"owned"); });
385 graph.addFunc(
"isStale", [](ScriptClimbingAnchorGraph*
value) {
388 graph.addFunc(
"release", [
vm](ScriptClimbingAnchorGraph*
value) {
392 "climbing anchor graph proxy must not be null",
393 "anchorGraph", {},
"climbing.binding")));
396 graph.addFunc(
"node", [
vm](ScriptClimbingAnchorGraph*
value,
const std::string&
nodeId) {
402 {},
"climbing.binding")),
410 "anchorGraph", {},
"climbing.binding")),
413 graph.addFunc(
"reloadJson", [
vm](ScriptClimbingAnchorGraph*
value,
const std::string& json) {
419 {},
"climbing.binding")),
435 "anchorGraph", {},
"climbing.binding")),
438 graph.addFunc(
"planRoute", [
vm](ScriptClimbingAnchorGraph*
value,
const std::string& startNodeId,
439 const std::string& goalNodeId,
bool avoidFull, std::int64_t agentId,
440 std::int64_t
executionId, std::int64_t maxVisitedNodes) {
442 maxVisitedNodes <= 0 || maxVisitedNodes > 65536)
446 "graph, paired non-negative owner ids, and route bound are required",
447 "planRoute", {},
"climbing.binding")),
455 "anchorGraph", {},
"climbing.binding")),
461 auto goal =
resolved->nodeRef(goalNodeId);
465 ClimbingAnchorRouteRequest
request;
467 request.goal = std::move(goal).takeValue();
474 request.maxVisitedNodes =
static_cast<std::uint32_t
>(maxVisitedNodes);
477 graph.addFunc(
"generation", [](ScriptClimbingAnchorGraph*
value) -> std::string {
478 if (!
value)
return {};
482 graph.addFunc(
"reservationCount", [](ScriptClimbingAnchorGraph*
value) -> std::int64_t {
483 if (!
value)
return 0;
485 return resolved.isBound() ?
static_cast<std::int64_t
>(
resolved->reservationCount()) : 0;
487 auto runtime =
table.addClass<ScriptClimbingRuntime>(
488 "ClimbingRuntime", std::function<ScriptClimbingRuntime*()>([]() {
return nullptr; }),
false);
489 runtime.addFunc(
"ownership", [](ScriptClimbingRuntime*) {
return std::string(
"owned"); });
490 runtime.addFunc(
"isStale",
492 runtime.addFunc(
"release", [
vm](ScriptClimbingRuntime*
value) {
496 "climbing runtime proxy must not be null",
497 "runtime", {},
"climbing.binding")));
500 runtime.addFunc(
"setProfileJson", [
vm](ScriptClimbingRuntime*
value,
const std::string& json) {
504 "climbing runtime proxy must not be null",
505 "runtime", {},
"climbing.binding")));
511 "runtime", {},
"climbing.binding")));
513 runtime.addFunc(
"reloadProfileJson", [
vm](ScriptClimbingRuntime*
value,
const std::string& json) {
517 "climbing runtime proxy must not be null",
518 "runtime", {},
"climbing.binding")));
524 "runtime", {},
"climbing.binding")));
526 runtime.addFunc(
"setProfile", [
vm](ScriptClimbingRuntime*
value,
float radius,
float height,
float skin,
527 float probeDistance,
float obstacleHeight,
float minTopNormalY,
528 float maxWarpResidual,
int maskBits) {
532 "climbing runtime proxy must not be null",
533 "runtime", {},
"climbing.binding")));
538 "climbing runtime handle is stale",
"runtime", {},
539 "climbing.binding")));
542 profile.capsuleHeight =
height;
544 profile.maxProbeDistance = probeDistance;
545 profile.maxObstacleHeight = obstacleHeight;
546 profile.minTopNormalY = minTopNormalY;
547 profile.maxWarpResidual = maxWarpResidual;
548 profile.queryFilter.maskBits =
static_cast<std::uint32_t
>(maskBits);
551 runtime.addFunc(
"upsertAction", [
vm](ScriptClimbingRuntime*
value,
const std::string&
id,
float minHeight,
552 float maxHeight,
float minSpeed,
float durationSeconds,
float landingForward,
553 float apexHeight,
int selectionBias) {
557 "climbing runtime proxy must not be null",
558 "runtime", {},
"climbing.binding")));
563 "climbing runtime handle is stale",
"runtime", {},
564 "climbing.binding")));
568 vm,
resolved->upsertAction({id, minHeight, maxHeight, minSpeed, std::move(duration).takeValue(),
569 landingForward, apexHeight, selectionBias}));
571 runtime.addFunc(
"upsertActionKind", [
vm](ScriptClimbingRuntime*
value,
const std::string&
id,
572 const std::string&
kind,
float minHeight,
float maxHeight,
float minSpeed,
573 float durationSeconds,
float landingForward,
float apexHeight,
574 int selectionBias,
float hangBodyOffset,
float hangFeetBelowLedge,
575 float handSpacing,
float cancelStart,
float cancelEnd) {
579 "climbing runtime proxy must not be null",
580 "runtime", {},
"climbing.binding")));
585 "climbing runtime handle is stale",
"runtime", {},
586 "climbing.binding")));
587 const auto parsedKind = parseActionKind(
kind);
591 "unknown climbing action kind",
"kind", {},
"climbing.binding")));
594 ClimbingActionDefinition
action{
595 id, minHeight, maxHeight, minSpeed, std::move(
duration).takeValue(), landingForward,
596 apexHeight, selectionBias};
597 action.kind = *parsedKind;
598 action.hangBodyOffset = hangBodyOffset;
599 action.hangFeetBelowLedge = hangFeetBelowLedge;
600 action.handSpacing = handSpacing;
601 action.cancelWindowStart = cancelStart;
602 action.cancelWindowEnd = cancelEnd;
603 action.requiredNotifies = requiredNotifiesForKind(*parsedKind);
606 runtime.addFunc(
"validateActionClip", [
vm](ScriptClimbingRuntime*
value,
const std::string& actionId,
607 animation::AnimClip*
clip) {
611 "runtime and animation clip are required",
612 "validateActionClip", {},
"climbing.binding")));
618 "runtime", {},
"climbing.binding")));
620 runtime.addFunc(
"probeMode", [
vm](ScriptClimbingRuntime*
value, physics::World3D* world,
float x,
float y,
float z,
621 float forwardX,
float forwardZ,
float speed,
float verticalSpeed,
bool grounded) {
622 if (!
value || !world)
626 "runtime and world are required",
627 "probeMode", {},
"climbing.binding")),
634 "runtime", {},
"climbing.binding")),
637 resolved->probe(*world, {{
x,
y,
z}, {forwardX, 0.f, forwardZ}, speed, -1, verticalSpeed, grounded});
650 runtime.addFunc(
"tryBegin", [
vm](ScriptClimbingRuntime*
value, physics::World3D* world,
float x,
float y,
float z,
651 float forwardX,
float forwardZ,
float speed,
int ignoredBodyId,
658 "tryBegin", {},
"climbing.binding")),
665 "runtime", {},
"climbing.binding")),
669 resolved->tryBegin(*world, {{x, y, z}, {forwardX, 0.f, forwardZ}, speed, ignoredBodyId},
673 runtime.addFunc(
"tryBeginMode", [
vm](ScriptClimbingRuntime*
value, physics::World3D* world,
float x,
float y,
674 float z,
float forwardX,
float forwardZ,
float speed,
int ignoredBodyId,
675 float verticalSpeed,
bool grounded, std::int64_t
tick) {
681 "tryBeginMode", {},
"climbing.binding")),
688 "runtime", {},
"climbing.binding")),
693 {{x, y, z}, {forwardX, 0.f, forwardZ}, speed, ignoredBodyId, verticalSpeed, grounded},
697 runtime.addFunc(
"tryBeginAnchor", [
vm](ScriptClimbingRuntime*
value, ScriptClimbingAnchorGraph* graphValue,
698 physics::World3D* world,
const std::string&
nodeId,
699 std::int64_t agentId,
const std::string& actionId,
float x,
float y,
700 float z,
float forwardX,
float forwardZ,
float speed,
int ignoredBodyId,
701 float verticalSpeed,
bool grounded, std::int64_t
tick) {
702 if (!
value || !graphValue || !world || agentId <= 0 ||
tick < 0)
706 "runtime, graph, world, positive agent id, and tick are required",
707 "tryBeginAnchor", {},
"climbing.binding")),
709 auto runtimeResolved = Climbing::resolve(
value->reference);
710 auto graphResolved = Climbing::resolveAnchorGraph(graphValue->reference);
711 if (!runtimeResolved.isBound() || !graphResolved.isBound())
716 "climbing.binding")),
724 runtimeResolved->tryBeginAnchor(
725 *world, graphValue->reference,
node.value(),
727 {{
x,
y,
z}, {forwardX, 0.f, forwardZ}, speed, ignoredBodyId, verticalSpeed, grounded},
731 runtime.addFunc(
"transitionAnchor", [
vm](ScriptClimbingRuntime*
value,
732 ScriptClimbingAnchorGraph* graphValue,
733 physics::World3D* world,
const std::string& targetNodeId,
734 const std::string& edgeKind,
const std::string& actionId,
736 if (!
value || !graphValue || !world ||
tick < 0)
739 "runtime, graph, world, and non-negative tick are required",
740 "transitionAnchor", {},
"climbing.binding")));
741 const auto parsedEdge = parseAnchorEdgeKind(edgeKind);
745 "unknown climbing anchor edge kind",
"edgeKind",
746 {},
"climbing.binding")));
747 auto runtimeResolved = Climbing::resolve(
value->reference);
748 auto graphResolved = Climbing::resolveAnchorGraph(graphValue->reference);
749 if (!runtimeResolved.isBound() || !graphResolved.isBound())
753 {},
"climbing.binding")));
754 auto node = graphResolved->nodeRef(targetNodeId);
757 vm, runtimeResolved->transitionAnchor(*world,
node.value(), *parsedEdge, actionId,
760 runtime.addFunc(
"currentAnchor", [
vm](ScriptClimbingRuntime*
value) {
766 "climbing.binding")),
774 {},
"climbing.binding")),
778 runtime.addFunc(
"cancel", [
vm](ScriptClimbingRuntime*
value,
const std::string& reason, std::int64_t
tick) {
782 "runtime and non-negative tick are required",
783 "cancel", {},
"climbing.binding")));
788 "climbing runtime handle is stale",
"runtime", {},
789 "climbing.binding")));
790 const auto parsed = parseCancelReason(reason);
794 "unknown climbing cancellation reason",
"reason",
795 {},
"climbing.binding")));
799 runtime.addFunc(
"drainEvents", [
vm](ScriptClimbingRuntime*
value) {
805 "climbing.binding")),
813 {},
"climbing.binding")),
816 runtime.addFunc(
"drop", [
vm](ScriptClimbingRuntime*
value, std::int64_t
tick) {
820 "runtime and non-negative tick are required",
821 "drop", {},
"climbing.binding")));
827 "runtime", {},
"climbing.binding")));
829 runtime.addFunc(
"climbUp", [
vm](ScriptClimbingRuntime*
value, std::int64_t
tick) {
833 "runtime and non-negative tick are required",
834 "climbUp", {},
"climbing.binding")));
840 "runtime", {},
"climbing.binding")));
842 runtime.addFunc(
"snapshotJson", [
vm](ScriptClimbingRuntime*
value) {
847 "climbing runtime proxy must not be null",
848 "runtime", {},
"climbing.binding")),
856 {},
"climbing.binding")),
859 runtime.addFunc(
"restoreJson", [
vm](ScriptClimbingRuntime*
value,
const std::string& json,
860 physics::World3D* world) {
861 if (!
value || !world)
864 "runtime and world are required",
"restoreJson",
865 {},
"climbing.binding")));
871 "runtime", {},
"climbing.binding")));
873 runtime.addFunc(
"definitionGeneration", [](ScriptClimbingRuntime*
value) -> std::string {
874 if (!
value)
return {};
878 runtime.addFunc(
"setDebugCapture", [
vm](ScriptClimbingRuntime*
value,
bool enabled) {
882 "climbing runtime proxy must not be null",
883 "runtime", {},
"climbing.binding")));
888 "climbing runtime handle is stale",
"runtime", {},
889 "climbing.binding")));
893 runtime.addFunc(
"inspect", [
vm](ScriptClimbingRuntime*
value) {
899 "climbing.binding")),
906 "runtime", {},
"climbing.binding")),
912 auto module = table.addClass(name, Climbing::create, false);
916void Climbing::expose(ssq::Class&
cls) {
917 cls.addFunc(
"getName", &Climbing::getName);
918 cls.addFunc(
"newRuntime", [
vm =
cls.getHandle()](Climbing*) {
919 return makeOwnedProxy<ClimbingRuntimeHandleRef, ScriptClimbingRuntime>(
920 vm, Climbing::newRuntime(),
921 [](ClimbingRuntimeHandleRef reference) { return Climbing::release(reference); });
923 cls.addFunc(
"newAnchorGraphJson", [
vm =
cls.getHandle()](
Climbing*,
const std::string& json,
924 physics::World3D* world, physics::Body3D*
body) {
926 return makeOwnedProxy<ClimbingAnchorGraphHandleRef, ScriptClimbingAnchorGraph>(
930 "newAnchorGraphJson", {},
"climbing.binding")),
931 [](ClimbingAnchorGraphHandleRef
reference) {
return Climbing::releaseAnchorGraph(
reference); });
934 return makeOwnedProxy<ClimbingAnchorGraphHandleRef, ScriptClimbingAnchorGraph>(
936 [](ClimbingAnchorGraphHandleRef
reference) { return Climbing::releaseAnchorGraph(reference); });
939 return makeOwnedProxy<ClimbingAnchorGraphHandleRef, ScriptClimbingAnchorGraph>(
941 [](ClimbingAnchorGraphHandleRef
reference) { return Climbing::releaseAnchorGraph(reference); });
942 return makeOwnedProxy<ClimbingAnchorGraphHandleRef, ScriptClimbingAnchorGraph>(
943 vm, Climbing::newAnchorGraph(std::move(definition).takeValue(), *world,
body->runtimeHandle()),
944 [](ClimbingAnchorGraphHandleRef
reference) { return Climbing::releaseAnchorGraph(reference); });
946 cls.addFunc(
"bakeAnchorGraphJson", [
vm =
cls.getHandle()](
Climbing*,
const std::string& json) {
961 cls.addFunc(
"inspectAnchorGraphJson", [
vm =
cls.getHandle()](
Climbing*,
const std::string& json) {
eve::action::ActionExecutionId executionId
AuthorityStoreHandleRef reference
攀爬事件 ↔ eve::Value 的**唯一**映射。
Deterministic climbing/parkour planning and capsule-constrained execution.
struct SQVM * HSQUIRRELVM
const GltfImportRequest & request
wgpu::PopErrorScopeStatus status
#define Module_IMPL(ModuleName, newExpr)
std::map< std::string, std::vector< std::string > > graph
std::vector< particles::ParticleRecordEvent > events
std::map< std::array< int, 4 >, std::vector< const Subject * > > candidates
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
static Result< Duration > fromSeconds(double seconds)
Convert finite seconds to the nearest nanosecond.
void ignore(std::string_view reason={}) const noexcept
Explicitly discard this result after documenting the reason.
Move-only operation result carrying either a value or Status.
static Result success(T value)
Construct a successful result owning value.
static Result failure(Status status)
Construct a failed result from a structured status.
Structured status and zero or more diagnostics for an operation.
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
The canonical owning dynamic value used by data-facing protocols.
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
std::vector< Value > Array
static Value object(Object value)
Compatibility factory for an object value.
Script-facing factory and owner for independent climbing runtimes.
static eve::Result< void > release(ClimbingRuntimeHandleRef reference)
Releases a module-owned runtime and invalidates its reference.
static eve::Result< void > releaseAnchorGraph(ClimbingAnchorGraphHandleRef reference)
Releases a module-owned graph instance and all of its reservations.
static bool isStale(ClimbingRuntimeHandleRef reference) noexcept
Reports whether a runtime reference is stale.
static eve::script::Borrowed< ClimbingAnchorGraphInstance > resolveAnchorGraph(ClimbingAnchorGraphHandleRef reference) noexcept
Resolves a live graph instance as a synchronous non-owning observation.
static bool isAnchorGraphStale(ClimbingAnchorGraphHandleRef reference) noexcept
Reports whether a graph instance reference is stale.
static eve::script::Borrowed< ClimbingRuntime > resolve(ClimbingRuntimeHandleRef reference) noexcept
Resolves a live runtime as a non-owning observation.
eve::Result< ClimbingAnchorBakeResult > bakeClimbingAnchorGraph(const ClimbingAnchorBakeRequest &request)
Bakes deterministic ledge and ladder topology from owning semantic geometry samples.
eve::detail::StrongUint64< detail::ClimbingExecutionIdTag > ClimbingExecutionId
Stable non-zero identity assigned when a climbing selection transaction commits.
Value climbingEventArrayValue(std::span< const ClimbingEvent > events)
一批事件 → Value 数组,顺序与传入一致。
ClimbingAnchorEdgeKind
Allowed authored transition between two explicit anchors.
eve::Result< ClimbingAnchorGraphDefinition > decodeClimbingAnchorGraphDefinition(const eve::Value &value)
Decodes and validates a complete owning graph candidate transactionally.
ClimbingAnchorKind
Authored semantic of one explicit climbing anchor.
ClimbingPhase
Execution lifecycle visible to gameplay and animation adapters.
eve::Result< ClimbingAnchorAuthoringOverlay > inspectClimbingAnchorGraphAuthoring(const ClimbingAnchorGraphDefinition &graph)
Builds a validated owning snapshot for an editor or debug-draw adapter.
void exposeClimbingMotionBindings(ssq::Class &runtime, HSQUIRRELVM vm)
Expose climbing motion bindings.
ClimbingDebugCapture
Runtime policy controlling optional owning diagnostic capture.
eve::script::RuntimeHandleRef< ClimbingAnchorGraphHandleTag > ClimbingAnchorGraphHandleRef
Generation- and module-epoch-qualified anchor graph instance reference.
ClimbingActionKind
Data-driven action family; stable action identity remains the definition id.
eve::detail::StrongUint64< detail::ClimbingAnchorAgentIdTag > ClimbingAnchorAgentId
Stable non-zero identity of the character/agent that owns graph occupancy.
eve::Result< ClimbingAnchorBakeRequest > decodeClimbingAnchorBakeRequest(const eve::Value &value)
Decodes all known bake request fields without publishing a graph.
eve::Result< eve::Value > encodeClimbingAnchorGraphDefinition(const ClimbingAnchorGraphDefinition &graph)
Encodes a validated graph to its canonical owning Value representation.
ClimbingProfileDefinition ClimbingProfile
Compatibility-only spelling; ClimbingProfileDefinition is canonical.
eve::Value projectClimbingAdvance(ClimbingAdvance value)
Project climbing advance.
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
eve::Diagnostic Diagnostic
Value vector(glm::dvec3 v)
ssq::Table makeOwnedProxy(HSQUIRRELVM vm, eve::Result< Ref > &&reference, Release &&release)
std::unordered_map< std::string, SkillDefinition > & table()
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
std::string_view phaseName(BattlePhase phase) noexcept
Return the stable protocol spelling of a battle phase.
Build metadata (engine git commit, build time, third-party version).
DiagnosticCode
Stable machine-readable diagnostic codes.
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Owning output of one execution tick.