-
Notifications
You must be signed in to change notification settings - Fork 1
FTrace
Tracers with hit and ray configuration. The difference with wire rangers
is that this is a dedicated class being initialized once and used as many
times as it is needed, not creating an instance on every E2 tick and later
wipe that instance out. It can extract every aspect of the trace result structure returned and
it can be sampled locally ( origin
and direction
relative to
entity
or pos
/dir
/ang
) or globally ( entity
is not available and pos
/dir
/ang
are treated world-space data ). Also, it has better performance than the regular wire rangers.
The FTrace
class consists of fast performing traces object-oriented
instance that is designed to be @persist
and initialized in expression
first() || dupefinished()
. That way you create the tracer instance once
and you can use it as many times as you need, without creating a new one.
wire_expression2_ftrace_skip > Contains trace generator blacklisted methods ( ex. GetSkin/GetModel/IsVehicle )
wire_expression2_ftrace_only > Contains trace generator whitelisted methods ( ex. GetSkin/GetModel/IsVehicle )
wire_expression2_ftrace_dprn > Stores the default status output messages streaming destination
wire_expression2_ftrace_enst > Contains flag that enables status output messages
You can create a trace object by calling one of the dedicated creators newFTrace
below
whenever you prefer to attach it to an entity or you prefer not to use the feature.
When sampled locally, it will use the attachment entity to orient its direction
and length in pure Lua. You can also call the class constructor
without an entity to make it world-space based. Remember that negating the trace length will
result in negating the trace direction. That is used because the trace length must always be positive so
the direction is reversed instead.
There are currently three types of trace filters in Garry's mod that you can put in the
trace data
.filter
value. Utilizing the method getFilterMode
will return the
current tracer filter operation mode. The filter configuration is NIL
by default
-
Entity reference directly written to the filter. This entity is skipped by the trace
This filter mode is activated by utilizing thesetFilterEnt
method byEnt
asentity
-
Entity sequential table ( array ) in the filter. Every item is skipped by the trace
This filter mode is activated by utilizing thesetFilterEar
method byEar
asentity array
-
Finction callback routine. This is slower but the most uiversal method available
This filter mode is activated by utilizing thesetFilterFnc
method byFnc
asfunction
- User can also clear the filter entierly by utilizing the
remFilter
method
The internal type of the class is xft
and internal expression type ftrace
, so to create
a tracer instance you can take a look at the example.
The description of the API is provided in the table below.
Instance creator | Out | Description |
---|---|---|
newFTrace () |
Returns flash tracer relative to the world by zero origin position , up direction vector and direction length distance
|
|
newFTrace () |
Returns flash tracer relative to the world by zero origin position , up direction vector and length distance
|
|
newFTrace () |
Returns flash tracer relative to the world by origin position , up direction vector and direction length distance
|
|
newFTrace (,) |
Returns flash tracer relative to the world by origin position , up direction vector and length distance
|
|
newFTrace (,) |
Returns flash tracer relative to the world by origin position , direction vector and direction length distance
|
|
newFTrace (,,) |
Returns flash tracer relative to the world by origin position , direction vector , length distance
|
|
noFTrace () |
Returns invalid flash tracer object |
Class methods | Out | Description |
---|---|---|
:dumpItem () |
Dumps the flash tracer to the chat area by number identifier |
|
:dumpItem () |
Dumps the flash tracer to the chat area by string identifier |
|
:dumpItem (,) |
Dumps the flash tracer by number identifier in the specified area by first argument |
|
:dumpItem (,) |
Dumps the flash tracer by string identifier in the specified area by first argument |
|
:getBase () |
Returns the flash tracer base attachment entity if available |
|
:getChip () |
Returns the flash tracer auto assigned expression chip entity
|
|
:getCollideGroup () |
Returns flash tracer trace collision group enums COLLISION_GROUP
|
|
:getCopy () |
Returns flash tracer copy instance of the current object |
|
:getCopy () |
Returns flash tracer copy instance of the current object with other entity
|
|
:getCopy (,) |
Returns flash tracer copy instance of the current object with other entity and length
|
|
:getCopy (,) |
Returns flash tracer copy instance of the current object with other entity and origin
|
|
:getCopy (,,) |
Returns flash tracer copy instance of the current object with other entity , origin and length
|
|
:getCopy (,,) |
Returns flash tracer copy instance of the current object with other entity , origin and direction
|
|
:getCopy (,,,) |
Returns flash tracer copy instance of the current object with other entity , origin , direction and length
|
|
:getCopy () |
Returns flash tracer copy instance of the current object with other length
|
|
:getCopy () |
Returns flash tracer copy instance of the current object with other origin
|
|
:getCopy (,) |
Returns flash tracer copy instance of the current object with other origin and length
|
|
:getCopy (,) |
Returns flash tracer copy instance of the current object with other origin and direction
|
|
:getCopy (,,) |
Returns flash tracer copy instance of the current object with other origin , direction and length
|
|
:getDir () |
Returns flash tracer direction vector
|
|
:getDirLocal () |
Returns flash tracer world direction vector converted to base attachment entity local axis
|
|
:getDirLocal () |
Returns flash tracer world direction vector converted to angle local axis
|
|
:getDirLocal () |
Returns flash tracer world direction vector converted to entity local axis
|
|
:getDirWorld () |
Returns flash tracer local direction vector converted to base attachment entity world axis
|
|
:getDirWorld () |
Returns flash tracer local direction vector converted to angle world axis
|
|
:getDirWorld () |
Returns flash tracer local direction vector converted to entity world axis
|
|
:getDisplaceFlags () |
Returns the flash tracer trace result DispFlags DISPSURF bitmask
|
|
:getEar () |
Returns the configuration used by the entity array filter |
|
:getEarID () |
Returns the configuration used by the entity array filter as ID indices |
|
:getEarSZ () |
Returns the flash tracer entity filter array size |
|
:getEntity () |
Returns the flash tracer trace result Entity entity
|
|
:getFilterMode () |
Returns flash tracerr filter working mode | |
:getFraction () |
Returns the flash tracer trace result Fraction in the interval [0-1] number
|
|
:getFractionLS () |
Returns the flash tracer trace result FractionLeftSolid in the interval [0-1] number
|
|
:getFractionLen () |
Returns the flash tracer trace result Fraction multiplied by its length distance number
|
|
:getFractionLenLS () |
Returns the flash tracer trace result FractionLeftSolid multiplied by its length distance number
|
|
:getHitBox () |
Returns the flash tracer trace result HitBox number
|
|
:getHitContents () |
Returns the flash tracer trace result hit surface Contents CONTENTS bitmask
|
|
:getHitGroup () |
Returns the flash tracer trace result HitGroup group ID number
|
|
:getHitNormal () |
Returns flash tracer trace result surface HitNormal vector
|
|
:getHitPos () |
Returns the flash tracer trace result HitPos location vector
|
|
:getHitTexture () |
Returns the flash tracer trace result HitTexture string
|
|
:getLen () |
Returns flash tracer length distance
|
|
:getMask () |
Returns flash tracer trace hit mask enums MASK
|
|
:getMatType () |
Returns the flash tracer trace result MatType material type number
|
|
:getNormal () |
Returns the flash tracer trace result Normal aim vector
|
|
:getPhysicsBoneID () |
Returns the flash tracer trace result PhysicsBone ID number
|
|
:getPlayer () |
Returns the flash tracer auto assigned expression chip player
|
|
:getPos () |
Returns flash tracer origin position
|
|
:getPosLocal () |
Returns flash tracer world origin position converted to base attachment entity local axis
|
|
:getPosLocal () |
Returns flash tracer world origin position converted to entity local axis
|
|
:getPosLocal (,) |
Returns flash tracer world origin position converted to position /angle local axis
|
|
:getPosWorld () |
Returns flash tracer local origin position converted to base attachment entity world axis
|
|
:getPosWorld () |
Returns flash tracer local origin position converted to entity world axis
|
|
:getPosWorld (,) |
Returns flash tracer local origin position converted to position /angle world axis
|
|
:getStart () |
Returns flash tracer trace start position sent to trace line
|
|
:getStartPos () |
Returns the flash tracer trace result StartPos vector
|
|
:getStop () |
Returns flash tracer trace stop position sent to trace line
|
|
:getSurfPropsID () |
Returns the flash tracer trace result SurfaceProps ID type number
|
|
:getSurfPropsName () |
Returns the flash tracer trace result SurfaceProps ID type name string
|
|
:getSurfaceFlags () |
Returns the flash tracer trace result SurfaceFlags SURF bitmask
|
|
:insEar () |
Inserts the entity in the filter list |
|
:insEar () |
Inserts the entities from the array in the filter list |
|
:insEar () |
Inserts the entities from the table in the filter list |
|
:insEarID () |
Inserts the entity ID in the filter list |
|
:insEarID () |
Inserts the entity ID from the array in the filter list |
|
:insEarID () |
Inserts the entity ID from the table in the filter list |
|
:insFncOnly (,) |
Inserts an option to the flash tracer function internal only list |
|
:insFncOnly (,) |
Inserts an option to the flash tracer function internal only list |
|
:insFncOnlyEnt () |
Inserts the entity to the flash tracer internal only hit list |
|
:insFncSkip (,) |
Inserts an option to the flash tracer function internal ignore hit list |
|
:insFncSkip (,) |
Inserts an option to the flash tracer function internal ignore hit list |
|
:insFncSkipEnt () |
Inserts the entity to the flash tracer internal ignore hit list |
|
:isAllSolid () |
Returns the flash tracer trace result AllSolid flag |
|
:isHit () |
Returns the flash tracer trace result Hit flag |
|
:isHitNoDraw () |
Returns the flash tracer trace result HitNoDraw flag |
|
:isHitNonWorld () |
Returns the flash tracer trace result HitNonWorld flag |
|
:isHitSky () |
Returns the flash tracer trace result HitSky flag |
|
:isHitWorld () |
Returns the flash tracer trace result HitWorld flag |
|
:isIgnoreWorld () |
Returns the flash tracer trace IgnoreWorld flag |
|
:isStartSolid () |
Returns the flash tracer trace result StartSolid flag |
|
:rayAim (,,) |
Aims the flash tracer ray at a given position using three numbers
|
|
:rayAim () |
Aims the flash tracer ray at a given position using a vector
|
|
:rayAmend (,,) |
Amends the flash tracer ray direction using three numbers
|
|
:rayAmend () |
Amends the flash tracer ray direction using a vector
|
|
:rayAmend (,) |
Amends the flash tracer ray direction using vector and magnitude
|
|
:rayDiv () |
Contracts the flash tracer ray with a number
|
|
:rayDiv (,,) |
Contracts the flash tracer ray each component individually using three numbers
|
|
:rayDiv () |
Contracts the flash tracer ray each component individually using a vector
|
|
:rayMove () |
Moves the flash tracer ray with its own direction and magnitude
|
|
:rayMove () |
Moves the flash tracer ray with its own direction and magnitude length
|
|
:rayMove (,,) |
Moves the flash tracer ray with displacement as three numbers
|
|
:rayMove () |
Moves the flash tracer ray with displacement vector
|
|
:rayMove (,) |
Moves the flash tracer ray with direction vector , magnitude length
|
|
:rayMul () |
Expands the flash tracer ray with a number
|
|
:rayMul (,,) |
Expands the flash tracer ray each component individually using three numbers
|
|
:rayMul () |
Expands the flash tracer ray each component individually using a vector
|
|
:remBase () |
Removes the base attachment entity of the flash tracer |
|
:remEar () |
Removes all entities from the filter list |
|
:remEar () |
Removes the specified entity from the filter list |
|
:remEarID () |
Removes the specified entity by ID from the filter list |
|
:remEarN () |
Removes an entity using the specified sequential number
|
|
:remFilter () |
Removes the filter from the trace configuration |
|
:remFnc () |
Removes all the options from the function flash tracer internal preferences |
|
:remFnc () |
Removes the option from the function flash tracer internal preferences |
|
:remFncEnt () |
Removes all the entities from the function flash tracer internal list |
|
:remFncOnly (,) |
Removes the option from the function flash tracer internal only list |
|
:remFncOnly (,) |
Removes the option from the function flash tracer internal only list |
|
:remFncOnlyEnt () |
Removes all the entities from the function flash tracer internal only list |
|
:remFncOnlyEnt () |
Removes the entity from the function flash tracer internal only list |
|
:remFncSkip (,) |
Removes the option from the function flash tracer internal ignore list |
|
:remFncSkip (,) |
Removes the option from the function flash tracer internal ignore list |
|
:remFncSkipEnt () |
Removes all the entities from the function flash tracer internal ignore list |
|
:remFncSkipEnt () |
Removes the entity from the function flash tracer internal ignore list |
|
:setBase () |
Updates the flash tracer base attachment entity
|
|
:setCollideGroup () |
Updates flash tracer trace collision group enums COLLISION_GROUP
|
|
:setDir (,,) |
Updates the flash tracer direction using three numbers
|
|
:setDir () |
Updates the flash tracer direction using an array
|
|
:setDir () |
Updates the flash tracer direction using a vector
|
|
:setFilterEar () |
Changes the filtering mode to entity array
|
|
:setFilterEnt () |
Changes the filtering mode to entity object |
|
:setFilterFnc () |
Changes the filtering mode to function routine |
|
:setIsIgnoreWorld () |
Updates the flash tracer trace IgnoreWorld flag |
|
:setLen () |
Updates flash tracer length distance
|
|
:setMask () |
Updates flash tracer trace hit mask enums MASK
|
|
:setPos (,,) |
Updates the flash tracer origin position using three numbers
|
|
:setPos () |
Updates the flash tracer origin position using an array
|
|
:setPos () |
Updates the flash tracer origin position using a vector
|
|
:smpLocal () |
Samples the flash tracer and updates the trace result by base attachment entity local axis
|
|
:smpLocal () |
Samples the flash tracer and updates the trace result by base position , angle
|
|
:smpLocal () |
Samples the flash tracer and updates the trace result by entity position and forward vectors
|
|
:smpLocal (,) |
Samples the flash tracer and updates the trace result by entity position , angle
|
|
:smpLocal (,) |
Samples the flash tracer and updates the trace result by position , entity angle
|
|
:smpLocal () |
Samples the flash tracer and updates the trace result by position , base angle
|
|
:smpLocal (,) |
Samples the flash tracer and updates the trace result by position , angle
|
|
:smpWorld () |
Samples the flash tracer and updates the trace result by the world axis
|
|
:smpWorld () |
Samples the flash tracer and updates the trace result by entity position and angle forward |
|
:smpWorld () |
Samples the flash tracer and updates the trace result by entity position and forward vectors
|
|
:smpWorld (,) |
Samples the flash tracer and updates the trace result by entity position , angle
|
|
:smpWorld (,) |
Samples the flash tracer and updates the trace result by position , entity angle
|
|
:smpWorld () |
Samples the flash tracer and updates the trace result by position vector and entity forward |
|
:smpWorld (,) |
Samples the flash tracer and updates the trace result by position , angle
|
|
:updEarSZ () |
Performs flash tracer entity array filter list refresh |
General functions | Out | Description |
---|---|---|
:setFTrace () |
Returns flash tracer relative to the entity by zero origin position , up direction vector and direction length distance
|
|
:setFTrace () |
Returns flash tracer relative to the entity by zero origin position , up direction vector and length distance
|
|
:setFTrace () |
Returns flash tracer relative to the entity by origin position , up direction vector and direction length distance
|
|
:setFTrace (,) |
Returns flash tracer relative to the entity by origin position , up direction vector and length distance
|
|
:setFTrace (,) |
Returns flash tracer relative to the entity by origin position , direction vector and direction length distance
|
|
:setFTrace (,,) |
Returns flash tracer relative to the entity by origin position , direction vector , length distance
|