Class Trace
- Namespace
- CounterStrikeSharp.API.Modules.Utils
- Assembly
- CounterStrikeSharp.API.dll
Static class for performing ray and hull traces against the game world.
public static class Trace
- Inheritance
-
objectTrace
Methods
CheckAreaOverlappingEntity(CCSNavArea, CBaseEntity, bool)
Returns whether a nav area overlaps with an entity's bounding box.
area is an opaque pointer to a CNavArea obtained from the nav system.
[Experimental("CS0001", Message = "CheckAreaOverlappingEntity maps to a Valve function but its behaviour has not been fully understood. Use with caution.")]
public static bool CheckAreaOverlappingEntity(CCSNavArea area, CBaseEntity entity, bool extrudeHullHeight = false)
Parameters
areaCCSNavAreaentityCBaseEntityextrudeHullHeightbool
Returns
GetEntityWorldSpaceAABB(CBaseEntity, out Vector, out Vector)
Returns the world-space axis-aligned bounding box of entity.
public static void GetEntityWorldSpaceAABB(CBaseEntity entity, out Vector mins, out Vector maxs)
Parameters
entityCBaseEntityminsVectormaxsVector
PointContents(Vector, Contents)
Returns the contents bitmask at the given world position.
[Experimental("CS0001", Message = "PointContents maps to a Valve function but its behaviour has not been fully understood. Use with caution.")]
public static Contents PointContents(Vector pos, Contents contentsMask = Contents.Empty)
Parameters
Returns
TraceEndShape(Vector, Vector, CBaseEntity?, TraceOptions?)
Performs a line trace between two world-space points.
public static TraceResult TraceEndShape(Vector startPos, Vector endPos, CBaseEntity? ignoreEntity = null, TraceOptions? options = null)
Parameters
startPosVectorendPosVectorignoreEntityCBaseEntityoptionsTraceOptions
Returns
TraceHullShape(Vector, Vector, Vector, Vector, CBaseEntity?, TraceOptions?)
Performs a hull (box) trace between two world-space points.
public static TraceResult TraceHullShape(Vector startPos, Vector endPos, Vector mins, Vector maxs, CBaseEntity? ignoreEntity = null, TraceOptions? options = null)
Parameters
startPosVectorendPosVectorminsVectormaxsVectorignoreEntityCBaseEntityoptionsTraceOptions
Returns
TraceShape(Vector, QAngle, CBaseEntity?, TraceOptions?)
Performs a line trace from startPos in the direction of
angles for up to 8192 units.
public static TraceResult TraceShape(Vector startPos, QAngle angles, CBaseEntity? ignoreEntity = null, TraceOptions? options = null)
Parameters
startPosVectoranglesQAngleignoreEntityCBaseEntityoptionsTraceOptions