MCPcopy Create free account
hub / github.com/axmolengine/axmol / CGAffineToGL

Function CGAffineToGL

core/math/TransformUtils.cpp:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32{
33
34void CGAffineToGL(const AffineTransform& t, float* m)
35{
36 // | m[0] m[4] m[8] m[12] | | m11 m21 m31 m41 | | a c 0 tx |
37 // | m[1] m[5] m[9] m[13] | | m12 m22 m32 m42 | | b d 0 ty |
38 // | m[2] m[6] m[10] m[14] | <=> | m13 m23 m33 m43 | <=> | 0 0 1 0 |
39 // | m[3] m[7] m[11] m[15] | | m14 m24 m34 m44 | | 0 0 0 1 |
40
41 m[2] = m[3] = m[6] = m[7] = m[8] = m[9] = m[11] = m[14] = 0.0f;
42 m[10] = m[15] = 1.0f;
43 m[0] = t.a;
44 m[4] = t.c;
45 m[12] = t.tx;
46 m[1] = t.b;
47 m[5] = t.d;
48 m[13] = t.ty;
49}
50
51void GLToCGAffine(const float* m, AffineTransform* t)
52{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected