MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ScreenToWorld

Method ScreenToWorld

engine/Poseidon/UI/Map/UIMap.cpp:465–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463 float yMap = (1.0 - pt.Z() * invSizeLand) * _invScaleY;
464 return DrawCoord(xMap + _mapX + _x, yMap + _mapY + _y);
465}
466
467Point3 CStaticMap::ScreenToWorld(DrawCoord ptMap)
468{
469 float sizeLand = LandGrid * LandRange;
470 float x = (ptMap.x - _mapX - _x) * _scaleX * sizeLand;
471 float y = (1.0 - (ptMap.y - _mapY - _y) * _scaleY) * sizeLand;
472 // !!! WARNING: result.Y() == 0
473 return Point3(x, 0, y);
474}
475

Callers 1

OnChildDestroyedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected