Raised This Month: $ Target: $400
 0% 

collision between two entitys?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-23-2009 , 14:03   Re: collision between two entitys?
Reply With Quote #3

If you want simple function, you can use this

PHP Code:
stock IsCollidingiEntity1iEntity2 ) {
    new 
Float:AbsMin1], Float:AbsMin2], Float:AbsMax1], Float:AbsMax2];
    
    
peviEntity1pev_absminAbsMin1 );
    
peviEntity1pev_absmaxAbsMax1 );
    
peviEntity2pev_absminAbsMin2 );
    
peviEntity2pev_absmaxAbsMax2 );
    
    if( 
AbsMin1] > AbsMax2] ||
        
AbsMin1] > AbsMax2] ||
        
AbsMin1] > AbsMax2] ||
        
AbsMax1] < AbsMin2] ||
        
AbsMax1] < AbsMin2] ||
        
AbsMax1] < AbsMin2] )
        return 
0;
    
    return 
1;

__________________
xPaw 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 18:21.


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