Added Transform objects to love.math (resolves issue #1228).

- Added love.math.newTransform.
- Added love.graphics.applyTransform and love.graphics.replaceTransform.
- love.graphics.draw/print/printf, Text:add/addf, and SpriteBatch:add can accept a Transform argument.
- love.graphics.push can accept an optional Transform as a second argument, which will apply the Transform after pushing the matrix stack,
- Shader:send can accept Transform objects when sending to a mat4 uniform variable.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-11-24 21:30:45 -04:00
parent 9d2ee6d909
commit 14aa6965b3
19 changed files with 820 additions and 94 deletions
+10
View File
@@ -2092,6 +2092,16 @@ void Graphics::origin()
pixelSizeStack.back() = 1;
}
void Graphics::applyTransform(love::math::Transform *transform)
{
gl.getTransform() *= transform->getMatrix();
}
void Graphics::replaceTransform(love::math::Transform *transform)
{
gl.getTransform() = transform->getMatrix();
}
Vector Graphics::transformPoint(Vector point)
{
Vector p;