| 266 | } |
| 267 | |
| 268 | void olc::GFX2D::Transform2D::Forward(float in_x, float in_y, float &out_x, float &out_y) |
| 269 | { |
| 270 | out_x = in_x * matrix[nSourceMatrix][0][0] + in_y * matrix[nSourceMatrix][1][0] + matrix[nSourceMatrix][2][0]; |
| 271 | out_y = in_x * matrix[nSourceMatrix][0][1] + in_y * matrix[nSourceMatrix][1][1] + matrix[nSourceMatrix][2][1]; |
| 272 | float out_z = in_x * matrix[nSourceMatrix][0][2] + in_y * matrix[nSourceMatrix][1][2] + matrix[nSourceMatrix][2][2]; |
| 273 | if (out_z != 0) |
| 274 | { |
| 275 | out_x /= out_z; |
| 276 | out_y /= out_z; |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | void olc::GFX2D::Transform2D::Backward(float in_x, float in_y, float &out_x, float &out_y) |
| 281 | { |