void spin() { if (motion == 1) return; if (angle < 360.0f) { Sleep(25); angle += 1.0f; display(); } else { angle = 0.0f; swap_axis(); } }
void quake3_bsp_map::convert_vertices() { //TODO: Convert other elements of the vertex typedef vector<quake3_vertex>::iterator quake3_vertex_iterator; float one_over_sixtyfour = 1.0f / 64.0f; m_vertices.resize(m_raw_vertex_data.size()); size_t j = 0; for (quake3_vertex_iterator i = m_raw_vertex_data.begin(); i != m_raw_vertex_data.end(); ++i) { //Copy the vertex to the global map vertex array memcpy(&m_vertices[j].position, &(*i).position, sizeof(float) * 3); //Scale the vertices down m_vertices[j].position.x *= one_over_sixtyfour; m_vertices[j].position.y *= one_over_sixtyfour; m_vertices[j].position.z *= one_over_sixtyfour; swap_axis(m_vertices[j].position); //Convert to normal coordinate system m_vertices[j].texture_coordinate.x = (*i).texCoord.x; m_vertices[j].texture_coordinate.y = 1.0f - (*i).texCoord.y; ++j; //Move to the next vertex #ifndef NDEBUG std::cout << "."; #endif } #ifndef NDEBUG std::cout << std::endl; #endif }