From be70f17440f369322af25177b889d45424ae3741 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Sun, 26 Oct 2014 13:29:17 -0700 Subject: [PATCH] Fix typo in permul, switch permul and dot. It makes more sense this way. --- cpml/intersect.lua | 2 +- cpml/vec3.lua | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cpml/intersect.lua b/cpml/intersect.lua index 8d5d10d..f28550e 100644 --- a/cpml/intersect.lua +++ b/cpml/intersect.lua @@ -90,4 +90,4 @@ function intersect.line_line(p1, p2, p3, p4) return true, resultSegmentPoint1, resultSegmentPoint2 end -return intersect \ No newline at end of file +return intersect diff --git a/cpml/vec3.lua b/cpml/vec3.lua index e0433bd..9e75853 100644 --- a/cpml/vec3.lua +++ b/cpml/vec3.lua @@ -74,9 +74,8 @@ function vector.__mul(a,b) elseif type(b) == "number" then return new(b*a.x, b*a.y, b*a.z) else - -- This is the dot product. assert(isvector(a) and isvector(b), "Mul: wrong argument types ( or expected)") - return a.x*b.x + a.y*b.y + a.z*b.z + return new(a.x*b.x, a.y*b.y, a.z*b.z) end end @@ -99,9 +98,9 @@ function vector.__le(a,b) return a.x <= b.x and a.y <= b.y and a.z <= b.z end -function vector.permul(a,b) - assert(isvector(a) and isvector(b), "permul: wrong argument types ( expected)") - return new(a.x*b.x, a.y*b.y, a.z*b*z) +function vector.dot(a,b) + assert(isvector(a) and isvector(b), "dot: wrong argument types ( expected)") + return a.x*b.x + a.y*b.y + a.z*b.z end function vector:tuple()