mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 04:15:33 +00:00
Set StaticGeometry origin
Fixes an exception for coordinates far away from (0,0,0).
This commit is contained in:
parent
edb5a54092
commit
2a4e99c069
1 changed files with 2 additions and 0 deletions
|
@ -109,6 +109,7 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
|
||||||
{
|
{
|
||||||
uniqueID = uniqueID+1;
|
uniqueID = uniqueID+1;
|
||||||
sg = mRenderer.getScene()->createStaticGeometry("sg" + Ogre::StringConverter::toString(uniqueID));
|
sg = mRenderer.getScene()->createStaticGeometry("sg" + Ogre::StringConverter::toString(uniqueID));
|
||||||
|
sg->setOrigin(ptr.getRefData().getBaseNode()->getPosition());
|
||||||
mStaticGeometrySmall[ptr.getCell()] = sg;
|
mStaticGeometrySmall[ptr.getCell()] = sg;
|
||||||
|
|
||||||
sg->setRenderingDistance(Settings::Manager::getInt("small object distance", "Viewing distance"));
|
sg->setRenderingDistance(Settings::Manager::getInt("small object distance", "Viewing distance"));
|
||||||
|
@ -122,6 +123,7 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
|
||||||
{
|
{
|
||||||
uniqueID = uniqueID+1;
|
uniqueID = uniqueID+1;
|
||||||
sg = mRenderer.getScene()->createStaticGeometry("sg" + Ogre::StringConverter::toString(uniqueID));
|
sg = mRenderer.getScene()->createStaticGeometry("sg" + Ogre::StringConverter::toString(uniqueID));
|
||||||
|
sg->setOrigin(ptr.getRefData().getBaseNode()->getPosition());
|
||||||
mStaticGeometry[ptr.getCell()] = sg;
|
mStaticGeometry[ptr.getCell()] = sg;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue