mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
422 B
C++
17 lines
422 B
C++
2 years ago
|
#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);
|
||
|
}
|