View Single Post
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 06-15-2008 , 16:19   Re: [INC] CHR Engine v1.1
Reply With Quote #36

From prometheus.sma
Code:
/*  *  *  Determines velocity (new_velocity) that  *  you would set an entity to in order for  *  it to go at "speed" from "origin1" to  *  "origin2".  *  *  By GHW_Chronic  *  */  stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])  {     new_velocity[0] = origin2[0] - origin1[0];     new_velocity[1] = origin2[1] - origin1[1];     new_velocity[2] = origin2[2] - origin1[2];     new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]));     new_velocity[0] *= num;     new_velocity[1] *= num;     new_velocity[2] *= num;     return 1;  }
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic