std::vector<Vertex> ModelComponent::GetDebugVerts() { Graphics* gSys = (Graphics*)Engine::GetCore()->GetSystem(ST_Graphics); Matrix4 modelToWorld; Camera* camera = gSys->GetCamera(); Transform* tr = (Transform*) GetSibling(CT_Transform); std::vector<Vertex> endVerts; switch(draw_type_) { case DrawType::VertexNormals: { std::vector<Vertex> verts = base_->GetVerts(); Vertex newVert; endVerts.reserve(verts.size() * 2); for(auto it = verts.begin(); it != verts.end(); ++it) { endVerts.push_back(*it); newVert.normal = it->normal; newVert.position = it->position; newVert.position.x += (1.0f / tr->GetScale().x) * newVert.normal.x * 0.5f; newVert.position.y += (1.0f / tr->GetScale().y) * newVert.normal.y * 0.5f; newVert.position.z += (1.0f / tr->GetScale().z) * newVert.normal.z * 0.5f; endVerts.push_back(newVert); //it = verts.insert(it, newVert); } break; } case DrawType::FaceNormals: { std::vector<Vertex> verts = base_->GetVerts(); Vertex newVert; //std::vector<Face> faces = base_->GetFaces(); //endVerts.reserve(faces.size() * 2); //Vector3 v0v1; //Vector3 v0v2; //for(auto it = faces.begin(); it != faces.end(); ++it) //{ // newVert.position = (verts[it->indices[0]].position + // verts[it->indices[1]].position + // verts[it->indices[2]].position) * (1.0f / 3.0f); // // // v0v1 = (verts[it->indices[1]].position - verts[it->indices[0]].position).GetNormalized(); // v0v2 = (verts[it->indices[2]].position - verts[it->indices[0]].position).GetNormalized(); // newVert.normal = v0v1.Cross(v0v2); // endVerts.push_back(newVert); // newVert.position.x += (1.0f/tr->GetScale().x) * newVert.normal.x * 0.5f; // newVert.position.y += (1.0f/tr->GetScale().y) * newVert.normal.y * 0.5f; // newVert.position.z += (1.0f/tr->GetScale().z) * newVert.normal.z * 0.5f; // endVerts.push_back(newVert); //} break; } case DrawType::Wireframe: { break; } case DrawType::Default: default: return std::vector<Vertex>(); break; } return endVerts; }