Add quat:clone()

This commit is contained in:
Colby Klein 2015-05-05 02:03:02 -07:00
parent 58b3b30b4b
commit 2b3f8bc31b

View File

@ -208,6 +208,10 @@ function quaternion:real()
return self.w
end
function quaternion:clone()
return new(self.x, self.y, self.z, self.w)
end
-- Returns the vector (imaginary) part as a Vec3 object
function quaternion:to_vec3()
return vec3(self.x, self.y, self.z)