Minor fixes in the code, mostly spacing

This commit is contained in:
Pol 2015-09-17 13:55:08 -07:00
parent 2fc7bd1660
commit 67e86104f6

View File

@ -256,16 +256,14 @@ int main(int argc, char ** argv) {
// Parsing command line parameters to see if the user wants to use a // Parsing command line parameters to see if the user wants to use a
// specific method to calculate normals. // specific method to calculate normals.
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {
if (strstr(argv[i], "-limit")) { if (strstr(argv[i], "-limit")) {
normalMethod = Limit; normalMethod = Limit;
} } else if (!strcmp(argv[i], "-crossquad")) {
else if (!strcmp(argv[i], "-crossquad")) {
normalMethod = CrossQuad; normalMethod = CrossQuad;
} } else if (!strcmp(argv[i], "-crosstriangle")) {
else if (!strcmp(argv[i], "-crosstriangle")) {
normalMethod = CrossTriangle; normalMethod = CrossTriangle;
} } else {
else {
printf("Parameters : \n"); printf("Parameters : \n");
printf(" -crosstriangle : use the cross product of vectors\n"); printf(" -crosstriangle : use the cross product of vectors\n");
printf(" generated from 3 verts (default).\n"); printf(" generated from 3 verts (default).\n");
@ -344,7 +342,6 @@ int main(int argc, char ** argv) {
// Interpolate both vertex and face-varying primvar data // Interpolate both vertex and face-varying primvar data
Far::PrimvarRefiner primvarRefiner(*refiner); Far::PrimvarRefiner primvarRefiner(*refiner);
Vertex * srcVert = verts; Vertex * srcVert = verts;
FVarVertexUV * srcFVarUV = fvVertsUV; FVarVertexUV * srcFVarUV = fvVertsUV;
FVarVertexColor * srcFVarColor = fvVertsColor; FVarVertexColor * srcFVarColor = fvVertsColor;
@ -374,8 +371,7 @@ int main(int argc, char ** argv) {
std::vector<Vertex> normals(nverts); std::vector<Vertex> normals(nverts);
if(normalMethod == Limit) { if (normalMethod == Limit) {
// Limit position, derivatives and normals // Limit position, derivatives and normals
std::vector<Vertex> fineLimitPos(nverts); std::vector<Vertex> fineLimitPos(nverts);
std::vector<Vertex> fineDu(nverts); std::vector<Vertex> fineDu(nverts);
@ -393,7 +389,6 @@ int main(int argc, char ** argv) {
} }
} else if (normalMethod == CrossQuad) { } else if (normalMethod == CrossQuad) {
// Accumulate normals calculated using the cross product of the two // Accumulate normals calculated using the cross product of the two
// vectors generated by the 4 verts that form a quad. // vectors generated by the 4 verts that form a quad.
for (int f = 0; f < nfaces; f++) { for (int f = 0; f < nfaces; f++) {
@ -424,7 +419,6 @@ int main(int argc, char ** argv) {
} }
} else if (normalMethod == CrossTriangle) { } else if (normalMethod == CrossTriangle) {
// Accumulate normals calculated using the cross product of the // Accumulate normals calculated using the cross product of the
// two vectors generated by 3 verts. // two vectors generated by 3 verts.
for (int f = 0; f < nfaces; f++) { for (int f = 0; f < nfaces; f++) {
@ -456,7 +450,6 @@ int main(int argc, char ** argv) {
// Finally we just need to normalize the accumulated normals // Finally we just need to normalize the accumulated normals
for (int vert = 0; vert < nverts; ++vert) { for (int vert = 0; vert < nverts; ++vert) {
normalize(&normals[vert].position[0]); normalize(&normals[vert].position[0]);
} }