-
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.
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 trace relative to the world by zero origin position, up direction vector and direction length distance | |
newFTrace () |
Returns flash trace relative to the world by zero origin position, up direction vector and length distance | |
newFTrace () |
Returns flash trace relative to the world by origin position, up direction vector and direction length distance | |
newFTrace (,) |
Returns flash trace relative to the world by origin position, up direction vector and length distance | |
newFTrace (,) |
Returns flash trace relative to the world by origin position, direction vector and direction length distance | |
newFTrace (,,) |
Returns flash trace relative to the world by origin position, direction vector, length distance | |
noFTrace () |
Returns invalid flash trace object |
Class methods | Out | Description |
---|---|---|
:addEntHitOnly () |
Adds the entity to the flash trace internal only hit list | |
:addEntHitSkip () |
Adds the entity to the flash trace internal ignore hit list | |
:addHitOnly (,) |
Adds the option to the flash trace internal hit only list | |
:addHitOnly (,) |
Adds the option to the flash trace internal hit only list | |
:addHitSkip (,) |
Adds the option to the flash trace internal ignore hit list | |
:addHitSkip (,) |
Adds the option to the flash trace internal ignore hit list | |
:dumpItem () |
Dumps the flash trace to the chat area by number identifier | |
:dumpItem () |
Dumps the flash trace to the chat area by string identifier | |
:dumpItem (,) |
Dumps the flash trace by number identifier in the specified area by first argument | |
:dumpItem (,) |
Dumps the flash trace by string identifier in the specified area by first argument | |
:getBase () |
Returns the flash trace base attachment entity if available | |
:getChip () |
Returns the flash trace auto-assigned expression chip entity | |
:getCollideGroup () |
Returns flash trace trace collision group enums COLLISION_GROUP
|
|
:getCopy () |
Returns flash trace copy instance of the current object | |
:getCopy () |
Returns flash trace copy instance of the current object using other entity | |
:getCopy (,) |
Returns flash trace copy instance of the current object using other entity and length | |
:getCopy (,) |
Returns flash trace copy instance of the current object using other entity and origin | |
:getCopy (,,) |
Returns flash trace copy instance of the current object using other entity, origin and length | |
:getCopy (,,) |
Returns flash trace copy instance of the current object using other entity, origin and direction | |
:getCopy (,,,) |
Returns flash trace copy instance of the current object using other entity, origin, direction and length | |
:getCopy () |
Returns flash trace copy instance of the current object using other length | |
:getCopy () |
Returns flash trace copy instance of the current object using other origin | |
:getCopy (,) |
Returns flash trace copy instance of the current object using other origin and length | |
:getCopy (,) |
Returns flash trace copy instance of the current object using other origin and direction | |
:getCopy (,,) |
Returns flash trace copy instance of the current object using other origin, direction and length | |
:getDir () |
Returns flash trace direction vector | |
:getDirLocal () |
Returns flash trace world direction vector converted to base attachment entity local axis | |
:getDirLocal () |
Returns flash trace world direction vector converted to angle local axis | |
:getDirLocal () |
Returns flash trace world direction vector converted to entity local axis | |
:getDirWorld () |
Returns flash trace local direction vector converted to base attachment entity world axis | |
:getDirWorld () |
Returns flash trace local direction vector converted to angle world axis | |
:getDirWorld () |
Returns flash trace local direction vector converted to entity world axis | |
:getDisplaceFlags () |
Returns the flash trace trace-result DispFlags DISPSURF bitmask
|
|
:getEntity () |
Returns the flash trace trace-result Entity entity |
|
:getFraction () |
Returns the flash trace trace-result Fraction in the interval [0-1] number |
|
:getFractionLS () |
Returns the flash trace trace-result FractionLeftSolid in the interval [0-1] number |
|
:getFractionLen () |
Returns the flash trace trace-result Fraction multiplied by its length distance number |
|
:getFractionLenLS () |
Returns the flash trace trace-result FractionLeftSolid multiplied by its length distance number |
|
:getHitBox () |
Returns the flash trace trace-result HitBox number |
|
:getHitContents () |
Returns the flash trace trace-result hit surface Contents CONTENTS bitmask
|
|
:getHitGroup () |
Returns the flash trace trace-result HitGroup group ID number |
|
:getHitNormal () |
Returns flash trace trace-result surface HitNormal vector |
|
:getHitPos () |
Returns the flash trace trace-result HitPos location vector |
|
:getHitTexture () |
Returns the flash trace trace-result HitTexture string |
|
:getLen () |
Returns flash trace length distance | |
:getMask () |
Returns flash trace trace hit mask enums MASK
|
|
:getMatType () |
Returns the flash trace trace-result MatType material type number |
|
:getNormal () |
Returns the flash trace trace-result Normal aim vector |
|
:getPhysicsBoneID () |
Returns the flash trace trace-result PhysicsBone ID number |
|
:getPlayer () |
Returns the flash trace auto-assigned expression chip player | |
:getPos () |
Returns flash trace origin position | |
:getPosLocal () |
Returns flash trace world origin position converted to base attachment entity local axis | |
:getPosLocal () |
Returns flash trace world origin position converted to entity local axis | |
:getPosLocal (,) |
Returns flash trace world origin position converted to position/angle local axis | |
:getPosWorld () |
Returns flash trace local origin position converted to base attachment entity world axis | |
:getPosWorld () |
Returns flash trace local origin position converted to entity world axis | |
:getPosWorld (,) |
Returns flash trace local origin position converted to position/angle world axis | |
:getStart () |
Returns flash trace trace start position sent to trace-line
|
|
:getStartPos () |
Returns the flash trace trace-result StartPos vector |
|
:getStop () |
Returns flash trace trace stop position sent to trace-line
|
|
:getSurfPropsID () |
Returns the flash trace trace-result SurfaceProps ID type number |
|
:getSurfPropsName () |
Returns the flash trace trace-result SurfaceProps ID type name string |
|
:getSurfaceFlags () |
Returns the flash trace trace-result SurfaceFlags SURF bitmask
|
|
:isAllSolid () |
Returns the flash trace trace-result AllSolid flag |
|
:isHit () |
Returns the flash trace trace-result Hit flag |
|
:isHitNoDraw () |
Returns the flash trace trace-result HitNoDraw flag |
|
:isHitNonWorld () |
Returns the flash trace trace-result HitNonWorld flag |
|
:isHitSky () |
Returns the flash trace trace-result HitSky flag |
|
:isHitWorld () |
Returns the flash trace trace-result HitWorld flag |
|
:isIgnoreWorld () |
Returns the flash trace trace IgnoreWorld flag |
|
:isStartSolid () |
Returns the flash trace trace-result StartSolid flag |
|
:rayAim (,,) |
Aims the flash trace ray at a given position using three numbers | |
:rayAim () |
Aims the flash trace ray at a given position using a vector | |
:rayAmend (,,) |
Amends the flash trace ray direction using three numbers | |
:rayAmend () |
Amends the flash trace ray direction using a vector | |
:rayAmend (,) |
Amends the flash trace ray direction using vector and magnitude | |
:rayDiv () |
Contracts the flash trace ray with a number | |
:rayDiv (,,) |
Contracts the flash trace ray each component individually using three numbers | |
:rayDiv () |
Contracts the flash trace ray each component individually using a vector | |
:rayMove () |
Moves the flash trace ray with its own direction and magnitude | |
:rayMove () |
Moves the flash trace ray with its own direction and magnitude length | |
:rayMove (,,) |
Moves the flash trace ray with displacement as three numbers | |
:rayMove () |
Moves the flash trace ray with displacement vector | |
:rayMove (,) |
Moves the flash trace ray with direction vector, magnitude length | |
:rayMul () |
Expands the flash trace ray with a number | |
:rayMul (,,) |
Expands the flash trace ray each component individually using three numbers | |
:rayMul () |
Expands the flash trace ray each component individually using a vector | |
:remBase () |
Removes the base attachment entity of the flash trace | |
:remEntHit () |
Removes all the entities from the flash trace internal hit list | |
:remEntHitOnly () |
Removes all the entities from the flash trace internal only hit list | |
:remEntHitOnly () |
Removes the entity from the flash trace internal only hit list | |
:remEntHitSkip () |
Removes all the entities from the flash trace internal ignore hit list | |
:remEntHitSkip () |
Removes the entity from the flash trace internal ignore hit list | |
:remHit () |
Removes all the options from the flash trace internal hit preferences | |
:remHit () |
Removes the option from the flash trace internal hit preferences | |
:remHitOnly (,) |
Removes the option from the flash trace internal only hit list | |
:remHitOnly (,) |
Removes the option from the flash trace internal only hit list | |
:remHitSkip (,) |
Removes the option from the flash trace internal ignore hit list | |
:remHitSkip (,) |
Removes the option from the flash trace internal ignore hit list | |
:setBase () |
Updates the flash trace base attachment entity | |
:setCollideGroup () |
Updates flash trace trace collision group enums COLLISION_GROUP
|
|
:setDir (,,) |
Updates the flash trace direction using three numbers | |
:setDir () |
Updates the flash trace direction using an array | |
:setDir () |
Updates the flash trace direction using a vector | |
:setIsIgnoreWorld () |
Updates the flash trace trace IgnoreWorld flag |
|
:setLen () |
Updates flash trace length distance | |
:setMask () |
Updates flash trace trace hit mask enums MASK
|
|
:setPos (,,) |
Updates the flash trace origin position using three numbers | |
:setPos () |
Updates the flash trace origin position using an array | |
:setPos () |
Updates the flash trace origin position using a vector | |
:smpLocal () |
Samples the flash trace and updates the trace-result by base attachment entity local axis |
|
:smpLocal () |
Samples the flash trace and updates the trace-result by base position, angle |
|
:smpLocal () |
Samples the flash trace and updates the trace-result by entity position and forward vectors |
|
:smpLocal (,) |
Samples the flash trace and updates the trace-result by entity position, angle |
|
:smpLocal (,) |
Samples the flash trace and updates the trace-result by position, entity angle |
|
:smpLocal () |
Samples the flash trace and updates the trace-result by position, base angle |
|
:smpLocal (,) |
Samples the flash trace and updates the trace-result by position, angle |
|
:smpWorld () |
Samples the flash trace and updates the trace-result by the world axis |
|
:smpWorld () |
Samples the flash trace and updates the trace-result by entity position and angle forward |
|
:smpWorld () |
Samples the flash trace and updates the trace-result by entity position and forward vectors |
|
:smpWorld (,) |
Samples the flash trace and updates the trace-result by entity position, angle |
|
:smpWorld (,) |
Samples the flash trace and updates the trace-result by position, entity angle |
|
:smpWorld () |
Samples the flash trace and updates the trace-result by position vector and entity forward |
|
:smpWorld (,) |
Samples the flash trace and updates the trace-result by position, angle |
General functions | Out | Description |
---|---|---|
:setFTrace () |
Returns flash trace relative to the entity by zero origin position, up direction vector and direction length distance | |
:setFTrace () |
Returns flash trace relative to the entity by zero origin position, up direction vector and length distance | |
:setFTrace () |
Returns flash trace relative to the entity by origin position, up direction vector and direction length distance | |
:setFTrace (,) |
Returns flash trace relative to the entity by origin position, up direction vector and length distance | |
:setFTrace (,) |
Returns flash trace relative to the entity by origin position, direction vector and direction length distance | |
:setFTrace (,,) |
Returns flash trace relative to the entity by origin position, direction vector, length distance |