Enumerations2
SymbolDescription
RayType
TraceType
Type Sets2
Defines76
SymbolDescription
ALL_VISIBLE_CONTENTS
CONTENTS_AREAPORTALremaining contents are non-visible, and don't eat brushes.
CONTENTS_AUX
CONTENTS_CURRENT_0
CONTENTS_CURRENT_180
CONTENTS_CURRENT_270
CONTENTS_CURRENT_90
CONTENTS_CURRENT_DOWN
CONTENTS_CURRENT_UP
CONTENTS_DEBRIS
CONTENTS_DETAILbrushes to be added after vis leafs.
CONTENTS_EMPTYNo contents.
CONTENTS_GRATEalpha-tested "grate" textures. Bullets/sight pass through, but solids don't.
CONTENTS_HITBOXuse accurate hitboxes on trace.
CONTENTS_IGNORE_NODRAW_OPAQUEignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW.
CONTENTS_LADDER
CONTENTS_MIST
CONTENTS_MONSTERshould never be on a brush, only in game.
CONTENTS_MONSTERCLIP
CONTENTS_MOVEABLEhits entities which are MOVETYPE_PUSH (doors, plats, etc)
CONTENTS_OPAQUEthings that cannot be seen through (may be non-solid though).
CONTENTS_ORIGINremoved before bsp-ing an entity.
CONTENTS_PLAYERCLIP
CONTENTS_SLIME
CONTENTS_SOLIDan eye is never valid in a solid .
CONTENTS_TEAM1per team contents used to differentiate collisions.
CONTENTS_TEAM2between players and objects on different teams.
CONTENTS_TESTFOGVOLUME
CONTENTS_TRANSLUCENTauto set if any surface has trans.
CONTENTS_UNUSED5
CONTENTS_UNUSED6
CONTENTS_WATER
CONTENTS_WINDOWtranslucent, but not watery (glass).
DISPSURF_FLAG_BUILDABLE
DISPSURF_FLAG_SURFACE
DISPSURF_FLAG_SURFPROP1
DISPSURF_FLAG_SURFPROP2
DISPSURF_FLAG_WALKABLE
LAST_VISIBLE_CONTENTS
MASK_ALL
MASK_NPCSOLIDblocks npc movement
MASK_NPCSOLID_BRUSHONLYeverything normally solid for npc movement, except monsters (world+brush only)
MASK_NPCWORLDSTATICjust the world, used for route rebuilding
MASK_OPAQUEeverything that blocks line of sight for AI, lighting, etc
MASK_OPAQUE_AND_NPCSeverything that blocks line of sight for AI, lighting, etc, but with monsters added.
MASK_PLAYERSOLIDeverything that blocks player movement
MASK_PLAYERSOLID_BRUSHONLYeverything normally solid for player movement, except monsters (world+brush only)
MASK_SHOTbullets see these as solid
MASK_SHOT_HULLnon-raycasted weapons see this as solid (includes grates)
MASK_SHOT_PORTALhits solids (not grates) and passes through everything else
MASK_SOLIDeverything that is normally solid
MASK_SOLID_BRUSHONLYeverything normally solid, except monsters (world+brush only)
MASK_SPLITAREAPORTALThese are things that can split areaportals
MASK_VISIBLEeverything that blocks line of sight for players
MASK_VISIBLE_AND_NPCSeverything that blocks line of sight for players, but with monsters added.
MASK_WATERwater physics in these contents
PARTITION_NON_STATIC_EDICTSeverything in solid & trigger except the static props, includes SOLID_NOTs
PARTITION_SOLID_EDICTSevery edict_t that isn't SOLID_TRIGGER or SOLID_NOT (and static props)
PARTITION_STATIC_PROPS
PARTITION_TRIGGER_EDICTSevery edict_t that IS SOLID_TRIGGER
SURF_BUMPLIGHTcalculate three lightmaps for the surface for bumpmapping
SURF_HINTmake a primary bsp splitter
SURF_HITBOXsurface is part of a hitbox
SURF_LIGHTvalue will hold the light strength
SURF_NOCHOPDon't subdivide patches on this surface
SURF_NODECALSDon't receive decals
SURF_NODRAWdon't bother referencing the texture
SURF_NOLIGHTDon't calculate light
SURF_NOPORTALthe surface can not have a portal placed on it
SURF_NOSHADOWSDon't receive shadows
SURF_SKIPcompletely ignore, allowing non-closed brushes
SURF_SKYdon't draw, but add to skybox
SURF_SKY2Ddon't draw, indicates we should skylight + draw 2d sky but not draw the 3D skybox
SURF_TRANS
SURF_TRIGGERThis is an xbox hack to work around elimination of trigger surfaces, which breaks occluders
SURF_WARPturbulent water warp
Functions38
SymbolDescription
TR_AllSolidReturns whether the entire trace was in a solid area.
TR_ClipCurrentRayToEntityClips the current global ray (or hull) to a particular entity.
TR_ClipCurrentRayToEntityExClips the current global ray (or hull) to a particular entity.
TR_ClipRayHullToEntityClips a ray hull to a particular entity.
TR_ClipRayHullToEntityExClips a ray hull to a particular entity.
TR_ClipRayToEntityClips a ray to a particular entity.
TR_ClipRayToEntityExClips a ray to a particular entity.
TR_DidHitReturns if there was any kind of collision along the trace ray.
TR_EnumerateEntitiesEnumerates over entities along a ray. This may find entities that are close to the ray but do not actually intersect it. Use TR_Clip*RayToEntity with TR_DidHit to check if the ray actually intersects the entity.
TR_EnumerateEntitiesBoxEnumerates over entities in a box.
TR_EnumerateEntitiesHullEnumerates over entities along a ray hull. This may find entities that are close to the ray but do not actually intersect it. Use TR_Clip*RayToEntity with TR_DidHit to check if the ray actually intersects the entity.
TR_EnumerateEntitiesPointEnumerates over entities at point.
TR_EnumerateEntitiesSphereEnumerates over entities in a sphere.
TR_GetDisplacementFlagsReturns the displacement flags for the surface that was hit. See DISPSURF_FLAG_*.
TR_GetEndPositionReturns the collision position of a trace result.
TR_GetEntityIndexReturns the entity index that collided with the trace.
TR_GetFractionReturns the time fraction from a trace result (1.0 means no collision).
TR_GetFractionLeftSolidReturns the time fraction from a trace result when it left a solid. Only valid if trace started in solid
TR_GetHitBoxIndexReturns in which hitbox the trace collided if any. Note: if the entity that collided with the trace is the world entity, then this function doesn't return an hitbox index but a static prop index.
TR_GetHitGroupReturns in which body hit group the trace collided if any.
TR_GetPhysicsBoneReturns the index of the physics bone that was hit.
TR_GetPlaneNormalFind the normal vector to the collision plane of a trace.
TR_GetPointContentsGet the contents mask and the entity index at the given position.
TR_GetPointContentsEntGet the point contents testing only the given entity index.
TR_GetStartPositionReturns the starting position of a trace.
TR_GetSurfaceFlagsReturns the surface flags. See SURF_*.
TR_GetSurfaceNameReturns the name of the surface that was hit.
TR_GetSurfacePropsReturns the surface properties index of the surface that was hit.
TR_PointOutsideWorldTests a point to see if it's outside any playable area
TR_StartSolidReturns whether the initial point was in a solid area.
TR_TraceHullStarts up a new trace hull using a global trace result.
TR_TraceHullExStarts up a new trace hull using a new trace result.
TR_TraceHullFilterStarts up a new trace hull using a global trace result and a customized trace ray filter. Calling TR_Trace*Filter or TR_Trace*FilterEx from inside a filter function is currently not allowed and may not work.
TR_TraceHullFilterExStarts up a new trace hull using a new trace result and a customized trace ray filter. Calling TR_Trace*Filter or TR_Trace*FilterEx from inside a filter function is currently not allowed and may not work.
TR_TraceRayStarts up a new trace ray using a global trace result.
TR_TraceRayExStarts up a new trace ray using a new trace result.
TR_TraceRayFilterStarts up a new trace ray using a global trace result and a customized trace ray filter. Calling TR_Trace*Filter or TR_Trace*FilterEx from inside a filter function is currently not allowed and may not work.
TR_TraceRayFilterExStarts up a new trace ray using a new trace result and a customized trace ray filter. Calling TR_Trace*Filter or TR_TraceRay*Ex from inside a filter function is currently not allowed and may not work.