mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
Revert "Take in account transformations of NiTriShape and NiSkinData in skinning (bug #4437)"
This reverts commit 09427d3f5e
since the
fix is not entirely correct.
This commit is contained in:
parent
38758a9555
commit
87394f2ebb
4 changed files with 1 additions and 17 deletions
|
@ -70,7 +70,6 @@
|
||||||
Bug #4431: "Lock 0" console command is a no-op
|
Bug #4431: "Lock 0" console command is a no-op
|
||||||
Bug #4432: Guards behaviour is incorrect if they do not have AI packages
|
Bug #4432: Guards behaviour is incorrect if they do not have AI packages
|
||||||
Bug #4433: Guard behaviour is incorrect with Alarm = 0
|
Bug #4433: Guard behaviour is incorrect with Alarm = 0
|
||||||
Bug #4437: Transformations for NiSkinInstance are ignored
|
|
||||||
Bug #4451: Script fails to compile when using "Begin, [ScriptName]" syntax
|
Bug #4451: Script fails to compile when using "Begin, [ScriptName]" syntax
|
||||||
Bug #4452: Default terrain texture bleeds through texture transitions
|
Bug #4452: Default terrain texture bleeds through texture transitions
|
||||||
Bug #4453: Quick keys behaviour is invalid for equipment
|
Bug #4453: Quick keys behaviour is invalid for equipment
|
||||||
|
|
|
@ -1082,10 +1082,7 @@ namespace NifOsg
|
||||||
// Assign bone weights
|
// Assign bone weights
|
||||||
osg::ref_ptr<SceneUtil::RigGeometry::InfluenceMap> map (new SceneUtil::RigGeometry::InfluenceMap);
|
osg::ref_ptr<SceneUtil::RigGeometry::InfluenceMap> map (new SceneUtil::RigGeometry::InfluenceMap);
|
||||||
|
|
||||||
// We should take in account transformation of NiTriShape and NiSkinData
|
|
||||||
const Nif::NiSkinData *data = skin->data.getPtr();
|
const Nif::NiSkinData *data = skin->data.getPtr();
|
||||||
osg::Matrixf shapeTransforms = triShape->trafo.toMatrix() * data->trafo.toMatrix();
|
|
||||||
|
|
||||||
const Nif::NodeList &bones = skin->bones;
|
const Nif::NodeList &bones = skin->bones;
|
||||||
for(size_t i = 0;i < bones.length();i++)
|
for(size_t i = 0;i < bones.length();i++)
|
||||||
{
|
{
|
||||||
|
@ -1099,12 +1096,11 @@ namespace NifOsg
|
||||||
influence.mWeights.insert(indexWeight);
|
influence.mWeights.insert(indexWeight);
|
||||||
}
|
}
|
||||||
influence.mInvBindMatrix = data->bones[i].trafo.toMatrix();
|
influence.mInvBindMatrix = data->bones[i].trafo.toMatrix();
|
||||||
influence.mBoundSphere = osg::BoundingSpheref(shapeTransforms * data->bones[i].boundSphereCenter, data->bones[i].boundSphereRadius);
|
influence.mBoundSphere = osg::BoundingSpheref(data->bones[i].boundSphereCenter, data->bones[i].boundSphereRadius);
|
||||||
|
|
||||||
map->mMap.insert(std::make_pair(boneName, influence));
|
map->mMap.insert(std::make_pair(boneName, influence));
|
||||||
}
|
}
|
||||||
rig->setInfluenceMap(map);
|
rig->setInfluenceMap(map);
|
||||||
rig->setRigTransforms(*&shapeTransforms);
|
|
||||||
|
|
||||||
parentNode->addChild(rig);
|
parentNode->addChild(rig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ RigGeometry::RigGeometry(const RigGeometry ©, const osg::CopyOp ©op)
|
||||||
: Drawable(copy, copyop)
|
: Drawable(copy, copyop)
|
||||||
, mSkeleton(NULL)
|
, mSkeleton(NULL)
|
||||||
, mInfluenceMap(copy.mInfluenceMap)
|
, mInfluenceMap(copy.mInfluenceMap)
|
||||||
, mRigTransforms(copy.mRigTransforms)
|
|
||||||
, mLastFrameNumber(0)
|
, mLastFrameNumber(0)
|
||||||
, mBoundsFirstFrame(true)
|
, mBoundsFirstFrame(true)
|
||||||
{
|
{
|
||||||
|
@ -215,9 +214,6 @@ void RigGeometry::cull(osg::NodeVisitor* nv)
|
||||||
if (mGeomToSkelMatrix)
|
if (mGeomToSkelMatrix)
|
||||||
resultMat *= (*mGeomToSkelMatrix);
|
resultMat *= (*mGeomToSkelMatrix);
|
||||||
|
|
||||||
if (!mRigTransforms.isIdentity())
|
|
||||||
resultMat *= mRigTransforms;
|
|
||||||
|
|
||||||
for (auto &vertex : pair.second)
|
for (auto &vertex : pair.second)
|
||||||
{
|
{
|
||||||
(*positionDst)[vertex] = resultMat.preMult((*positionSrc)[vertex]);
|
(*positionDst)[vertex] = resultMat.preMult((*positionSrc)[vertex]);
|
||||||
|
@ -313,11 +309,6 @@ void RigGeometry::setInfluenceMap(osg::ref_ptr<InfluenceMap> influenceMap)
|
||||||
mInfluenceMap = influenceMap;
|
mInfluenceMap = influenceMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RigGeometry::setRigTransforms(osg::Matrixf& transform)
|
|
||||||
{
|
|
||||||
mRigTransforms = transform;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RigGeometry::accept(osg::NodeVisitor &nv)
|
void RigGeometry::accept(osg::NodeVisitor &nv)
|
||||||
{
|
{
|
||||||
if (!nv.validNodeMask(*this))
|
if (!nv.validNodeMask(*this))
|
||||||
|
|
|
@ -40,7 +40,6 @@ namespace SceneUtil
|
||||||
};
|
};
|
||||||
|
|
||||||
void setInfluenceMap(osg::ref_ptr<InfluenceMap> influenceMap);
|
void setInfluenceMap(osg::ref_ptr<InfluenceMap> influenceMap);
|
||||||
void setRigTransforms(osg::Matrixf& transform);
|
|
||||||
|
|
||||||
/// Initialize this geometry from the source geometry.
|
/// Initialize this geometry from the source geometry.
|
||||||
/// @note The source geometry will not be modified.
|
/// @note The source geometry will not be modified.
|
||||||
|
@ -66,7 +65,6 @@ namespace SceneUtil
|
||||||
osg::ref_ptr<osg::RefMatrix> mGeomToSkelMatrix;
|
osg::ref_ptr<osg::RefMatrix> mGeomToSkelMatrix;
|
||||||
|
|
||||||
osg::ref_ptr<InfluenceMap> mInfluenceMap;
|
osg::ref_ptr<InfluenceMap> mInfluenceMap;
|
||||||
osg::Matrixf mRigTransforms;
|
|
||||||
|
|
||||||
typedef std::pair<Bone*, osg::Matrixf> BoneBindMatrixPair;
|
typedef std::pair<Bone*, osg::Matrixf> BoneBindMatrixPair;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue