openmw-tes3coop/apps/opencs/model/world/ref.cpp

18 lines
329 B
C++
Raw Normal View History

#include "ref.hpp"
2015-01-09 11:05:16 +00:00
#include <cmath>
CSMWorld::CellRef::CellRef()
{
mRefNum.mIndex = 0;
mRefNum.mContentFile = 0;
2015-01-09 11:05:16 +00:00
}
std::pair<int, int> CSMWorld::CellRef::getCellIndex() const
{
const int cellSize = 8192;
return std::make_pair (
std::floor (mPos.pos[0]/cellSize), std::floor (mPos.pos[1]/cellSize));
}