Commit 6c86e563 authored by Mike Kremer's avatar Mike Kremer
Browse files

Do not deform skin if skin weights are not computed.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13448 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0c93ec07
......@@ -8,7 +8,8 @@ SkinT<MeshT>::SkinT(SkeletonT<PointT> *_skeleton, MeshT *_mesh, int _objectID) :
skeleton_(_skeleton),
mesh_(_mesh),
objectId_(_objectID),
lastmethod_(M_LBS)
lastmethod_(M_LBS),
weightsComputed_(false)
{
}
......@@ -101,6 +102,12 @@ void SkinT<MeshT>::deformSkin()
template<typename MeshT>
void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method)
{
// Do not transform skin if skin weights were not computed before
// as the mesh entirely disappears since all vertices collapse to origin
if(!weightsComputed_) {
return;
}
lastAnimationHandle_ = _hAni;
lastmethod_ = _method;
......
......@@ -46,6 +46,12 @@ public:
Skeleton* skeleton();
/// Set whether weights are computed
void weightsComputed(bool _flag) { weightsComputed_ = _flag; }
/// Check whether weights were computed
bool weightsComputed() const { return weightsComputed_; }
private:
Skeleton* skeleton_;
MeshT* mesh_;
......@@ -53,6 +59,9 @@ private:
AnimationHandle lastAnimationHandle_;
Method lastmethod_;
// Flag that indicates whether skin weights have been computed
bool weightsComputed_;
};
typedef SkinT< TriMesh > TriMeshSkin;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment