Raised This Month: $51 Target: $400
 12% 

Brush entity mins/max


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 04-02-2008 , 09:26   Brush entity mins/max
Reply With Quote #1

I suck at math.. How would I find a brush entity's mins/maxs? For those of you that don't know, brush entity mins/maxs are based on world origin, not the entity origin ( I think ).
__________________
FatalisDK is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-02-2008 , 09:47   Re: Brush entity mins/max
Reply With Quote #2

I'm not sure to understand well, so forgive me.

If you want you retrieve brush entity origin, you can use this stock ( by VEN )

Code:
stock fm_get_brush_entity_origin(index, Float:origin[3]) {     new Float:mins[3], Float:maxs[3];     pev(index, pev_mins, mins);     pev(index, pev_maxs, maxs);     origin[0] = (mins[0] + maxs[0]) * 0.5;     origin[1] = (mins[1] + maxs[1]) * 0.5;     origin[2] = (mins[2] + maxs[2]) * 0.5;     return 1; }
__________________
Arkshine is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-02-2008 , 09:54   Re: Brush entity mins/max
Reply With Quote #3

Nope! He want to retrieve the brush_ent mins/maxs not the origin.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-02-2008 , 10:29   Re: Brush entity mins/max
Reply With Quote #4

Hm.

So, Try this * I think * :

Code:
    stock fm_get_brush_entity_size( index, Float:vf_Min[3], Float:vf_Max[3] )     {         new Float:vf_Size[3];         pev( index, pev_size, vf_Size );         vf_Min[0] = - ( vf_Size[0] * 0.5 );         vf_Min[1] = - ( vf_Size[1] * 0.5 );         vf_Min[2] = - ( vf_Size[2] * 0.5 );                 vf_Max[0] =  vf_Size[0] * 0.5;         vf_Max[1] =  vf_Size[1] * 0.5;         vf_Max[2] =  vf_Size[2] * 0.5;         return 1;     }
__________________
Arkshine is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 04-02-2008 , 10:51   Re: Brush entity mins/max
Reply With Quote #5

What is wrong with pev_mins and pev_maxs?
__________________
All you need to change the world is one good lie and a river of blood
P34nut is online now
Old 04-02-2008, 11:15
Arkshine
This message has been deleted by Arkshine. Reason: nvm
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-02-2008 , 11:40   Re: Brush entity mins/max
Reply With Quote #6

Nothing wrong with that.

It will work too. Better though since we don't create extra var.

Code:
    stock fm_get_brush_entity_size( index, Float:vf_Min[3], Float:vf_Max[3] )     {         pev( index, pev_mins, vf_Min );         pev( index, pev_maxs, vf_Max );         vf_Min[0] = - ( vf_Max[0] - vf_Min[0] ) * 0.5;         vf_Min[1] = - ( vf_Max[1] - vf_Min[1] ) * 0.5;         vf_Min[2] = - ( vf_Max[2] - vf_Min[2] ) * 0.5;                 vf_Max[0] =  vf_Min[0] * -1.0;         vf_Max[1] =  vf_Min[1] * -1.0;         vf_Max[2] =  vf_Min[2] * -1.0;         return 1;     }
__________________

Last edited by Arkshine; 04-02-2008 at 11:58.
Arkshine is offline
Reply



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 09:27.


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