util.QuickTrace

From GMod Wiki

Revision as of 09:46, 6 June 2011 by SiPlus (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax util.QuickTrace( Vector origin, Vector offset, Table /Entity filter )
Where is this used?
Description:
Simple trace function.
Returns: Table :traceres
Part of Library: Util
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Util.QuickTrace]Util.QuickTrace [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Definition of the function

Because it is a convenience function, it is defined by Lua.

 
function util.QuickTrace( origin, dir, filter )
 
	local trace = {}
 
	trace.start = origin
	trace.endpos = origin + dir
	trace.filter = filter
 
	return util.TraceLine( trace )
 
end
 

Examples

DescriptionDo a trace from 128, 128, 128 to 0, 0, 256.
Used onNewerShared.png
Code
traceRes = util.QuickTrace( Vector(128, 128, 128), Vector(-128, -128, 128) )
OutputN/A


Additional Notes

 
local Trace = util.QuickTrace( ply:GetShootPos(), ply:GetAimVector() * 10000, { ply } )
 


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox