1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 03:53:54 +00:00
openmw/components/esm/util.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
409 B
C++
Raw Normal View History

#include "util.hpp"
osg::Vec2 ESM::indexToPosition(const ESM::ExteriorCellLocation& cellIndex, bool centre)
{
const int cellSize = ESM::getCellSize(cellIndex.mWorldspace);
float x = static_cast<float>(cellSize * cellIndex.mX);
float y = static_cast<float>(cellSize * cellIndex.mY);
if (centre)
{
x += cellSize / 2;
y += cellSize / 2;
}
return osg::Vec2(x, y);
}