载入中...
搜索中...
未找到
CombatCharacterPose.cpp
浏览该文件的文档.
2
3#include <cmath>
4
5namespace eve::combat {
6
8 if (!characters_)
10 Diagnostic::error(DiagnosticCode::NotFound, "character pose source has no runtime", "characters"));
11 auto state = characters_->state(subject);
12 if (!state) return Result<MeleePose>::failure(state.status());
14 pose.position = {state.value().position.x, state.value().position.y + chestHeight_, state.value().position.z};
15 pose.yawRadians = std::atan2(-state.value().facing.x, state.value().facing.z);
17}
18
19} // namespace eve::combat
int subject
Definition AnimSmr.cpp:163
eve::EntitySpatialPose pose
Character-runtime pose adapter for melee hitboxes.
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
Move-only operation result carrying either a value or Status.
Definition Result.h:155
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:164
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Strong, domain-neutral reference to a runtime subject.
Definition SubjectRef.h:26
Result< MeleePose > pose(SubjectRef subject, std::string_view hitboxId) const override
Resolve the current world pose for one subject's active hitbox.
Result< CombatCharacterState > state(SubjectRef subject) const
Return an owning state snapshot, or NotFound for a stale subject.
World pose for one shape sample.
Definition MeleeHit.h:46