• How does ents.FindInBox() work?
    3 replies, posted
Hello there, I'm curious about how ents.FindInBox works. Does it cycle through all entities and checks them with Vector/WithinAABox , or it utilizes more optimized ways of getting entities? Also, is there any sort of documentation of GMod functions that are undefined in garrysmod/lua folder (just like this one)?
You could look through the Source 2013 SDK source code, since IIRC the game is based on that version of the engine. This looks like a good place to start, it appears to have the methods that most of the trace functions in Garry's Mod use.
ents.FindInBox is binded to UTIL_EntitiesInBox which iterates through entities using spacial partition/octree searching. In other words, it searches chunks of area at a time by using a pre-built tree of positional data.
Thanks for replies very much <3
Sorry, you need to Log In to post a reply to this thread.