Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
Type-Skeleton
Commits
55a9c519
Commit
55a9c519
authored
Dec 20, 2018
by
Jan Möbius
Browse files
Dont expose skeleton type in header anymore.
parent
ce639c4f
Changes
4
Hide whitespace changes
Inline
Side-by-side
ObjectTypes/Skeleton/BaseSkin.hh
View file @
55a9c519
...
...
@@ -39,13 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef BASESKIN_HH
#define BASESKIN_HH
...
...
@@ -57,6 +50,8 @@
#include
<ObjectTypes/Skeleton/SkeletonT.hh>
#include
<OpenMesh/Core/IO/MeshIO.hh>
#include
"BlendingMethod.hh"
#define OBJECTDATA_SKIN "Skin Object-Data"
#define SKIN_WEIGHTS_PROP "skin-weights"
#define DEFAULTPOSE_PROP "Default pose"
...
...
@@ -99,18 +94,7 @@ public:
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:
BaseSkin
(
int
_skeletonId
)
{
...
...
@@ -127,7 +111,7 @@ public:
//@{
virtual
void
attachSkin
()
=
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
;
//@}
...
...
ObjectTypes/Skeleton/BlendingMethod.hh
0 → 100644
View file @
55a9c519
#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
};
};
ObjectTypes/Skeleton/SkinT.cc
View file @
55a9c519
...
...
@@ -63,7 +63,7 @@ SkinT<MeshT>::SkinT(SkeletonT<PointT> *_skeleton, MeshT *_mesh, int _objectID) :
skeleton_
(
_skeleton
),
mesh_
(
_mesh
),
objectId_
(
_objectID
),
lastmethod_
(
M_LBS
),
lastmethod_
(
Blending
::
M_LBS
),
weightsComputed_
(
false
)
{
...
...
@@ -155,7 +155,7 @@ void SkinT<MeshT>::deformSkin()
* @param _method deformation method to be used @see BaseSkin.hh
*/
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
// as the mesh entirely disappears since all vertices collapse to origin
...
...
@@ -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
if
(
_method
==
M_LBS
)
{
if
(
_method
==
Blending
::
M_LBS
)
{
// Linear blend skinning
SkinWeights
&
weights
=
mesh_
->
property
(
propWeights
,
currentVertexH
);
...
...
@@ -225,7 +225,7 @@ void SkinT<MeshT>::deformSkin(const AnimationHandle &_hAni, Method _method)
normal
+=
it_w
->
second
*
unified
.
transform_vector
(
default_normal
);
}
}
else
if
(
_method
==
M_DBS
)
{
}
else
if
(
_method
==
Blending
::
M_DBS
)
{
// Dual quaternion blend skinning
std
::
vector
<
double
>
weightVector
;
...
...
ObjectTypes/Skeleton/SkinT.hh
View file @
55a9c519
...
...
@@ -42,7 +42,7 @@ public:
//@{
void
attachSkin
();
void
deformSkin
();
void
deformSkin
(
const
AnimationHandle
&
_hAni
,
Method
_method
=
M_LBS
);
void
deformSkin
(
const
AnimationHandle
&
_hAni
,
Blending
::
Method
_method
=
Blending
::
M_LBS
);
void
releaseSkin
();
//@}
...
...
@@ -59,8 +59,8 @@ private:
MeshT
*
mesh_
;
int
objectId_
;
AnimationHandle
lastAnimationHandle_
;
Method
lastmethod_
;
AnimationHandle
lastAnimationHandle_
;
Blending
::
Method
lastmethod_
;
// Flag that indicates whether skin weights have been computed
bool
weightsComputed_
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment