code review

This commit is contained in:
Seth Alves 2017-07-24 19:41:30 -07:00
parent c4d909927a
commit a3f4aeb182
3 changed files with 4 additions and 4 deletions

View file

@ -130,7 +130,6 @@ bool OBJTokenizer::getVertex(glm::vec3& vertex, glm::vec3& vertexColor) {
auto y = getFloat(); // And order of arguments is different on Windows/Linux. auto y = getFloat(); // And order of arguments is different on Windows/Linux.
auto z = getFloat(); auto z = getFloat();
vertex = glm::vec3(x, y, z); vertex = glm::vec3(x, y, z);
vertexColor = glm::vec3(1.0f); // default, in case there is not color information
auto r = 1.0f, g = 1.0f, b = 1.0f; auto r = 1.0f, g = 1.0f, b = 1.0f;
bool hasVertexColor = false; bool hasVertexColor = false;
@ -415,7 +414,8 @@ bool OBJReader::parseOBJGroup(OBJTokenizer& tokenizer, const QVariantHash& mappi
#endif #endif
} }
} else if (token == "v") { } else if (token == "v") {
glm::vec3 vertex, vertexColor; glm::vec3 vertex;
glm::vec3 vertexColor { glm::vec3(1.0f) };
bool hasVertexColor = tokenizer.getVertex(vertex, vertexColor); bool hasVertexColor = tokenizer.getVertex(vertex, vertexColor);
vertices.append(vertex); vertices.append(vertex);

View file

@ -463,7 +463,7 @@ bool Model::convexHullContains(glm::vec3 point) {
return false; return false;
} }
MeshProxyList Model::getMeshes() { MeshProxyList Model::getMeshes() const {
MeshProxyList result; MeshProxyList result;
const Geometry::Pointer& renderGeometry = getGeometry(); const Geometry::Pointer& renderGeometry = getGeometry();
const Geometry::GeometryMeshes& meshes = renderGeometry->getMeshes(); const Geometry::GeometryMeshes& meshes = renderGeometry->getMeshes();

View file

@ -257,7 +257,7 @@ public:
int getResourceDownloadAttempts() { return _renderWatcher.getResourceDownloadAttempts(); } int getResourceDownloadAttempts() { return _renderWatcher.getResourceDownloadAttempts(); }
int getResourceDownloadAttemptsRemaining() { return _renderWatcher.getResourceDownloadAttemptsRemaining(); } int getResourceDownloadAttemptsRemaining() { return _renderWatcher.getResourceDownloadAttemptsRemaining(); }
Q_INVOKABLE MeshProxyList getMeshes(); Q_INVOKABLE MeshProxyList getMeshes() const;
public slots: public slots:
void loadURLFinished(bool success); void loadURLFinished(bool success);