/* Vector functions
 *
 * (c) 2002-2006, AMX Team
 * This file is provided as is (no warranties).
 */

#if defined _vector_included
  #endinput
#endif
#define _vector_included

#define ANGLEVECTORS_FORWARD  1
#define ANGLEVECTORS_RIGHT    2
#define ANGLEVECTORS_UP       3

/* Returns distance between two vectors. */
native get_distance(origin1[3], origin2[3]);

/* Returns distance between two vectors (float) */
native Float:get_distance_f(Float:origin1[3], Float:origin2[3]);

/* Gives you a velocity in the direction a player is looking, iVel is the multiplier. */
native VelocityByAim(ent, iVel, Float:vRtn[3]);

/* Changes a Vector to an Angle vector. */
native vector_to_angle(Float:fVector[3], Float:vRtn[3]);

/* Converts an angle to a vector. iVar = ANGLEVECTORS_* from the top of this file */
native angle_to_vector(Float:fAngle[3], iVar, Float:vRtn[3]);

/* Gets the length of a vector (float[3]). */
native Float:vector_length(Float:vDist[3]);

/* Gets the distance between 2 vectors (float[3]). */
native Float:vector_distance(Float:vOrig1[3], Float:vOrig2[3]);

stock IVecFVec(iVec[3], Float:fVec[3]) {
  fVec[0] = float(iVec[0])
  fVec[1] = float(iVec[1])
  fVec[2] = float(iVec[2])
  return 1
}

stock FVecIVec(Float:fVec[3], iVec[3]) {
  iVec[0] = floatround(fVec[0])
  iVec[1] = floatround(fVec[1])
  iVec[2] = floatround(fVec[2])
  return 1
}
