mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
Revert "Animate tangents in RigGeometry"
This reverts commit 9cf963b751
.
This commit is contained in:
parent
9cf963b751
commit
60c8c4fdda
2 changed files with 0 additions and 20 deletions
|
@ -84,14 +84,12 @@ RigGeometry::RigGeometry(const RigGeometry ©, const osg::CopyOp ©op)
|
|||
{
|
||||
mSourceVertices = copy.mSourceVertices;
|
||||
mSourceNormals = copy.mSourceNormals;
|
||||
mSourceTangents = copy.mSourceTangents;
|
||||
}
|
||||
|
||||
void RigGeometry::setSourceGeometry(osg::ref_ptr<osg::Geometry> sourceGeometry)
|
||||
{
|
||||
mSourceVertices = static_cast<osg::Vec3Array*>(sourceGeometry->getVertexArray());
|
||||
mSourceNormals = static_cast<osg::Vec3Array*>(sourceGeometry->getNormalArray());
|
||||
mSourceTangents = static_cast<osg::Vec4Array*>(sourceGeometry->getTexCoordArray(7));
|
||||
|
||||
osg::Geometry& from = *sourceGeometry;
|
||||
|
||||
|
@ -229,18 +227,9 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
|||
// skinning
|
||||
osg::Vec3Array* positionSrc = mSourceVertices;
|
||||
osg::Vec3Array* normalSrc = mSourceNormals;
|
||||
osg::Vec4Array* tangentSrc = mSourceTangents;
|
||||
|
||||
osg::Vec3Array* positionDst = static_cast<osg::Vec3Array*>(getVertexArray());
|
||||
osg::Vec3Array* normalDst = static_cast<osg::Vec3Array*>(getNormalArray());
|
||||
osg::Vec4Array* tangentDst = static_cast<osg::Vec4Array*>(getTexCoordArray(7));
|
||||
|
||||
if (tangentDst && !tangentSrc)
|
||||
{
|
||||
// tangents may be set by the ShaderVisitor so may not have existed yet at the time the source geometry was set
|
||||
tangentSrc = osg::clone(tangentDst, osg::CopyOp::DEEP_COPY_ALL);
|
||||
mSourceTangents = tangentSrc;
|
||||
}
|
||||
|
||||
for (Bone2VertexMap::const_iterator it = mBone2VertexMap.begin(); it != mBone2VertexMap.end(); ++it)
|
||||
{
|
||||
|
@ -264,19 +253,11 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
|||
unsigned short vertex = *vertexIt;
|
||||
(*positionDst)[vertex] = resultMat.preMult((*positionSrc)[vertex]);
|
||||
(*normalDst)[vertex] = osg::Matrix::transform3x3((*normalSrc)[vertex], resultMat);
|
||||
if (tangentDst)
|
||||
{
|
||||
osg::Vec4f srcTangent = (*tangentSrc)[vertex];
|
||||
osg::Vec3f transformedTangent = osg::Matrix::transform3x3(osg::Vec3f(srcTangent.x(), srcTangent.y(), srcTangent.z()), resultMat);
|
||||
(*tangentDst)[vertex] = osg::Vec4f(transformedTangent, srcTangent.w());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
positionDst->dirty();
|
||||
normalDst->dirty();
|
||||
if (tangentDst)
|
||||
tangentDst->dirty();
|
||||
}
|
||||
|
||||
void RigGeometry::updateBounds(osg::NodeVisitor *nv)
|
||||
|
|
|
@ -53,7 +53,6 @@ namespace SceneUtil
|
|||
private:
|
||||
osg::ref_ptr<osg::Vec3Array> mSourceVertices;
|
||||
osg::ref_ptr<osg::Vec3Array> mSourceNormals;
|
||||
osg::ref_ptr<osg::Vec4Array> mSourceTangents;
|
||||
Skeleton* mSkeleton;
|
||||
|
||||
osg::NodePath mSkelToGeomPath;
|
||||
|
|
Loading…
Reference in a new issue