Raised This Month: $ Target: $400
 0% 

get_distance_f and vector_distance difference?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alexx109
Junior Member
Join Date: Jun 2010
Location: Brazil
Old 07-20-2011 , 23:58   get_distance_f and vector_distance difference?
Reply With Quote #1

Sup guys.
I was wondering, is there any difference between the vector_distance and the get_distance_f natives? both them included in the vector.inc file...

same parameters, both with Float output promising to do absolutely the same...

shouldn't one of them be removed from the API so?
alexx109 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-21-2011 , 02:41   Re: get_distance_f and vector_distance difference?
Reply With Quote #2

PHP Code:
static cell AMX_NATIVE_CALL get_distance_f(AMX *amxcell *params)
{
    
cell *cpVec1 get_amxaddr(amxparams[1]);
    
cell *cpVec2 get_amxaddr(amxparams[2]);

    
Vector vec1 Vector((float)amx_ctof(cpVec1[0]), (float)amx_ctof(cpVec1[1]), (float)amx_ctof(cpVec1[2]));
    
Vector vec2 Vector((float)amx_ctof(cpVec2[0]), (float)amx_ctof(cpVec2[1]), (float)amx_ctof(cpVec2[2]));

    
REAL fDist = (REAL) (vec1 vec2).Length();

    return 
amx_ftoc(fDist);

PHP Code:
static cell AMX_NATIVE_CALL vector_distance(AMX *amxcell *params)
{
    
cell *cAddr get_amxaddr(amxparams[1]);
    
cell *cAddr2 get_amxaddr(amxparams[2]);

    
REAL fX amx_ctof(cAddr[0]);
    
REAL fY amx_ctof(cAddr[1]);
    
REAL fZ amx_ctof(cAddr[2]);
    
REAL fX2 amx_ctof(cAddr2[0]);
    
REAL fY2 amx_ctof(cAddr2[1]);
    
REAL fZ2 amx_ctof(cAddr2[2]);

    
Vector vVector Vector(fXfYfZ);
    
Vector vVector2 Vector(fX2fY2fZ2);

    
REAL fLength = (vVector vVector2).Length();

    return 
amx_ftoc(fLength);

__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-21-2011 , 03:19   Re: get_distance_f and vector_distance difference?
Reply With Quote #3

no differences.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 00:45.


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