Raised This Month: $ Target: $400
 0% 

Other Type of 'get_distance()'


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 08-27-2008 , 13:38   Other Type of 'get_distance()'
Reply With Quote #1

Hi!

As you know get_distance calculates the distance(units) between 2 X, Y and Z.
It returns the units between them. But let's say you only want to calculate the origins which is the furthest from each other.

In this example, let's say the 2 X origins are furthest from each other.
How to calculate the distance in units between them and don't include the 2 Y and Z origins??

This is just how It could look(illustration), but I want it in small language of course, not C#.
PHP Code:
static cell AMX_NATIVE_CALL get_distance_x(AMX *amxcell *params)
{
    
cell *cpVec1 get_amxaddr(amxparams[1]);
    
cell *cpVec2 get_amxaddr(amxparams[2]);

    
Vector vec1 Vector((float)cpVec1[X]);
    
Vector vec2 Vector((float)cpVec2[X]);

    
int iDist = (int)((vec1 vec2).Length());

    return 
iDist;

__________________
atomen is offline
Send a message via MSN to atomen
 



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 03:04.


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