Developer Documentation

SkinT.hh
1 #ifndef SKINT_HH
2 #define SKINT_HH
3
4 #include <ObjectTypes/Skeleton/BaseSkin.hh>
5 #include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
6 #include <ObjectTypes/PolyMesh/PolyMesh.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;
20 typedef SkeletonT<PointT> Skeleton;
21 typedef JointT<PointT> Joint;
22 typedef PoseT<PointT> Pose;
23 typedef typename ACG::Matrix4x4T<Scalar> Matrix;
24 typedef typename ACG::QuaternionT<Scalar> Quaternion;
25 typedef typename ACG::DualQuaternionT<Scalar> DualQuaternion;
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
69 typedef SkinT< TriMesh > TriMeshSkin;
70 typedef SkinT< PolyMesh > PolyMeshSkin;
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
BaseSkin
Abstract base class for the skin template, wrapping all template versions of the skin.
Definition: BaseSkin.hh:62
TriangleMesh.hh
SkinT::releaseSkin
void releaseSkin()
The given mesh will be reset to its default pose and all skin properties are removed.
Definition: SkinT_impl.hh:269
SkeletonT
Definition: JointT.hh:50
SkinT::weightsComputed
bool weightsComputed() const
Check whether weights were computed.
Definition: SkinT.hh:55
PoseT
A general pose, used to store the frames of the animation.
Definition: PoseT.hh:58
ACG::QuaternionT
Definition: QuaternionT.hh:75
SkinT::attachSkin
void attachSkin()
Attach the given mesh as skin to this skeleton.
Definition: SkinT_impl.hh:99
AnimationHandle
A handle used to refer to an animation or to a specific frame in an animation.
Definition: AnimationHandle.hh:47
SkinT
General skin class, used to bind skeleton and mesh and deform the mesh.
Definition: SkinT.hh:14
SkinT::SkinT
SkinT(SkeletonT< PointT > *_skeleton, MeshT *_mesh, int _objectID)
constructor
Definition: SkinT_impl.hh:61
SkinT::weightsComputed
void weightsComputed(bool _flag)
Set whether weights are computed.
Definition: SkinT.hh:52
JointT
Represents a single joint in the skeleton.
Definition: JointT.hh:60
ACG::Matrix4x4T
Definition: Matrix4x4T.hh:92
ACG::DualQuaternionT
DualQuaternion class for representing rigid motions in 3d.
Definition: DualQuaternionT.hh:80
SkinT::deformSkin
void deformSkin()
Attach the given mesh as skin to this skeleton.
Definition: SkinT_impl.hh:120
PolyMesh.hh