Developer Documentation
SkinT.hh
1 #ifndef SKINT_HH
2 #define SKINT_HH
3 
4 #include <ObjectTypes/Skeleton/BaseSkin.hh>
7 
13 template<typename MeshT>
14 class SkinT : public BaseSkin
15 {
16 public:
17  typedef typename MeshT::Point PointT;
18  typedef PointT Point;
19  typedef typename PointT::value_type Scalar;
21  typedef JointT<PointT> Joint;
22  typedef PoseT<PointT> Pose;
23  typedef typename ACG::Matrix4x4T<Scalar> Matrix;
24  typedef typename ACG::QuaternionT<Scalar> Quaternion;
26 
27 public:
34  SkinT(SkeletonT<PointT> *_skeleton, MeshT *_mesh, int _objectID);
35  virtual ~SkinT();
36 
37 public:
43  void attachSkin();
44  void deformSkin();
45  void deformSkin(const AnimationHandle &_hAni, Blending::Method _method = Blending::M_LBS);
46  void releaseSkin();
48 
49  Skeleton* skeleton();
50 
52  void weightsComputed(bool _flag) { weightsComputed_ = _flag; }
53 
55  bool weightsComputed() const { return weightsComputed_; }
56 
57 private:
58  Skeleton* skeleton_;
59  MeshT* mesh_;
60  int objectId_;
61 
62  AnimationHandle lastAnimationHandle_;
63  Blending::Method lastmethod_;
64 
65  // Flag that indicates whether skin weights have been computed
66  bool weightsComputed_;
67 };
68 
71 
72 //=============================================================================
73 //=============================================================================
74 #if defined(INCLUDE_TEMPLATES) && !defined(SKINT_C)
75 #define SKINT_TEMPLATES
76 #include "SkinT_impl.hh"
77 #endif
78 //=============================================================================
79 #endif
80 //=============================================================================
81 
82 
Abstract base class for the skin template, wrapping all template versions of the skin.
Definition: BaseSkin.hh:62
void releaseSkin()
The given mesh will be reset to its default pose and all skin properties are removed.
Definition: SkinT_impl.hh:269
bool weightsComputed() const
Check whether weights were computed.
Definition: SkinT.hh:55
A general pose, used to store the frames of the animation.
Definition: PoseT.hh:58
void attachSkin()
Attach the given mesh as skin to this skeleton.
Definition: SkinT_impl.hh:99
A handle used to refer to an animation or to a specific frame in an animation.
General skin class, used to bind skeleton and mesh and deform the mesh.
Definition: SkinT.hh:14
SkinT(SkeletonT< PointT > *_skeleton, MeshT *_mesh, int _objectID)
constructor
Definition: SkinT_impl.hh:61
void weightsComputed(bool _flag)
Set whether weights are computed.
Definition: SkinT.hh:52
Represents a single joint in the skeleton.
Definition: JointT.hh:60
DualQuaternion class for representing rigid motions in 3d.
void deformSkin()
Attach the given mesh as skin to this skeleton.
Definition: SkinT_impl.hh:120