SwiftlyS2

ITraceManager

Interface ITraceManager

Namespace: SwiftlyS2.Shared.Services

Assembly: SwiftlyS2.CS2.dll

public interface ITraceManager

Methods

SimpleTrace(Vector, Vector, RayType_t, RnQueryObjectSet, MaskTrace, MaskTrace, MaskTrace, CollisionGroup, ref CGameTrace, CBaseEntity?, CBaseEntity?)

Performs a simple trace shape operation from the specified start point to the end point, using the provided object query and trace mask. The result of the trace is stored in the provided trace object.

[Obsolete("Use other TraceShape methods instead.")]
void SimpleTrace(Vector start, Vector end, RayType_t rayKind, RnQueryObjectSet objectQuery, MaskTrace interactWith, MaskTrace interactExclude, MaskTrace interactAs, CollisionGroup collision, ref CGameTrace trace, CBaseEntity? filterEntity = null, CBaseEntity? filterSecondEntity = null)
Parameters
  • start Vector — The starting position of the trace, represented as a vector.
  • end Vector — The ending position of the trace, represented as a vector.
  • rayKind RayType_t — The type of ray used for the trace.
  • objectQuery RnQueryObjectSet — The object query specifying which objects to consider during the trace.
  • interactWith MaskTrace — The interaction layer defining the types of surfaces or entities to include in the trace.
  • interactExclude MaskTrace — The interaction layer defining the types of surfaces or entities to exclude from the trace.
  • interactAs MaskTrace — The interaction layer defining the types of surfaces or entities to interact as during the trace.
  • collision CollisionGroup — The collision group defining the collision behavior during the trace.
  • trace CGameTrace — A reference to a CGameTrace structure that receives the results of the trace, including hit information and surface details.
  • filterEntity CBaseEntity? — An optional entity to exclude from the trace.
  • filterSecondEntity CBaseEntity? — An optional second entity to exclude from the trace.

SimpleTrace(Vector, QAngle, RayType_t, RnQueryObjectSet, MaskTrace, MaskTrace, MaskTrace, CollisionGroup, ref CGameTrace, CBaseEntity?, CBaseEntity?)

Performs a simple trace shape operation from the specified start point in the direction defined by the given angle, using the provided object query and trace mask. The result of the trace is stored in the provided trace object.

[Obsolete("Use other TraceShape methods instead.")]
void SimpleTrace(Vector start, QAngle angle, RayType_t rayKind, RnQueryObjectSet objectQuery, MaskTrace interactWith, MaskTrace interactExclude, MaskTrace interactAs, CollisionGroup collision, ref CGameTrace trace, CBaseEntity? filterEntity = null, CBaseEntity? filterSecondEntity = null)
Parameters
  • start Vector — The starting position of the trace, represented as a vector.
  • angle QAngle — The direction of the trace, represented as a QAngle.
  • rayKind RayType_t — The type of ray used for the trace.
  • objectQuery RnQueryObjectSet — The object query specifying which objects to consider during the trace.
  • interactWith MaskTrace — The interaction layer defining the types of surfaces or entities to include in the trace.
  • interactExclude MaskTrace — The interaction layer defining the types of surfaces or entities to exclude from the trace.
  • interactAs MaskTrace — The interaction layer defining the types of surfaces or entities to interact as during the trace.
  • collision CollisionGroup — The collision group defining the collision behavior during the trace.
  • trace CGameTrace — A reference to a CGameTrace structure that receives the results of the trace, including hit information and surface details.
  • filterEntity CBaseEntity? — An optional entity to exclude from the trace.
  • filterSecondEntity CBaseEntity? — An optional second entity to exclude from the trace.

TracePlayerBBox(Vector, Vector, BBox_t, CTraceFilter, ref CGameTrace)

Performs a collision trace of a player-sized bounding box from the specified start position to the end position, using the given filter and bounding box dimensions. The result of the trace is stored in the provided trace object.

[Obsolete("Use TracePlayerBBox method with TraceParams instead.")]
void TracePlayerBBox(Vector start, Vector end, BBox_t bounds, CTraceFilter filter, ref CGameTrace trace)
Parameters
  • start Vector — The starting position of the trace, typically representing the player's initial location.
  • end Vector — The ending position of the trace, representing the target location for the bounding box movement.
  • bounds BBox_t — The dimensions of the player's bounding box to be traced.
  • filter CTraceFilter — The trace filter used to determine which entities or surfaces are considered during the trace operation.
  • trace CGameTrace — A reference to a CGameTrace object that receives the results of the trace, including collision information and hit details.

TracePlayerBBox(in Vector, in Vector, in BBox_t, in TraceParams?)

Performs a collision trace of a player-sized bounding box from the specified start position to the end position, using the given filter and bounding box dimensions. The result of the trace is stored in the provided trace object.

TraceResult TracePlayerBBox(in Vector start, in Vector end, in BBox_t bounds, in TraceParams? param = null)
Parameters
Returns

TraceShape(Vector, Vector, Ray_t, CTraceFilter, ref CGameTrace)

Performs a trace operation from the specified start point to the end point using the given ray and filter, and populates the trace result with collision information.

[Obsolete("Use TraceShapeLine method with TraceParams instead.")]
void TraceShape(Vector start, Vector end, Ray_t ray, CTraceFilter filter, ref CGameTrace trace)
Parameters
  • start Vector — The starting position of the trace, represented as a vector.
  • end Vector — The ending position of the trace, represented as a vector.
  • ray Ray_t — The ray definition used for the trace, specifying direction and other ray properties.
  • filter CTraceFilter — The filter that determines which entities or surfaces are considered during the trace.
  • trace CGameTrace — A reference to a CGameTrace structure that receives the results of the trace, including hit information and surface details.

TraceShapeAngle(in Vector, in QAngle, in TraceParams?)

Traces from start towards angle with the provided shape options.

TraceResult TraceShapeAngle(in Vector start, in QAngle angle, in TraceParams? param = null)
Parameters
  • start Vector — Trace start position.
  • angle QAngle — Trace direction.
  • param TraceParams? — Optional trace params for ray type and filtering.
Returns

TraceShapeAngle(in Vector, in QAngle, float, in TraceParams?)

Traces from start towards angle with the provided shape options.

TraceResult TraceShapeAngle(in Vector start, in QAngle angle, float maxDistance = 8192, in TraceParams? param = null)
Parameters
  • start Vector — Trace start position.
  • angle QAngle — Trace direction.
  • maxDistance float — Maximum distance to trace.
  • param TraceParams? — Optional trace params for ray type and filtering.
Returns

TraceShapeLine(in Vector, in Vector, in TraceParams?)

Traces from start to end with the provided shape options.

TraceResult TraceShapeLine(in Vector start, in Vector end, in TraceParams? param = null)
Parameters
  • start Vector — Trace start position.
  • end Vector — Trace end position.
  • param TraceParams? — Optional trace params for ray type and filtering.
Returns

On this page