-
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 getMode()
will return the
current tracer filter operation mode. The filter configuration is NIL
by default
-
Entity reference directly written to the filter
EU
. This entity is skipped by the trace This filter mode is activated by utilizing theuseUnit()
methods after adding theentity
. -
Entity sequential table ( array ) in the filter
AR
. Every item is skipped by the trace This filter mode is activated by utilizing theuseArray()
after filling theentity
array
. -
Finction callback routine. This is slower but the most uiversal method available
This filter mode is activated by utilizing the
useAction()
method to enable the routineFN
.
User can also clear the filter entierly by utilizing the remFilter()
method. When the configuration
is copied from some other instance, the mode will always be NA
indicating that the instance is not
using its own configuration provided by its own methods.
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 |
---|---|---|
:addEntHitOnly () |
Deprecated . Please use the alias putActionOnlyEnt(xft:e) instead ! |
|
:addEntHitSkip () |
Deprecated . Please use the alias putActionSkipEnt(xft:e) instead ! |
|
:addHitOnly (,) |
Deprecated . Please use the alias putActionOnly(xft:sn) instead ! |
|
:addHitOnly (,) |
Deprecated . Please use the alias putActionOnly(xft:ss) instead ! |
|
:addHitSkip (,) |
Deprecated . Please use the alias putActionSkip(xft:sn) instead ! |
|
:addHitSkip (,) |
Deprecated . Please use the alias putActionSkip(xft:ss) instead ! |
|
:cpyAction () |
Copies other flash tracer function filtering data |
|
:cpyArray () |
Copies other flash tracer entity array filtering data |
|
: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 |
|
:getArray () |
Returns the configuration used by the entity array filter
|
|
:getArrayID () |
Returns the configuration used by the entity array filter as ID indices |
|
:getArraySZ () |
Returns the flash tracer entity filter array size |
|
: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
|
|
:getContents () |
Returns the flash tracer trace result hit surface Contents CONTENTS bitmask
|
|
: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
|
|
:getDispFlags () |
Returns the flash tracer trace result DispFlags DISPSURF bitmask
|
|
:getDisplaceFlags () |
Deprecated . Please use the alias getDispFlags(xft:) instead ! |
|
:getDisplacementFlags () |
Deprecated . Please use the alias getDispFlags(xft:) instead ! |
|
:getEntity () |
Returns the flash tracer trace result Entity entity
|
|
: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 () |
Deprecated . Please use the alias getContents(xft:) instead ! |
|
: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
|
|
:getMode () |
Returns current flash tracer filter working mode. Function FN , array AR , entity EU , other NA , invalid XX
|
|
: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 () |
Deprecated . Please use the alias getSurfacePropsID(xft:) instead ! |
|
:getSurfPropsName () |
Deprecated . Please use the alias getSurfacePropsName(xft:) instead ! |
|
:getSurfaceFlags () |
Returns the flash tracer trace result SurfaceFlags SURF bitmask
|
|
:getSurfacePropsID () |
Returns the flash tracer trace result SurfaceProps ID type number
|
|
:getSurfacePropsName () |
Returns the flash tracer trace result SurfaceProps ID type name string
|
|
:getUnit () |
Returns the configuration used by the entity unit filter
|
|
: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
|
|
:putActionOnly (,) |
Inserts an option to the function flash tracer internal only list
|
|
:putActionOnly (,) |
Inserts an option to the function flash tracer internal only list
|
|
:putActionOnlyEnt () |
Inserts the entity to the function flash tracer internal only list
|
|
:putActionSkip (,) |
Inserts an option to the function flash tracer internal ignore list
|
|
:putActionSkip (,) |
Inserts an option to the function flash tracer internal ignore list
|
|
:putActionSkipEnt () |
Inserts the entity to the function flash tracer internal ignore list
|
|
:putArray () |
Inserts the argument in the entity array filter list
|
|
:putArray () |
Inserts the entities from the array in the filter list
|
|
:putArray () |
Inserts the entities from the table in the filter list
|
|
:putArrayID () |
Inserts the entity ID in the filter list
|
|
:putArrayID () |
Inserts the entity ID from the array in the filter list
|
|
:putArrayID () |
Inserts the entity ID from the table in the filter list
|
|
:putUnit () |
Inserts the argument in the entity unit filter
|
|
: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
|
|
:remAction () |
Removes all the options from the function flash tracer internal preferences |
|
:remAction () |
Removes the option from the function flash tracer internal preferences |
|
:remActionEnt () |
Removes all the entities from the function flash tracer internal list
|
|
:remActionOnly (,) |
Removes the option from the function flash tracer internal only list
|
|
:remActionOnly (,) |
Removes the option from the function flash tracer internal only list
|
|
:remActionOnlyEnt () |
Removes all the entities from the function flash tracer internal only list
|
|
:remActionOnlyEnt () |
Removes the entity from the function flash tracer internal only list
|
|
:remActionSkip (,) |
Removes the option from the function flash tracer internal ignore list
|
|
:remActionSkip (,) |
Removes the option from the function flash tracer internal ignore list
|
|
:remActionSkipEnt () |
Removes all the entities from the function flash tracer internal ignore list
|
|
:remActionSkipEnt () |
Removes the entity from the function flash tracer internal ignore list
|
|
:remArray () |
Removes all entities from the filter list
|
|
:remArray () |
Removes the specified entity from the filter list
|
|
:remArrayID () |
Removes the specified entity by ID from the filter list
|
|
:remArrayN () |
Removes an entity using the specified sequential number
|
|
:remBase () |
Removes the base attachment entity of the flash tracer |
|
:remEntHit () |
Deprecated . Please use the alias remActionEnt(xft:) instead ! |
|
:remEntHitOnly () |
Deprecated . Please use the alias remActionOnlyEnt(xft:) instead ! |
|
:remEntHitOnly () |
Deprecated . Please use the alias remActionOnlyEnt(xft:e) instead ! |
|
:remEntHitSkip () |
Deprecated . Please use the alias remActionSkipEnt(xft:) instead ! |
|
:remEntHitSkip () |
Deprecated . Please use the alias remActionSkipEnt(xft:e) instead ! |
|
:remFilter () |
Removes the filter from the trace configuration
|
|
:remHit () |
Deprecated . Please use the alias remAction(xft:) instead ! |
|
:remHit () |
Deprecated . Please use the alias remAction(xft:s) instead ! |
|
:remHitOnly (,) |
Deprecated . Please use the alias remActionOnly(xft:sn) instead ! |
|
:remHitOnly (,) |
Deprecated . Please use the alias remActionOnly(xft:ss) instead ! |
|
:remHitSkip (,) |
Deprecated . Please use the alias remActionSkip(xft:sn) instead ! |
|
:remHitSkip (,) |
Deprecated . Please use the alias remActionSkip(xft:ss) instead ! |
|
:remUnit () |
Removes the configuration used by the entity unit filter
|
|
: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
|
|
: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
|
|
:updArraySZ () |
Performs flash tracer entity array filter list refresh |
|
:useAction () |
Changes the filtering mode to function routine |
|
:useAction () |
Uses other flash tracer function filtering by reference
|
|
:useArray () |
Changes the filtering mode to entity array
|
|
:useArray () |
Uses other flash tracer entity array filtering by reference
|
|
:useUnit () |
Changes the filtering mode to entity unit |
|
:useUnit () |
Uses other flash tracer entity unit filtering by reference
|
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
|