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/src/formats/md3_loader.cc

    r280 r282  
    275275bool nv::md3_loader::load( stream& source )
    276276{
    277         m_tags.clear();
    278 
    279277        m_md3 = (void*)(new md3_t);
    280278        if ( !read_md3( (md3_t*)m_md3, source ) )
     
    285283}
    286284
    287 void nv::md3_loader::load_tags( transform_vector& t, const std::string& tag )
     285nv::key_raw_channel* nv::md3_loader::load_tags( const std::string& tag )
    288286{
    289287        md3_t* md3 = (md3_t*)m_md3;
     288        key_raw_channel* result = key_raw_channel::create<md3_key>( md3->header.num_frames );
     289        // TODO: is this brain damaged in efficiency (loop nest order) or what?
    290290        for ( sint32 f = 0; f < md3->header.num_frames; ++f )
    291291        {
     
    300300                                vec3 axisy  ( md3_vec3( rtag.axis[2] ) );
    301301                                vec3 origin ( md3_vec3( rtag.origin )  );
    302                                 t.insert( transform( origin, quat( mat3( axisx, axisy, axisz ) ) ) );
     302                                ((md3_key*)(result->data))[f].tform = transform( origin, quat( mat3( axisx, axisy, axisz ) ) );
    303303                        }
    304304                }
    305305
    306306        }
     307        return result;
    307308}
    308309
     
    408409                const md3_tag_t& rtag = md3->tags[i + md3->header.num_tags];
    409410                std::string name( (char*)(rtag.name) );
    410                 load_tags( result->get_map()[ name ], name );
     411                nv::key_raw_channel* keys = load_tags( name );
     412                result->insert( name, keys );
    411413        }
    412414        return result;
Note: See TracChangeset for help on using the changeset viewer.