Questions Find Entity in Sphere
I have few questions about this function
PHP Code:
Will this following be efficient since: 1. it doesn't have a defined radius from the beginning, and it will check a very large area 2. it doesn't have a certain entity to search for so it will detect and others before checking for func_wall PHP Code:
|
Re: Questions Find Entity in Sphere
I found it unclear as to what you wish to accomplish from your post.
So i've gone ahead and created an example on how you could use EngFunc_FindEntityInSphere to search and then filter entities. PHP Code:
|
Re: Questions Find Entity in Sphere
I am trying to check if there is a wall around the origin of a player on a radius of both 100 measures and 300
Then create three cases, case radius <=100 , case 100 < radius <= 300, case default About vector distance from player's origin to wall's origin, the origin of the wall isn't actually at the middle of the wall? meaning that if it is a large block the player might be even touching it and still be at a distance of a over 100 |
Re: Questions Find Entity in Sphere
The origin pev of a func_wall will usually always be 0 0 0, unless it has an origin brush tied to it.
This is purely a map creators choice and there is not much you can do about it. I've found that you can calculate an effective origin like this: PHP Code:
|
Re: Questions Find Entity in Sphere
If you want to detect walls, use traceline.
|
Re: Questions Find Entity in Sphere
Well i need to detect any wall around the player ( back, front, sides ) not only in front
Let me explain exactly what i want to do, so you guys can understand better what i am looking for Everytime a player is killed i want to spawn at his origin a sprite, but sometimes the sprite is too large and it is going through the wall To make sure that the sprite won't collide with the wall i need to reduce it's scale, but i want to reduce the scale only when the player is close to walls, and not when he is in an open area far from walls So in case the player is close to a wall, i want to reduce the scale of the sprite to 2, in case the player is very close to a wall ( for example in a tunnel like on cs_assault ) i want to reduce the scale of the sprite to 1 |
Re: Questions Find Entity in Sphere
In this case I would try to use multiple TraceHull with a size closest to the sprites different sizes.
|
Re: Questions Find Entity in Sphere
Then for just one radius? any method without the need of a loop?
I don't see the need of a loop in this situation, can't it be done like this? PHP Code:
|
Re: Questions Find Entity in Sphere
Not all walls are "func_wall". For example, the map. That's why you should use TraceHull and see if it hits anything at all.
|
Re: Questions Find Entity in Sphere
I don't care about the ground, only walls, or you mean walls assigned as func_detail, func_breakable entities?
|
| All times are GMT -4. The time now is 18:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.