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

Method WorldToScreen

extensions/olcPGEX_TransformedView.h:350–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348 }
349
350 olc::vf2d TransformedView::WorldToScreen(const olc::vf2d& vWorldPos) const
351 {
352 olc::vf2d vFloat = ((vWorldPos - m_vWorldOffset) * m_vWorldScale);
353 //vFloat = { std::floor(vFloat.x + 0.5f), std::floor(vFloat.y + 0.5f) };
354 return vFloat;
355 }
356
357 olc::vf2d TransformedView::ScreenToWorld(const olc::vf2d& vScreenPos) const
358 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected