#include <Transform.h>
|
| | Transform () |
| |
| | Transform (float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22) |
| |
| const float * | GetMatrix () const |
| |
| Transform | GetInverse () const |
| |
| D3DXVECTOR2 | TransformPoint (float x, float y) const |
| |
| D3DXVECTOR2 | TransformPoint (const D3DXVECTOR2 &point) const |
| |
| FloatRect | TransformRect (const FloatRect &rectangle) const |
| |
| Transform & | Combine (const Transform &transform) |
| |
| Transform & | Translate (float x, float y) |
| |
| Transform & | Translate (const D3DXVECTOR2 &offset) |
| |
| Transform & | Rotate (float angle) |
| |
| Transform & | Rotate (float angle, float centerX, float centerY) |
| |
| Transform & | Rotate (float angle, const D3DXVECTOR2 ¢er) |
| |
| Transform & | Scale (float scaleX, float scaleY) |
| |
| Transform & | Scale (float scaleX, float scaleY, float centerX, float centerY) |
| |
| Transform & | Scale (const D3DXVECTOR2 &factors) |
| |
| Transform & | Scale (const D3DXVECTOR2 &factors, const D3DXVECTOR2 ¢er) |
| |
Definition at line 41 of file Transform.h.
◆ Transform() [1/2]
| IncrementalEngine::Transform::Transform |
( |
| ) |
|
◆ Transform() [2/2]
| IncrementalEngine::Transform::Transform |
( |
float |
a00, |
|
|
float |
a01, |
|
|
float |
a02, |
|
|
float |
a10, |
|
|
float |
a11, |
|
|
float |
a12, |
|
|
float |
a20, |
|
|
float |
a21, |
|
|
float |
a22 |
|
) |
| |
◆ Combine()
Definition at line 125 of file Transform.cpp.
128 const float* b = transform._matrix;
130 *
this =
Transform(a[0] * b[0] + a[4] * b[1] + a[12] * b[3],
131 a[0] * b[4] + a[4] * b[5] + a[12] * b[7],
132 a[0] * b[12] + a[4] * b[13] + a[12] * b[15],
133 a[1] * b[0] + a[5] * b[1] + a[13] * b[3],
134 a[1] * b[4] + a[5] * b[5] + a[13] * b[7],
135 a[1] * b[12] + a[5] * b[13] + a[13] * b[15],
136 a[3] * b[0] + a[7] * b[1] + a[15] * b[3],
137 a[3] * b[4] + a[7] * b[5] + a[15] * b[7],
138 a[3] * b[12] + a[7] * b[13] + a[15] * b[15]);
◆ GetInverse()
| Transform IncrementalEngine::Transform::GetInverse |
( |
| ) |
const |
◆ GetMatrix()
| const float * IncrementalEngine::Transform::GetMatrix |
( |
| ) |
const |
◆ Rotate() [1/3]
| Transform & IncrementalEngine::Transform::Rotate |
( |
float |
angle | ) |
|
Definition at line 157 of file Transform.cpp.
159 float rad = angle * 3.141592654f / 180.f;
160 float cos = std::cos(rad);
161 float sin = std::sin(rad);
◆ Rotate() [2/3]
| Transform & IncrementalEngine::Transform::Rotate |
( |
float |
angle, |
|
|
const D3DXVECTOR2 & |
center |
|
) |
| |
◆ Rotate() [3/3]
| Transform & IncrementalEngine::Transform::Rotate |
( |
float |
angle, |
|
|
float |
centerX, |
|
|
float |
centerY |
|
) |
| |
Definition at line 170 of file Transform.cpp.
172 float rad = angle * 3.141592654f / 180.f;
173 float cos = std::cos(rad);
174 float sin = std::sin(rad);
176 Transform rotation(cos, -sin, centerX * (1 - cos) + centerY * sin,
177 sin, cos, centerY * (1 - cos) - centerX * sin,
◆ Scale() [1/4]
| Transform & IncrementalEngine::Transform::Scale |
( |
const D3DXVECTOR2 & |
factors | ) |
|
◆ Scale() [2/4]
| Transform & IncrementalEngine::Transform::Scale |
( |
const D3DXVECTOR2 & |
factors, |
|
|
const D3DXVECTOR2 & |
center |
|
) |
| |
Definition at line 211 of file Transform.cpp.
213 return Scale(factors.x, factors.y, center.x, center.y);
◆ Scale() [3/4]
| Transform & IncrementalEngine::Transform::Scale |
( |
float |
scaleX, |
|
|
float |
scaleY |
|
) |
| |
◆ Scale() [4/4]
| Transform & IncrementalEngine::Transform::Scale |
( |
float |
scaleX, |
|
|
float |
scaleY, |
|
|
float |
centerX, |
|
|
float |
centerY |
|
) |
| |
Definition at line 197 of file Transform.cpp.
199 Transform scaling(scaleX, 0, centerX * (1 - scaleX),
200 0, scaleY, centerY * (1 - scaleY),
◆ TransformPoint() [1/2]
| D3DXVECTOR2 IncrementalEngine::Transform::TransformPoint |
( |
const D3DXVECTOR2 & |
point | ) |
const |
◆ TransformPoint() [2/2]
| D3DXVECTOR2 IncrementalEngine::Transform::TransformPoint |
( |
float |
x, |
|
|
float |
y |
|
) |
| const |
◆ TransformRect()
| FloatRect IncrementalEngine::Transform::TransformRect |
( |
const FloatRect & |
rectangle | ) |
const |
Definition at line 99 of file Transform.cpp.
101 const D3DXVECTOR2 points[] =
104 TransformPoint(rectangle.left(), rectangle.top() + rectangle.height()),
105 TransformPoint(rectangle.left() + rectangle.width(), rectangle.top()),
106 TransformPoint(rectangle.left() + rectangle.width(), rectangle.top() + rectangle.height())
109 float left = points[0].x;
110 float top = points[0].y;
111 float right = points[0].x;
112 float bottom = points[0].y;
114 for (
int i = 1; i < 4; ++i)
116 if (points[i].x < left) left = points[i].x;
117 else if (points[i].x > right) right = points[i].x;
118 if (points[i].y < top) top = points[i].y;
119 else if (points[i].y > bottom) bottom = points[i].y;
122 return FloatRect(left, top, right - left, bottom - top);
◆ Translate() [1/2]
| Transform & IncrementalEngine::Transform::Translate |
( |
const D3DXVECTOR2 & |
offset | ) |
|
◆ Translate() [2/2]
| Transform & IncrementalEngine::Transform::Translate |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
◆ _matrix
| float IncrementalEngine::Transform::_matrix[16] |
|
private |
◆ Identity
| const Transform IncrementalEngine::Transform::Identity |
|
static |