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