Commit 55a9c519 authored by Jan Möbius's avatar Jan Möbius

Dont expose skeleton type in header anymore.

parent ce639c4f
...@@ -39,13 +39,6 @@ ...@@ -39,13 +39,6 @@
* * * *
\*===========================================================================*/ \*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef BASESKIN_HH #ifndef BASESKIN_HH
#define BASESKIN_HH #define BASESKIN_HH
...@@ -57,6 +50,8 @@ ...@@ -57,6 +50,8 @@
#include <ObjectTypes/Skeleton/SkeletonT.hh> #include <ObjectTypes/Skeleton/SkeletonT.hh>
#include <OpenMesh/Core/IO/MeshIO.hh> #include <OpenMesh/Core/IO/MeshIO.hh>
#include "BlendingMethod.hh"
#define OBJECTDATA_SKIN "Skin Object-Data" #define OBJECTDATA_SKIN "Skin Object-Data"
#define SKIN_WEIGHTS_PROP "skin-weights" #define SKIN_WEIGHTS_PROP "skin-weights"
#define DEFAULTPOSE_PROP "Default pose" #define DEFAULTPOSE_PROP "Default pose"
...@@ -99,18 +94,7 @@ public: ...@@ -99,18 +94,7 @@ public:
typedef std::map<unsigned int, double> SkinWeights; typedef std::map<unsigned int, double> SkinWeights;
//@} //@}
/**
* @brief Possible deformation methods
*
* LBS = Linear Blend Skinning
* DBS = Dual Quaternion Blend Skinning
*
*/
enum Method
{
M_LBS = 0,
M_DBS = 1
};
public: public:
BaseSkin(int _skeletonId) { BaseSkin(int _skeletonId) {
...@@ -127,7 +111,7 @@ public: ...@@ -127,7 +111,7 @@ public:
//@{ //@{
virtual void attachSkin() = 0; virtual void attachSkin() = 0;
virtual void deformSkin() = 0; virtual void deformSkin() = 0;
virtual void deformSkin(const AnimationHandle &_hAni, Method _method = M_LBS) = 0; virtual void deformSkin(const AnimationHandle &_hAni, Blending::Method _method = Blending::M_LBS) = 0;
virtual void releaseSkin() = 0; virtual void releaseSkin() = 0;
//@} //@}
......
#pragma once
namespace Blending {
/**
* @brief Possible deformation methods
*
* LBS = Linear Blend Skinning
* DBS = Dual Quaternion Blend Skinning
*
*/
enum Method
{
M_LBS = 0,
M_DBS = 1
};
};
...@@ -63,7 +63,7 @@ SkinT<MeshT>::SkinT(SkeletonT<PointT> *_skeleton, MeshT *_mesh, int _objectID) : ...@@ -63,7 +63,7 @@ SkinT<MeshT>::SkinT(SkeletonT<PointT> *_skeleton, MeshT *_mesh, int _objectID) :
skeleton_(_skeleton), skeleton_(_skeleton),
mesh_(_mesh), mesh_(_mesh),
objectId_(_objectID), objectId_(_objectID),
lastmethod_(M_LBS), lastmethod_(Blending::M_LBS),
weightsComputed_(false) weightsComputed_(false)
{ {
...@@ -155,7 +155,7 @@ void SkinT<MeshT>::deformSkin() ...@@ -155,7 +155,7 @@ void SkinT<MeshT>::deformSkin()
* @param _method deformation method to be used @see BaseSkin.hh * @param _method deformation method to be used @see BaseSkin.hh
*/ */
template<typename MeshT> template<typename MeshT>
void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method) void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Blending::Method _method)
{ {
// Do not transform skin if skin weights were not computed before // Do not transform skin if skin weights were not computed before
// as the mesh entirely disappears since all vertices collapse to origin // as the mesh entirely disappears since all vertices collapse to origin
...@@ -204,7 +204,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method) ...@@ -204,7 +204,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method)
OpenMesh::Vec3d point(0, 0, 0), normal(0, 0, 0); // the new position and normal OpenMesh::Vec3d point(0, 0, 0), normal(0, 0, 0); // the new position and normal
if( _method == M_LBS ) { if( _method == Blending::M_LBS ) {
// Linear blend skinning // Linear blend skinning
SkinWeights &weights = mesh_->property(propWeights, currentVertexH); SkinWeights &weights = mesh_->property(propWeights, currentVertexH);
...@@ -225,7 +225,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method) ...@@ -225,7 +225,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method)
normal += it_w->second * unified.transform_vector(default_normal); normal += it_w->second * unified.transform_vector(default_normal);
} }
}else if( _method == M_DBS ) { }else if( _method == Blending::M_DBS ) {
// Dual quaternion blend skinning // Dual quaternion blend skinning
std::vector<double> weightVector; std::vector<double> weightVector;
......
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
//@{ //@{
void attachSkin(); void attachSkin();
void deformSkin(); void deformSkin();
void deformSkin(const AnimationHandle &_hAni, Method _method = M_LBS); void deformSkin(const AnimationHandle &_hAni, Blending::Method _method = Blending::M_LBS);
void releaseSkin(); void releaseSkin();
//@} //@}
...@@ -59,8 +59,8 @@ private: ...@@ -59,8 +59,8 @@ private:
MeshT* mesh_; MeshT* mesh_;
int objectId_; int objectId_;
AnimationHandle lastAnimationHandle_; AnimationHandle lastAnimationHandle_;
Method lastmethod_; Blending::Method lastmethod_;
// Flag that indicates whether skin weights have been computed // Flag that indicates whether skin weights have been computed
bool weightsComputed_; bool weightsComputed_;
......
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