Set the object node scale before inserting model

This fixes initWorldSpaceParticles not taking object scale into account. Still not taking into account object rotation or node animations. Ideally the initWorldSpaceParticles needs to run in an updateCallback.
openmw-37
scrawl 9 years ago
parent 966737f891
commit 622573f494

@ -125,6 +125,11 @@ void Objects::insertBegin(const MWWorld::Ptr& ptr)
insert->setPosition(osg::Vec3(f[0], f[1], f[2]));
const float scale = ptr.getCellRef().getScale();
osg::Vec3f scaleVec(scale, scale, scale);
ptr.getClass().adjustScale(ptr, scaleVec, true);
insert->setScale(scaleVec);
ptr.getRefData().setBaseNode(insert);
}

Loading…
Cancel
Save