Ignore:
Timestamp:
07/10/14 00:29:34 (11 years ago)
Author:
epyon
Message:
  • key_slots - another template hell similar to vertex definitions
  • animation data is now stored using key_raw_channel's similarly to mesh_raw_channels
  • automatic compile-time templated interpolation generation for any type of animation key
  • QUAT and TRANSFORM as registered types for channels
  • a ton of minor cleanups
  • do not open vertex.hh if you want to stay sane
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/interface/mesh_loader.hh

    r241 r282  
    2626{
    2727
     28        // TODO: change to generic nodes!
    2829        class tag_map
    2930        {
    3031        public:
    31                 typedef std::unordered_map< std::string, transform_vector > map;
     32                typedef std::unordered_map< std::string, key_raw_channel* > map;
    3233
    3334                tag_map () {}
    34                 map& get_map()             { return m_map; }
    35                 const map& get_map() const { return m_map; }
    36                 const transform_vector* get_tag( const std::string& key ) const
     35
     36                const transform* get_tag( const std::string& key ) const
    3737                {
    38                         auto it = m_map.find( key );
    39                         return ( it != m_map.end() ? &(it->second) : nullptr );
     38                        key_raw_channel* channel = m_map.at( key );
     39                        return ((transform*)(channel->data));
     40                }
     41                void insert( const std::string& key, key_raw_channel* chan )
     42                {
     43                        m_map[ key ] = chan;
     44                }
     45                ~tag_map()
     46                {
     47                        for ( auto t : m_map )
     48                                delete t.second;
    4049                }
    4150        private:
Note: See TracChangeset for help on using the changeset viewer.