5#include <entity2/entityidentity.h>
6#include <entity2/entityinstance.h>
53 .Fraction =
trace.m_flFraction,
54 .End =
trace.m_vEndPos,
55 .Normal =
trace.m_vHitNormal,
57 .HitWorld =
trace.DidHit() &&
trace.m_pEnt &&
trace.m_pEnt->m_pEntity &&
58 trace.m_pEnt->GetEntityIndex().Get() == 0};
71 return std::unexpected(
Error::Unsupported(
"the Nav_TraceLine vtable slot did not bind"));
80 return std::unexpected(
available.error());
96 return std::unexpected(
Error::Unsupported(
"the Nav_TraceShape vtable slot did not bind"));
118 return std::unexpected(std::move(
hit).
error());
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
Result< TraceHit > Line(const Vector &from, const Vector &to, const TraceOptions &options={}) const
Result< TraceHit > Box(const Vector &from, const Vector &to, const Vector &mins, const Vector &maxs, const TraceOptions &options={}) const
Result< bool > Clear(const Vector &from, const Vector &to, const TraceOptions &options={}) const
Result< TraceHit > FromEyes(const Pawn &pawn, float distance, TraceLayers layers=TraceLayers::Solid) const
static CTraceFilter MakeFilter(const TraceOptions &options)
static EntityRef RefOf(const CEntityInstance *entity)
static std::string ReadFile(const std::filesystem::path &path)
Vector AngleToForward(const QAngle &angles)
static TraceHit ToHit(const CGameTrace &trace)
static EngineNavPhysics * NavPhysics(void *&table)
std::expected< void, Error > Status
static uint64_t MaskOf(TraceLayers layers)
@ Sight
what hides one player from another
@ Surfaces
every drawn surface and the sky; no player clips or players
static constexpr uint64_t SightMask
std::expected< T, Error > Result
static constexpr uint64_t SurfacesMask
VirtualFn< void(EngineNavPhysics *, const Ray_t *, const Vector *, const Vector *, CTraceFilter *, CGameTrace *)> NavTraceShape
VirtualFn< bool(EngineNavPhysics *, const Vector *, const Vector *, CTraceFilter *, CGameTrace *)> NavTraceLine
static Error Unsupported(std::string detail)
bool Hit
also true when the start is inside a solid