Ignore:
Timestamp:
07/31/14 08:08:31 (11 years ago)
Author:
epyon
Message:
  • lua::table_guard is_* utility functions
  • minor tweaks
File:
1 edited

Legend:

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

    r295 r296  
    1111
    1212
    13 nv::skeletal_mesh::skeletal_mesh( device* a_device, const mesh_data* a_mesh_data, const mesh_nodes_data* bones )
    14         : animated_mesh()
     13nv::skeletal_mesh_cpu::skeletal_mesh_cpu( device* a_device, const mesh_data* a_mesh_data, const mesh_nodes_data* bones )
     14        : skeletal_mesh()
    1515        , m_data( a_mesh_data )
    1616{
     
    2929}
    3030
    31 void nv::skeletal_mesh::update_animation( animation_entry* a_anim, uint32 a_anim_time )
     31void nv::skeletal_mesh_cpu::update_animation( animation_entry* a_anim, uint32 a_anim_time )
    3232{
    3333        if ( a_anim )
    3434        {
    35                 skeletal_animation_entry * anim = (skeletal_animation_entry*)a_anim;
     35                skeletal_animation_entry_cpu * anim = (skeletal_animation_entry_cpu*)a_anim;
    3636                anim->update_skeleton( m_transform.data(), (float)a_anim_time );
    3737                {
     
    7070
    7171
    72 void nv::skeletal_animation_entry::update_skeleton( transform* skeleton, float time ) const
     72void nv::skeletal_animation_entry_cpu::update_skeleton( transform* skeleton, float time ) const
    7373{
    7474        float frame_duration = 1000.f / (float)m_node_data->get_frame_rate();
     
    8585
    8686
    87 nv::skeletal_mesh::~skeletal_mesh()
     87nv::skeletal_mesh_cpu::~skeletal_mesh_cpu()
    8888{
    8989        delete m_va;
    90 }
    91 
    92 void nv::skeletal_mesh::run_animation( animation_entry* a_anim )
    93 {
    94         if ( a_anim != nullptr )
    95         {
    96                 update_animation( a_anim, 0 );
    97         }
    9890}
    9991
     
    209201
    210202nv::skeletal_mesh_gpu::skeletal_mesh_gpu( device* a_device, const mesh_data* a_mesh, const mesh_nodes_data* a_bone_data )
    211         : animated_mesh(), m_bone_data( a_bone_data ), m_transform( nullptr )
     203        : skeletal_mesh(), m_bone_data( a_bone_data ), m_transform( nullptr )
    212204{
    213205        m_va          = a_device->create_vertex_array( a_mesh, nv::STATIC_DRAW );
     
    219211}
    220212
    221 void nv::skeletal_mesh_gpu::run_animation( animation_entry* a_anim )
    222 {
    223         if ( m_bone_data && a_anim != nullptr )
    224         {
    225                 skeletal_animation_entry_gpu * anim = (skeletal_animation_entry_gpu*)(a_anim);
     213void nv::skeletal_mesh_gpu::update_animation( animation_entry* a_anim, uint32 a_anim_time )
     214{
     215        if ( m_bone_data && a_anim )
     216        {
     217                skeletal_animation_entry_gpu * anim = (skeletal_animation_entry_gpu*)a_anim;
    226218                anim->prepare( m_bone_data );
    227                 update_animation( a_anim, 0 );
    228         }
    229 }
    230 
    231 void nv::skeletal_mesh_gpu::update_animation( animation_entry* a_anim, uint32 a_anim_time )
    232 {
    233         if ( m_bone_data && a_anim )
    234         {
    235                 skeletal_animation_entry_gpu * anim = (skeletal_animation_entry_gpu*)a_anim;
    236219                anim->update_skeleton( m_transform, a_anim_time );
    237220        }
    238221}
    239222
    240 void nv::skeletal_mesh_gpu::update( program* a_program ) const
     223void nv::skeletal_mesh_gpu::update( program* a_program )
    241224{
    242225        if ( m_bone_data )
Note: See TracChangeset for help on using the changeset viewer.