• Objects in FOV
    9 replies, posted
Hi, I made a function and I want this function to only affect objects in my Field Of View. I know I need some fancy maths, can somebody help me with this? Thanks :)
[url]http://wiki.garrysmod.com/page/ents/FindInCone[/url] then run traces to confirm said objects aren't behind walls (unless you don't care if they are behind a wall)
But Screen isnt circular so it wont work correctly
You can check with this: [url]https://wiki.garrysmod.com/page/Entity/Visible[/url]
Well, it isn't what I ment, I want to get scalar vector
You're going to have to be more specific than that on your application
Yeah, sorry, but have you any idea?
That still doesn't help. Why do you need a scalar and in what direction?
Okey, to make it clear. I want to aply some function to objects only in my field of view but instead of using Entity:Visible i prefer to use mathematical formula, something like frustrum culling
You have the field of view in degrees - from this you can dot product your player's aim direction and the direction of (target - player) and compare it to the field of view degree amount. You're not going to be able to use actual screen dimensions without trusting the client which is most usually unsafe. [editline]10th October 2016[/editline] Entity.Visible isn't what it sounds like - it checks if the entity is in a pvs of another entity, which is not whats onscreen
Sorry, you need to Log In to post a reply to this thread.