mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-13 23:09:40 +00:00
Better fix some scaling issues
This commit is contained in:
parent
535cd8360f
commit
18b7008409
2 changed files with 7 additions and 8 deletions
|
@ -219,7 +219,7 @@ Ogre::Vector3 Animation::updatePosition(float time)
|
||||||
posdiff = (mNonAccumRoot->getPosition() - mLastPosition) * mAccumulate;
|
posdiff = (mNonAccumRoot->getPosition() - mLastPosition) * mAccumulate;
|
||||||
|
|
||||||
/* Translate the accumulation root back to compensate for the move. */
|
/* Translate the accumulation root back to compensate for the move. */
|
||||||
mAccumRoot->translate(-posdiff * mAccumRoot->_getDerivedScale());
|
mAccumRoot->translate(-posdiff);
|
||||||
mLastPosition += posdiff;
|
mLastPosition += posdiff;
|
||||||
}
|
}
|
||||||
return posdiff;
|
return posdiff;
|
||||||
|
@ -243,7 +243,7 @@ void Animation::reset(const std::string &marker)
|
||||||
if(mNonAccumRoot)
|
if(mNonAccumRoot)
|
||||||
{
|
{
|
||||||
mLastPosition = mNonAccumRoot->getPosition();
|
mLastPosition = mNonAccumRoot->getPosition();
|
||||||
mAccumRoot->setPosition((mStartPosition - mLastPosition) * mAccumRoot->_getDerivedScale());
|
mAccumRoot->setPosition(mStartPosition*mNonAccumRoot->_getDerivedScale() - mLastPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,11 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
|
||||||
MWBase::Environment::get().getWorld()->getStore();
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Race *race = store.get<ESM::Race>().find(mNpc->mRace);
|
const ESM::Race *race = store.get<ESM::Race>().find(mNpc->mRace);
|
||||||
|
|
||||||
|
float scale = race->mData.mHeight.mMale;
|
||||||
|
if(!mNpc->isMale())
|
||||||
|
scale = race->mData.mHeight.mFemale;
|
||||||
|
node->scale(Ogre::Vector3(scale));
|
||||||
|
|
||||||
mHeadModel = "meshes\\" + store.get<ESM::BodyPart>().find(mNpc->mHead)->mModel;
|
mHeadModel = "meshes\\" + store.get<ESM::BodyPart>().find(mNpc->mHead)->mModel;
|
||||||
mHairModel = "meshes\\" + store.get<ESM::BodyPart>().find(mNpc->mHair)->mModel;
|
mHairModel = "meshes\\" + store.get<ESM::BodyPart>().find(mNpc->mHair)->mModel;
|
||||||
|
|
||||||
|
@ -128,12 +133,6 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
|
||||||
if(mNpc->mModel.length() > 0)
|
if(mNpc->mModel.length() > 0)
|
||||||
insertSkeletonSource("meshes\\"+Misc::StringUtils::lowerCase(mNpc->mModel));
|
insertSkeletonSource("meshes\\"+Misc::StringUtils::lowerCase(mNpc->mModel));
|
||||||
|
|
||||||
float scale = race->mData.mHeight.mMale;
|
|
||||||
if (!mNpc->isMale()) {
|
|
||||||
scale = race->mData.mHeight.mFemale;
|
|
||||||
}
|
|
||||||
mInsert->scale(scale, scale, scale);
|
|
||||||
|
|
||||||
updateParts();
|
updateParts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue