MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / Forward

Method Forward

extensions/olcPGEX_Graphics2D.h:268–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

DrawSpriteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected