Ignore:
Timestamp:
07/23/14 17:37:44 (11 years ago)
Author:
epyon
Message:
  • unified animation_entry class
  • virtuals removed from animation_entry
  • lua_table - added missing get_float
  • lua_table - fixed has_field
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gfx/skeletal_mesh.cc

    r287 r288  
    3333                skeletal_animation_entry * anim = (skeletal_animation_entry*)a_anim;
    3434                float frame_duration = 1000.f / (float)anim->get_frame_rate();
    35                 uint32 anim_duration = uint32( frame_duration * (float)anim->get_frame_count() );
    36                 uint32 new_time = a_anim_time % anim_duration;
    37                 anim->update_skeleton( m_transform.data(), (float)new_time * 0.001f );
     35                float anim_duration = frame_duration * anim->get_duration();
     36                float new_time = fmodf( (float)a_anim_time, anim_duration );
     37                anim->update_skeleton( m_transform.data(), new_time * 0.001f );
    3838
    3939                //m_mesh_data->apply( m_transform.data() );
     
    8787}
    8888
    89 
    90 nv::skeletal_animation_entry_gpu::skeletal_animation_entry_gpu( const std::string& name, const mesh_nodes_data* anim, bool a_looping )
    91         : animation_entry( name )
    92         , m_node_data( anim )
    93 {
    94         uint32 node_count = m_node_data->get_count();
    95 
     89void nv::skeletal_animation_entry_gpu::initialize()
     90{
    9691        m_prepared  = false;
    97         m_looping   = a_looping;
    9892        m_children  = nullptr;
    9993        m_offsets   = nullptr;
     94        uint32 node_count = m_node_data->get_count();
    10095        m_bone_ids  = new sint16[ node_count ];
    10196
Note: See TracChangeset for help on using the changeset viewer.