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
Author Message
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-28-2007 , 12:47   [1 solution found] Calculating an entities mins/maxs according to the entityangles
Reply With Quote #1

Code:
// Here the angles are read
ent_angles[ent_count][0] = str_to_float(str_value[0]);
ent_angles[ent_count][1] = str_to_float(str_value[1]);
ent_angles[ent_count][2] = str_to_float(str_value[2]);

// And here the entities angles is set
set_pev(ent, pev_angles, ent_angles[ent_count]);
This mins/maxs are correct for this angle: (0.0, 270.0, 0.0)
Code:
new Float:mins[3] = {-11.0, -2.0, 27.0};
new Float:maxs[3] = {11.0, 2.0, 71.0};
engfunc(EngFunc_SetSize, ent, mins, maxs);
ent_count++;
But if the angle is like this: (0.0, 90.0, 0.0) the mins/maxs are not correct.
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
__________________

Last edited by regalis; 05-28-2007 at 14:06. Reason: *smile*
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 08:00.


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