The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdventuresInLestoria/Crawler/utils.cpp

21 lines
395 B

#include "utils.h"
float util::random(float range){
return float(rand())/RAND_MAX*range;
}
vf2d util::pointTo(vf2d posFrom,vf2d posTo){
return geom2d::line(posFrom,posTo).vector().norm();
}
float util::degToRad(float deg){
return deg*(PI/180);
}
float util::radToDeg(float rad){
return rad*57.2957795130823208767;
}
float util::lerp(float n1,float n2,double t){
return n1*(1-t)+n2*t;
}