VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Trace Class Reference

runtime.Trace: line and box traces against the physics world. Game-thread only. More...

#include <Trace.hpp>

Public Member Functions

 Trace (const Bindings &bindings)
 
 Trace (const Trace &)=delete
 
Trace & operator= (const Trace &)=delete
 
Status Available () const
 
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< TraceHit > FromEyes (const Pawn &pawn, float distance, TraceLayers layers=TraceLayers::Solid) const
 
Result< bool > Clear (const Vector &from, const Vector &to, const TraceOptions &options={}) const
 

Detailed Description

runtime.Trace: line and box traces against the physics world. Game-thread only.

const auto clear = runtime.Trace.Clear(eye, target, {.Ignore1 = self, .Ignore2 = other});
if (clear && *clear)
...
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56

Definition at line 49 of file Trace.hpp.

Constructor & Destructor Documentation

◆ Trace() [1/2]

VoltMod::Trace::Trace ( const Bindings &  bindings)
inlineexplicit

bindings must outlive this service.

Definition at line 53 of file Trace.hpp.

◆ Trace() [2/2]

VoltMod::Trace::Trace ( const Trace &  )
delete

Member Function Documentation

◆ Available()

Status VoltMod::Trace::Available ( ) const

Unsupported when the Nav_TraceLine slot did not bind.

Definition at line 67 of file Trace.cpp.

References VoltMod::Bindings::NavTraceLine, and VoltMod::Error::Unsupported().

Referenced by Line().

◆ Box()

Result< TraceHit > VoltMod::Trace::Box ( const Vector &  from,
const Vector &  to,
const Vector &  mins,
const Vector &  maxs,
const TraceOptions &  options = {} 
) const

Sweeps mins..maxs along the path; End is the box origin. Unsupported when the Nav_TraceShape slot did not bind.

Definition at line 91 of file Trace.cpp.

References VoltMod::MakeFilter(), VoltMod::NavPhysics(), VoltMod::Bindings::NavTraceShape, VoltMod::ReadFile(), VoltMod::ToHit(), and VoltMod::Error::Unsupported().

◆ Clear()

Result< bool > VoltMod::Trace::Clear ( const Vector &  from,
const Vector &  to,
const TraceOptions &  options = {} 
) const

Definition at line 113 of file Trace.cpp.

References Line(), and VoltMod::ReadFile().

◆ FromEyes()

Result< TraceHit > VoltMod::Trace::FromEyes ( const Pawn &  pawn,
float  distance,
TraceLayers  layers = TraceLayers::Solid 
) const

Along pawn's aim, ignoring the pawn.

Definition at line 107 of file Trace.cpp.

References VoltMod::AngleToForward(), Line(), and VoltMod::ReadFile().

◆ Line()

Result< TraceHit > VoltMod::Trace::Line ( const Vector &  from,
const Vector &  to,
const TraceOptions &  options = {} 
) const

◆ operator=()

Trace & VoltMod::Trace::operator= ( const Trace &  )
delete

The documentation for this class was generated from the following files: