diff options
author | Jonathan Marshall <jmarshall@never.you.mind> | 2011-06-29 17:31:59 +1200 |
---|---|---|
committer | Jonathan Marshall <jmarshall@never.you.mind> | 2011-06-29 17:31:59 +1200 |
commit | 2c26230a4f0a5fc0031d41c40e1db4a51f470453 (patch) | |
tree | a92b013c176f6a4349ca2b647a9fe33490e90718 | |
parent | 60cf44b28e03a69ec1866b0440a6b0d8f241f9df (diff) |
use setters for Create* matrix creation
-rw-r--r-- | xbmc/guilib/TransformMatrix.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/xbmc/guilib/TransformMatrix.h b/xbmc/guilib/TransformMatrix.h index c25c743d40..30eb173739 100644 --- a/xbmc/guilib/TransformMatrix.h +++ b/xbmc/guilib/TransformMatrix.h @@ -52,9 +52,7 @@ public: static TransformMatrix CreateTranslation(float transX, float transY, float transZ = 0) { TransformMatrix translation; - translation.m[0][3] = transX; - translation.m[1][3] = transY; - translation.m[2][3] = transZ; + translation.SetTranslation(transX, transY, transZ); return translation; } void SetTranslation(float transX, float transY, float transZ) @@ -102,10 +100,8 @@ public: static TransformMatrix CreateZRotation(float angle, float x, float y, float ar = 1.0f) { // angle about the Z axis, centered at x,y where our coordinate system has aspect ratio ar. // Trans(x,y,0)*Scale(1/ar,1,1)*RotateZ(angle)*Scale(ar,1,1)*Trans(-x,-y,0) - float c = cos(angle); float s = sin(angle); TransformMatrix rot; - rot.m[0][0] = c; rot.m[0][1] = -s/ar; rot.m[0][3] = -x*c + s*y/ar + x; - rot.m[1][0] = s*ar; rot.m[1][1] = c; rot.m[1][3] = -ar*x*s - c*y + y; + rot.SetZRotation(angle, x, y, ar); return rot; } void SetZRotation(float angle, float x, float y, float ar = 1.0f) @@ -120,7 +116,7 @@ public: static TransformMatrix CreateFader(float a) { TransformMatrix fader; - fader.alpha = a; + fader.SetFader(a); return fader; } void SetFader(float a) |