Archived
1
Fork 0

Moved source files to src/

This commit is contained in:
Joshua Moerman 2013-03-10 12:19:46 +01:00
parent fc437198a3
commit 7f3d8d99a1
5 changed files with 8 additions and 5 deletions

View file

@ -25,7 +25,8 @@ set(all_libraries websockets json_spirit)
# Own files
include_directories("${PROJECT_SOURCE_DIR}")
file(GLOB all_files "*.cpp")
include_directories("${PROJECT_SOURCE_DIR}/src/")
file(GLOB all_files "src/*.cpp")
add_executable(server ${all_files})
target_link_libraries(server ${all_libraries})

View file

View file

@ -67,6 +67,8 @@ BOOST_FUSION_ADAPT_STRUCT(
std::vector<User*> people_online;
inline void update_positions(){
const float speed = 0.4;
typedef std::chrono::duration<double, std::ratio<1,1>> fseconds;
static auto start = std::chrono::steady_clock::now();
auto end = std::chrono::steady_clock::now();
@ -76,11 +78,11 @@ inline void update_positions(){
auto n = people_online.size();
for(int i = 0; i < n; ++i){
User& user = *people_online[i];
double x = cos(0.1 * time + 2*M_PI*i/double(n));
double y = sin(0.1 * time + 2*M_PI*i/double(n));
double x = cos(speed * time + 2*M_PI*i/double(n));
double y = sin(speed * time + 2*M_PI*i/double(n));
user.position.x = 200 + 180*x;
user.position.y = 200 + 180*y;
user.position.x = 200 + 200*x;
user.position.y = 200 + 200*y;
}
}