Raised This Month: $ Target: $400
 0% 

[1 solution found] Calculating an entities mins/maxs according to the entityangles


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-31-2007 , 09:43   Re: [1 solution found] Calculating an entities mins/maxs according to the entityangle
Reply With Quote #7

Quote:
Originally Posted by VEN View Post
I didn't get two things: why not solid and why sphere? Isn't it should be solid parallelepiped?
no no, the entity have to be solid that i can get its ID by get_user_aiming() function (to remove it)

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:
Isn't it should be solid parallelepiped?
Don't know what you mean...has this to do with 3D math !?


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])
{
    log_amx("before point : %f - %f - %f", point[0], point[1], point[2]);
    point[0] = (point[0] * floatcos(angle[1], degrees)) - (point[1] * floatsin(angle[1], degrees));
    point[1] = (point[1] * floatcos(angle[1], degrees)) + (point[0] * floatsin(angle[1], degrees));
    log_amx("after1 point : %f - %f - %f", point[0], point[1], point[2]);
    point[0] = (point[0] * floatcos(angle[2], degrees)) - (point[2] * floatsin(angle[2], degrees));
    point[2] = (point[2] * floatcos(angle[2], degrees)) + (point[0] * floatsin(angle[2], degrees));
    log_amx("after2 point : %f - %f - %f", point[0], point[1], point[2]);
    point[1] = (point[1] * floatcos(angle[0], degrees)) - (point[2] * floatsin(angle[0], degrees));
    point[2] = (point[2] * floatcos(angle[0], degrees)) + (point[1] * floatsin(angle[0], degrees));
    log_amx("after3 point : %f - %f - %f", point[0], point[1], point[2]);
    return 1;
}
I get weird server crashes... got an error window "backward mins/maxs"
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
__________________
regalis is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode