Structures/TraceResult

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Update released)
(Added Contents)
 
Line 8: Line 8:
  
 
Used for {{ClassFunction|CEffectData|SetSurfaceProp}}.|0
 
Used for {{ClassFunction|CEffectData|SetSurfaceProp}}.|0
}}{{StructureField|boolean|StartSolid|Indicates whenever the trace started in a solid enviroment.|false}}{{StructureField|boolean|AllSolid|True if the entire trace is inside a solid.|false}}{{StructureField|number|SurfaceFlags|The surface flags of the hit surface. See {{Enum|SURF}}.|0
+
}}{{StructureField|boolean|StartSolid|Indicates whenever the trace started in a solid enviroment.|false}}{{StructureField|boolean|AllSolid|True if the entire trace is inside a solid.|false}}{{StructureField|number|SurfaceFlags|The surface flags of the hit surface. See {{Enum|SURF}}.|0}}{{StructureField|number|DispFlags|The displacement flags of the hit surface. See {{Enum|DISPSURF}}.|0}}{{StructureField|number|Contents|{{NextUpdate}}
}}{{StructureField|number|DispFlags|The displacement flags of the hit surface. See {{Enum|DISPSURF}}.|0
+
 
 +
The contents of the hit surface. See {{Enum|CONTENTS}}.
 
}}
 
}}
 
}}
 
}}

Latest revision as of 15:30, 6 July 2019

Table structure used as trace result. Default values are when the trace hits nothing.



Type Name Description
Entity Entity

The entity hit by the trace.

Default: NULL

number Fraction

This indicates the how much of your trace length was used from 0-1 (resultLength/originalLength).

Default: 1

number FractionLeftSolid

Given the trace started in a solid enviroment, this will return at what distance the trace left the solid from 0-1. Doesn't work if the trace hit a non-worldspawn entity.

Default: 0

boolean Hit

Indicates whether the trace hit something.

Default: false

number HitBox

The ID of the hitbox hit by the trace.

Default: 0

number HitGroup

HITGROUP_ Enums describing what hitgroup the trace hit (not the same as HitBox).

Default: 0

boolean HitNoDraw

Indicates whenever the trace hit a no-draw brush.

Default: false

boolean HitNonWorld

Indicates whenever the trace did not hit the world.

Default: false

Vector HitNormal

The direction of the surface that was hit as a normal vector (vector with length of 1).

Default: Vector(0, 0, 0)

Vector HitPos

The position the trace stopped. This will be the provided endpos if the trace hit nothing.

boolean HitSky

Indicates whenever the trace hit the sky.

Default: false

string HitTexture

The surface material (not texture) of whatever the trace hit. Will be "**displacement**" if the trace hit a displacement, and **studio** if it hit a prop.

Default: "**empty**"

boolean HitWorld

Indicates whenever the trace hit the world.

Default: false

number MatType

MAT_ Enums of the material hit by the trace.

Default: 0

Vector Normal

The direction of the trace as a normal vector (vector with length of 1).

number PhysicsBone

The PhysObj ID that was hit.

Used for Entity:GetPhysicsObjectNum.

Default: 0

Vector StartPos

The origin of the trace. Will match the provided startpos.

number SurfaceProps

ID of hit surface property from scripts/surfaceproperties.txt. You can get the name using util.GetSurfacePropName.

Used for CEffectData:SetSurfaceProp.

Default: 0

boolean StartSolid

Indicates whenever the trace started in a solid enviroment.

Default: false

boolean AllSolid

True if the entire trace is inside a solid.

Default: false

number SurfaceFlags

The surface flags of the hit surface. See SURF_ Enums.

Default: 0

number DispFlags

The displacement flags of the hit surface. See DISPSURF_ Enums.

Default: 0

number Contents
Next Update Change

This feature is only available in the next update.

The contents of the hit surface. See CONTENTS_ Enums.

Personal tools
Navigation