Go to the documentation of this file.00001 #ifndef OPENTISSUE_KINEMATICS_SKINNING_SBS_SKINNING_CREATE_KEY_H
00002 #define OPENTISSUE_KINEMATICS_SKINNING_SBS_SKINNING_CREATE_KEY_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012
00013
00014 namespace OpenTissue
00015 {
00016 namespace skinning
00017 {
00018
00019 template<typename vertex_type>
00020 static size_t create_key( const vertex_type & vertex )
00021 {
00022 typedef std::vector<size_t> key_sort_type;
00023
00024 key_sort_type keys;
00025
00026 for(int i= 0; i < vertex->m_influences; ++i)
00027 keys.push_back( vertex->m_bone[i] );
00028
00029 std::sort( keys.begin(), keys.end() );
00030
00031 size_t key = 0;
00032 for(int i=0; i < vertex->m_influences; ++i)
00033 key = (key + (keys[i]+1)) * 100;
00034
00035 return key;
00036 }
00037
00038 }
00039 }
00040
00041
00042 #endif