Changeset 290 for trunk/src/gfx
- Timestamp:
- 07/24/14 00:54:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/skeletal_mesh.cc
r289 r290 122 122 void nv::skeletal_animation_entry_gpu::update_skeleton( mat4* data, uint32 time ) const 123 123 { 124 float tick_time = ( time * 0.001f ) * m_node_data->get_frame_rate(); 125 float anim_time = fmodf( tick_time, m_node_data->get_duration() ); 124 float tick_time = ( time * 0.001f ) * m_frame_rate; 125 float anim_time = m_start; 126 if ( m_duration > 0.0f ) anim_time += fmodf( tick_time, m_duration ); 126 127 127 128 if ( !m_node_data->is_flat() ) … … 224 225 skeletal_animation_entry_gpu * anim = (skeletal_animation_entry_gpu*)(a_anim); 225 226 anim->prepare( m_bone_data ); 226 update_animation( a_anim, 0);227 update_animation( a_anim, uint32( anim->get_start() * 1000.f * anim->get_frame_rate() * 1000 ) ); 227 228 } 228 229 } … … 240 241 { 241 242 if ( m_bone_data ) 242 a_program->set_ uniform_array( "nv_m_bones", m_transform, m_bone_data->get_count() );243 a_program->set_opt_uniform_array( "nv_m_bones", m_transform, m_bone_data->get_count() ); 243 244 } 244 245 245 246 nv::transform nv::skeletal_mesh_gpu::get_node_transform( uint32 node_id ) const 246 247 { 248 if ( node_id == 0 ) return transform(); 247 249 return transform( m_transform[ node_id ] ); 248 250 }
Note: See TracChangeset
for help on using the changeset viewer.