Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Type-Skeleton
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenFlipper-Free
Type-Skeleton
Commits
55a9c519
Commit
55a9c519
authored
Dec 20, 2018
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont expose skeleton type in header anymore.
parent
ce639c4f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
27 deletions
+31
-27
ObjectTypes/Skeleton/BaseSkin.hh
ObjectTypes/Skeleton/BaseSkin.hh
+4
-20
ObjectTypes/Skeleton/BlendingMethod.hh
ObjectTypes/Skeleton/BlendingMethod.hh
+20
-0
ObjectTypes/Skeleton/SkinT.cc
ObjectTypes/Skeleton/SkinT.cc
+4
-4
ObjectTypes/Skeleton/SkinT.hh
ObjectTypes/Skeleton/SkinT.hh
+3
-3
No files found.
ObjectTypes/Skeleton/BaseSkin.hh
View file @
55a9c519
...
@@ -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
;
//@}
//@}
...
...
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) :
...
@@ -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
;
...
...
ObjectTypes/Skeleton/SkinT.hh
View file @
55a9c519
...
@@ -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_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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