symmetry in vadd4
authorJames Alan Preiss <jamesalanpreiss@gmail.com>
Thu, 14 Nov 2019 19:58:32 +0000 (11:58 -0800)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2019 19:58:32 +0000 (11:58 -0800)
math3d.h

index ef6bd94..465f7f5 100644 (file)
--- a/math3d.h
+++ b/math3d.h
@@ -227,7 +227,7 @@ static inline struct vec vadd3(struct vec a, struct vec b, struct vec c) {
 // add 4 vectors.
 static inline struct vec vadd4(struct vec a, struct vec b, struct vec c, struct vec d) {
        // TODO: make sure it compiles to optimal code
-       return vadd(vadd(vadd(a, b), c), d);
+       return vadd(vadd(a, b), vadd(c, d));
 }
 // subtract b and c from a.
 static inline struct vec vsub2(struct vec a, struct vec b, struct vec c) {