mirror of https://github.com/OpenMW/openmw.git
indexToPosition moved from world -> esm/util.hpp
parent
1cf0cd5628
commit
3d06cabf6a
@ -0,0 +1,16 @@
|
||||
#include "util.hpp"
|
||||
|
||||
osg::Vec2 ESM::indexToPosition(const ESM::ExteriorCellIndex& cellIndex, bool centre)
|
||||
{
|
||||
const int cellSize = ESM::getCellSize(ESM::isEsm4Ext(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);
|
||||
}
|
Loading…
Reference in New Issue