[1 solution found] Calculating an entities mins/maxs according to the entityangles
Code:
// Here the angles are readCode:
new Float:mins[3] = {-11.0, -2.0, 27.0};I have no skills in 3D math so the only thing i could do is hardcode the mins/maxs for nearly every angle...*omg* Does anyone know a function to calc the mins/maxs corresponding to the angles? Thanks in advance regalis |
Re: Calculating an entities mins/maxs according to the entityangles
Just out of curiosity, why would you need to calculate an entities size based on their angles? Just never heard of it being done before.
|
Re: Calculating an entities mins/maxs according to the entityangles
For my Health/Armor Stations plugin...
When you place a station on the wall it have an angle... Now the entity size have to be as big as the model to get the entID through get_user_aiming() (because if the entity is too small you have to search for it "inside" the model) Also the main problem: the entity have to be solid to get the ID through aiming.. :( Thats why i need a function which translates the coordinates of the size according to the angle the model have.. Or does anyone know how to get the entID through get_user_aiming() if the entity is not solid? |
Re: Calculating an entities mins/maxs according to the entityangles
Try this out. It runs EngFunc_FindEntityInSphere on where you aim, and return's the ent's id if found.
PHP Code:
|
Re: Calculating an entities mins/maxs according to the entityangles
OMG !!!!
I'm so dumb :( *hitting my head on the plate* Thank you very much for this idea! Thats it...no complicated math *hrhr* (But if anyone got bored and would like to tell us the solution...feel free...i'm though interested in how to calculate that..0o) greetz regalis |
Re: [1 solution found] Calculating an entities mins/maxs according to the entityangle
I didn't get two things: why not solid and why sphere? Isn't it should be solid parallelepiped?
|
Re: [1 solution found] Calculating an entities mins/maxs according to the entityangle
Quote:
Why not sphere? It works realy got with find_ent_in_sphere()...do you suggest using a other function? The only thing other i can think of is ent_distance()... Quote:
Btw.: i found functions to rotate a point around a axis...but it doesn't work :( Code:
stock rotate_point_by_angle(const Float:angle[3],Float:point[3])Does anyone know what i did wrong? I found out that floatcos()/floatsin() need a flag with degrees otherwise it returns radians..0o But that also crashes the server... Thanks VEN for responding! greetz regalis |
Re: [1 solution found] Calculating an entities mins/maxs according to the entityangle
I think you didn't get my point.
Quote:
|
Re: [1 solution found] Calculating an entities mins/maxs according to the entityangle
Right it should be solid and it is solid. But unfortunately i can only create a small entity in the middle of the model.
Because if the angle of the model changes the entity keeps its angle which is set by the mins/maxs :( Therefore i try to rotate the mins/maxs that i can fill the whole model with the entity to make it real solid. i can post a little screenshot if my explanation is to confusing ;) [IMG]http://img523.**************/img523/8641/screenierx5.th.jpg[/IMG] |
Re: [1 solution found] Calculating an entities mins/maxs according to the entityangle
regalis, did you ever find a solution to this, I'm wanting to do something similar and not recalling what to do to get the mins/maxs to shift with different angles.
|
| All times are GMT -4. The time now is 10:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.