33 lines
1.7 KiB
C++
33 lines
1.7 KiB
C++
#pragma once
|
|
#include "gateway/protocol.hpp"
|
|
#include <optional>
|
|
namespace gateway {
|
|
struct MonsterSpline {
|
|
uint64_t guid=0;
|
|
uint32_t id=0,duration=0;
|
|
uint8_t face=0; // Legacy normal0, stop1, target3 or angle4; not native enums.
|
|
uint64_t transport_guid=0; // Original moving transport, for transport-local splines.
|
|
uint64_t facing_target=0; // Exact source target; angle requires a current bound target position.
|
|
bool flying=false; // Source smooth Flying path; native Flying+Catmullrom.
|
|
bool stop=false; // Explicit terminal packet; it has no duration or path.
|
|
float angle=0;
|
|
std::array<float,3> start{};
|
|
std::vector<std::array<float,3>> points; // Intermediate points, then destination; excludes start.
|
|
};
|
|
struct SplineFacingTarget {
|
|
Guid128 guid{}; // Existing visible actor binding, never synthesized from the source GUID.
|
|
float angle=0; // Source-proven mover/target positions; caller owns freshness.
|
|
};
|
|
struct SplineParseObservation {
|
|
uint64_t guid=0,target=0;uint32_t id=0,flags=0,available=0;uint8_t face=0;
|
|
// Availability:guid1,id2,face4,flags8,target16. Unobservedzero is not an actualfield.
|
|
};
|
|
MonsterSpline turtle_monster_spline(std::span<const uint8_t>,SplineParseObservation* =nullptr, bool on_transport=false);
|
|
// Native linear interpolation divides by each segment length. Preserve the raw
|
|
// source parse and project only its ground polyline before either native writer.
|
|
MonsterSpline project_native_monster_spline(const MonsterSpline&);
|
|
Bytes forever_monster_spline(const MonsterSpline&,const Guid128&,
|
|
std::optional<SplineFacingTarget> target=std::nullopt,
|
|
std::optional<Guid128> bound_transport=std::nullopt);
|
|
}
|