MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Convert2DPositionToNDC

Function Convert2DPositionToNDC

TombEngine/Specific/trutils.cpp:211–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209 }
210
211 Vector2 Convert2DPositionToNDC(const Vector2& pos)
212 {
213 return Vector2(
214 ((pos.x * 2) / DISPLAY_SPACE_RES.x) - 1.0f,
215 1.0f - ((pos.y * 2) / DISPLAY_SPACE_RES.y));
216 }
217
218 Vector2 ConvertNDCTo2DPosition(const Vector2& ndc)
219 {

Callers 1

DrawDisplaySpritesMethod · 0.85

Calls 1

Vector2Function · 0.50

Tested by

no test coverage detected