Request am43716 - moved IVecFVec and FVecIVec around

This commit is contained in:
David Anderson 2006-09-01 01:34:43 +00:00
parent 72f59422d5
commit 6a28bc602a
2 changed files with 22 additions and 22 deletions

View File

@ -48,28 +48,6 @@ stock find_ent(iStart, szClassname[])
return find_ent_by_class(iStart, szClassname)
}
/* Changes an integer vec to a floating vec
* This is not a for loop because that's slower
*/
stock IVecFVec(IVec[3], Float:FVec[3])
{
FVec[0] = float(IVec[0])
FVec[1] = float(IVec[1])
FVec[2] = float(IVec[2])
return 1
}
/* Changes a float vec to an integer vec */
stock FVecIVec(Float:FVec[3], IVec[3])
{
IVec[0] = floatround(FVec[0])
IVec[1] = floatround(FVec[1])
IVec[2] = floatround(FVec[2])
return 1
}
/* Get the Button(s) user is pressing */
stock get_user_button(id)
return entity_get_int(id, EV_INT_button)

View File

@ -35,3 +35,25 @@ native Float:vector_length(Float:vVector[3]);
/* Gets the distance between 2 vectors (float[3]). */
native Float:vector_distance(Float:vVector[3], Float:vVector2[3]);
/* Changes an integer vec to a floating vec
* This is not a for loop because that's slower
*/
stock IVecFVec(IVec[3], Float:FVec[3])
{
FVec[0] = float(IVec[0])
FVec[1] = float(IVec[1])
FVec[2] = float(IVec[2])
return 1
}
/* Changes a float vec to an integer vec */
stock FVecIVec(Float:FVec[3], IVec[3])
{
IVec[0] = floatround(FVec[0])
IVec[1] = floatround(FVec[1])
IVec[2] = floatround(FVec[2])
return 1
}