载入中...
搜索中...
未找到
ActionCollisionIgnoreState.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
9
10#include <functional>
11#include <map>
12#include <memory>
13#include <string>
14
15namespace eve::physics {
16class World3D;
17}
18
20
28
35 std::function<Result<ActionCollisionPair>(ecs::EntityHandle, std::string_view channel)>;
36
48public:
57
59 void setEnabled(bool enabled);
61 [[nodiscard]] bool enabled() const;
64 [[nodiscard]] bool supports(eve::action::ActionStateWindowKind kind) const noexcept override;
75
81 [[nodiscard]] Result<void> shutdown();
83 [[nodiscard]] std::size_t activeCount() const noexcept { return active_.size(); }
85 [[nodiscard]] std::size_t pairCount() const noexcept { return pairs_.size(); }
86
87private:
88 using ActiveKey = std::pair<eve::action::ActionExecutionId, std::string>;
89 struct PairKey {
93 friend bool operator==(const PairKey&, const PairKey&) noexcept = default;
95 friend auto operator<=>(const PairKey&, const PairKey&) noexcept = default;
96 };
97 struct PairState {
98 bool restoreEnabled = true;
99 std::size_t owners = 0;
100 };
101
102 [[nodiscard]] Result<PairKey> resolvePair(ecs::EntityHandle subject, std::string_view channel) const;
103 [[nodiscard]] World3D* liveWorld() const noexcept;
104 void restorePair(const PairKey& key, const PairState& state) noexcept;
105 void releaseAll() noexcept;
106
107 World3D* world_ = nullptr;
108 std::weak_ptr<const void> worldLifetime_;
109 PhysicsWorldHandle worldHandle_ = PhysicsWorldHandle::invalid();
110 ActionCollisionPairResolver resolver_;
111 std::map<ActiveKey, PairKey> active_;
112 std::map<PairKey, PairState> pairs_;
113};
114
115} // namespace eve::physics::action_adapter
Typed combat/input/collision action-state window contracts.
int subject
Definition AnimSmr.cpp:163
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::uint32_t key
std::int32_t second
std::int32_t first
TokenKind kind
eve::action::ActionVfxBinding binding
World3D * world
const VegetationPresetContext & context
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Optional target-domain adapter for paired action state windows.
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:63
Owns temporary body-pair collision overrides projected from Action windows.
std::size_t pairCount() const noexcept
Number of distinct body pairs currently owned by the adapter.
std::size_t activeCount() const noexcept
Number of active execution/item window keys.
ActionStateWindowKind
Stable semantic kind for one built-in state window.
std::function< Result< ActionCollisionPair >(ecs::EntityHandle, std::string_view channel)> ActionCollisionPairResolver
Resolves an action entity and semantic channel to two physics links.
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
bool enabled
Context linking a routed event to its action execution.
Owning validated state-window request authored on an action timeline.
Owning event projection returned by the runtime sampler.
Owning generation-qualified body pair selected for one collision channel.
PhysicsLink second
Second distinct body link owned by the same World3D.
PhysicsLink first
First body link; ordering is canonicalized by the adapter.