载入中...
搜索中...
未找到
ClimbingInput.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
10#include "climbing/Climbing.h"
11#include "common/Result.h"
12#include "common/Time.h"
13
14#include <cstddef>
15#include <cstdint>
16#include <optional>
17#include <vector>
18
19namespace eve::climbing {
20
22enum class ClimbingCommand : std::uint8_t { Jump, Climb, Drop, Sprint, Crouch };
23
25enum class ClimbingCoyoteState : std::uint8_t { Outside, Eligible };
26
37
41 Vec3 look{0.f, 0.f, 1.f};
43 std::vector<BufferedClimbingCommand> commands;
44};
45
53public:
55 static constexpr std::size_t MaxBufferedCommands = 16;
56
58 [[nodiscard]] static eve::Result<void> submit(ClimbingIntent& intent, ClimbingCommand command,
59 eve::SimulationTick pressedTick, std::uint64_t bufferTicks);
60
62 [[nodiscard]] static eve::Result<void> submit(ClimbingIntent& intent, ClimbingCommand command,
63 eve::SimulationTick pressedTick,
64 const ClimbingProfileDefinition& profile);
65
67 [[nodiscard]] static std::size_t prune(ClimbingIntent& intent, eve::SimulationTick currentTick) noexcept;
68
73 [[nodiscard]] static eve::Result<std::optional<BufferedClimbingCommand>> consume(ClimbingIntent& intent,
74 ClimbingCommand command,
75 eve::SimulationTick currentTick,
77
79 [[nodiscard]] static std::optional<BufferedClimbingCommand> peek(const ClimbingIntent& intent,
80 ClimbingCommand command,
81 eve::SimulationTick currentTick) noexcept;
82
84 [[nodiscard]] static ClimbingCoyoteState coyoteWindowState(eve::SimulationTick currentTick,
85 eve::SimulationTick lastGroundedTick,
86 std::uint64_t coyoteTicks) noexcept;
87};
88
96public:
102 [[nodiscard]] static eve::Result<ClimbingStart> tryStart(ClimbingRuntime& runtime, physics::World3D& world,
103 const ClimbingPose& pose, ClimbingIntent& intent,
105 eve::SimulationTick lastGroundedTick);
106};
107
108} // namespace eve::climbing
eve::action::ActionExecutionId executionId
eve::EntitySpatialPose pose
Deterministic climbing/parkour planning and capsule-constrained execution.
#define EVENGINE_API_DOMAINS
Definition Export.h:110
World3D * world
Move-only, checked operation results for the common layer.
SimulationTick tick
Common time values and an injectable deterministic simulation clock.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Input-phase operations over a ClimbingIntent component.
Owner-thread climbing planner and executor for one character.
Definition Climbing.h:653
PrePhysics selection transaction joining buffered input to one authoritative execution.
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:63
ClimbingCoyoteState
Named result of evaluating the deterministic grounded grace window.
ClimbingInputMode
Input interpretation used by candidate assist and deterministic selection policies.
Definition Climbing.h:97
ClimbingCommand
Edge and held commands understood by the climbing input phase.
One owning edge command with deterministic lifetime and consumption evidence.
friend bool operator==(const BufferedClimbingCommand &, const BufferedClimbingCommand &)=default
Operator ==.
Hot authoritative intent component; contains no device or callback pointers.
std::vector< BufferedClimbingCommand > commands
Input pose used for one deterministic candidate probe.
Definition Climbing.h:275
Runtime profile controlling capsule geometry and probe limits.
Definition Climbing.h:218
Small owning world-space vector used at climbing module boundaries.