| 9 | using namespace std; |
| 10 | |
| 11 | class CarModel : public Model { |
| 12 | public: |
| 13 | // Test |
| 14 | CarModel(std::string name, std::vector<glm::vec3> verts, std::vector<glm::vec2> uvs, std::vector<unsigned int> texture_indices, std::vector<uint32_t> test, std::vector<glm::vec3> norms, std::vector<unsigned int> indices, glm::vec3 center_position, float specular_damper, float specular_reflectivity, float env_reflectivity); |
| 15 | // TODO: Alter all these constructors to const reference |
| 16 | // Multitextured Cars (NFS2) |
| 17 | CarModel(std::string name, std::vector<glm::vec3> verts, std::vector<glm::vec2> uvs, std::vector<unsigned int> texture_indices, std::vector<glm::vec3> norms, std::vector<unsigned int> indices, glm::vec3 center_position, float specular_damper, float specular_reflectivity, float env_reflectivity); |
| 18 | // Cars with Per-Polygon Flags (NFS4) |
| 19 | CarModel(std::string name, std::vector<glm::vec3> verts, std::vector<glm::vec2> uvs, std::vector<glm::vec3> norms, std::vector<unsigned int> indices, std::vector<uint32_t> poly_flags, glm::vec3 center_position, float specular_damper, float specular_reflectivity, float env_reflectivity); |
| 20 | // Vanilla Cars (NFS3) |
| 21 | CarModel(std::string name, std::vector<glm::vec3> verts, std::vector<glm::vec2> uvs, std::vector<glm::vec3> norms, std::vector<unsigned int> indices, glm::vec3 center_position, float specular_damper, float specular_reflectivity, float env_reflectivity); |
| 22 | CarModel(); |
| 23 | void update() override; |
| 24 | void destroy() override; |
| 25 | void render() override; |
| 26 | bool genBuffers() override; |
| 27 | float specularDamper; |
| 28 | float specularReflectivity; |
| 29 | float envReflectivity; |
| 30 | |
| 31 | // Multitextured Car |
| 32 | bool isMultiTextured = false; |
| 33 | // NFS4 Car |
| 34 | std::vector<uint32_t> m_polygon_flags; |
| 35 | bool hasPolyFlags = false; // Avoid checking polygon_flags.size() every Shader bind |
| 36 | private: |
| 37 | GLuint vertexBuffer; |
| 38 | GLuint uvBuffer; |
| 39 | GLuint normalBuffer; |
| 40 | |
| 41 | // Multitextured Car |
| 42 | GLuint textureIndexBuffer; |
| 43 | std::vector<unsigned int> m_texture_indices; |
| 44 | // NFS4 Car |
| 45 | GLuint polyFlagBuffer; |
| 46 | |
| 47 | typedef Model super; |
| 48 | }; |
no outgoing calls
no test coverage detected