Merge pull request #15 from Trebgarta/master

Shear
This commit is contained in:
Landon Manning 2016-06-14 13:01:57 -03:00 committed by GitHub
commit f264ec92ff

View File

@ -240,6 +240,22 @@ function mat4:scale(s)
return mat4(m) * mat4(self)
end
function mat4:shear(yx,zx,xy,zy,xz,yz)
local yx = yx or 0
local zx = zx or 0
local xy = xy or 0
local zy = zy or 0
local xz = xz or 0
local yz = yz or 0
local m = {
1, yx, zx, 0,
xy, 1, zy, 0,
xz, yz, 1, 0,
0, 0, 0, 1
}
return mat4(m) * mat4(self)
end
function mat4:rotate(angle, axis)
if type(angle) == "table" then
angle, axis = angle:to_axis_angle()