Raised This Month: $ Target: $400
 0% 

get_distance_f and vector_distance difference?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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