1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Some tidying up in AffineTransform, and added a new fromTargetPoints method

This commit is contained in:
jules 2017-12-20 12:57:57 +00:00
parent 8d2150f239
commit a9eafbc90f
3 changed files with 106 additions and 94 deletions

View file

@ -510,9 +510,9 @@ struct ShaderPrograms : public ReferenceCountedObject
void setMatrix (Point<float> p1, Point<float> p2, Point<float> p3)
{
auto t = AffineTransform::fromTargetPoints (p1.x, p1.y, 0.0f, 0.0f,
p2.x, p2.y, 1.0f, 0.0f,
p3.x, p3.y, 0.0f, 1.0f);
auto t = AffineTransform::fromTargetPoints (p1, Point<float>(),
p2, Point<float> (1.0f, 0.0f),
p3, Point<float> (0.0f, 1.0f));
const GLfloat m[] = { t.mat00, t.mat01, t.mat02, t.mat10, t.mat11, t.mat12 };
matrix.set (m, 6);
}