Set StaticGeometry origin

Fixes an exception for coordinates far away from (0,0,0).
actorid
scrawl 11 years ago
parent edb5a54092
commit 2a4e99c069

@ -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…
Cancel
Save