Structures/Trace

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (I was wrong nvm)
(Added collisiongroup key)
Line 5: Line 5:
  
 
Using a function here is super slow. Try to avoid it.|{}
 
Using a function here is super slow. Try to avoid it.|{}
}}{{StructureField|number|mask|The trace mask {{Enum|MASK}}. This determines what the trace should hit and what it shouldn't hit. A mask is a combination of {{Enum|CONTENTS}} - you can use these for more advanced masks.|MASK_SOLID}}{{StructureField|boolean|ignoreworld|Should the trace ignore world or not|false}}{{StructureField|table|output|If set, the trace result will be written to the supplied table instead of returning a new table|nil}}
+
}}{{StructureField|number|mask|The trace mask {{Enum|MASK}}. This determines what the trace should hit and what it shouldn't hit. A mask is a combination of {{Enum|CONTENTS}} - you can use these for more advanced masks.|MASK_SOLID}}{{StructureField|number|collisiongroup|The collision group {{Enum|COLLISION_GROUP}}. This determines what the trace should hit in regards to the entity's collision group.|COLLISION_GROUP_NONE}}{{StructureField|boolean|ignoreworld|Should the trace ignore world or not|false}}{{StructureField|table|output|If set, the trace result will be written to the supplied table instead of returning a new table|nil}}
 
}}
 
}}

Revision as of 20:46, 4 May 2017

Table structure used for util.TraceLine.



Type Name Description
Vector start

The start position of the trace

Vector endpos

The end position of the trace

Entity filter

Things the trace should not hit. Can also be a table of entities or a function with one argument:

  • Entity ent - The entity that the trace hit

Using a function here is super slow. Try to avoid it.

Default: {}

number mask

The trace mask MASK_ Enums. This determines what the trace should hit and what it shouldn't hit. A mask is a combination of CONTENTS_ Enums - you can use these for more advanced masks.

Default: MASK_SOLID

number collisiongroup

The collision group COLLISION_GROUP_ Enums. This determines what the trace should hit in regards to the entity's collision group.

Default: COLLISION_GROUP_NONE

boolean ignoreworld

Should the trace ignore world or not

Default: false

table output

If set, the trace result will be written to the supplied table instead of returning a new table

Default: nil

Personal tools
Navigation