swiftlys2/docs/api/ai/
API Reference Services

ITraceManager

Interface
Namespace: SwiftlyS2.Shared.Services · Assembly: SwiftlyS2.CS2.dll
public interface ITraceManager
View source

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
  • startVectorThe starting position of the trace, represented as a vector.
  • endVectorThe ending position of the trace, represented as a vector.
  • rayKindRayType_tThe type of ray used for the trace.
  • objectQueryRnQueryObjectSetThe object query specifying which objects to consider during the trace.
  • interactWithMaskTraceThe interaction layer defining the types of surfaces or entities to include in the trace.
  • interactExcludeMaskTraceThe interaction layer defining the types of surfaces or entities to exclude from the trace.
  • interactAsMaskTraceThe interaction layer defining the types of surfaces or entities to interact as during the trace.
  • collisionCollisionGroupThe collision group defining the collision behavior during the trace.
  • traceCGameTraceA reference to a CGameTrace structure that receives the results of the trace, including hit information and surface details.
  • filterEntityCBaseEntity?optionalAn optional entity to exclude from the trace.
  • filterSecondEntityCBaseEntity?optionalAn 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
  • startVectorThe starting position of the trace, represented as a vector.
  • angleQAngleThe direction of the trace, represented as a QAngle.
  • rayKindRayType_tThe type of ray used for the trace.
  • objectQueryRnQueryObjectSetThe object query specifying which objects to consider during the trace.
  • interactWithMaskTraceThe interaction layer defining the types of surfaces or entities to include in the trace.
  • interactExcludeMaskTraceThe interaction layer defining the types of surfaces or entities to exclude from the trace.
  • interactAsMaskTraceThe interaction layer defining the types of surfaces or entities to interact as during the trace.
  • collisionCollisionGroupThe collision group defining the collision behavior during the trace.
  • traceCGameTraceA reference to a CGameTrace structure that receives the results of the trace, including hit information and surface details.
  • filterEntityCBaseEntity?optionalAn optional entity to exclude from the trace.
  • filterSecondEntityCBaseEntity?optionalAn 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
  • startVectorThe starting position of the trace, typically representing the player's initial location.
  • endVectorThe ending position of the trace, representing the target location for the bounding box movement.
  • boundsBBox_tThe dimensions of the player's bounding box to be traced.
  • filterCTraceFilterThe trace filter used to determine which entities or surfaces are considered during the trace operation.
  • traceCGameTraceA 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

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
  • startVectorThe starting position of the trace, represented as a vector.
  • endVectorThe ending position of the trace, represented as a vector.
  • rayRay_tThe ray definition used for the trace, specifying direction and other ray properties.
  • filterCTraceFilterThe filter that determines which entities or surfaces are considered during the trace.
  • traceCGameTraceA 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
  • startVectorTrace start position.
  • angleQAngleTrace direction.
  • paramTraceParams?optionalOptional trace params for ray type and filtering.

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
  • startVectorTrace start position.
  • angleQAngleTrace direction.
  • maxDistancefloatoptionalMaximum distance to trace.
  • paramTraceParams?optionalOptional trace params for ray type and filtering.

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
  • startVectorTrace start position.
  • endVectorTrace end position.
  • paramTraceParams?optionalOptional trace params for ray type and filtering.