Changeset 406 for trunk/src/gfx/skeletal_mesh.cc
- Timestamp:
- 06/20/15 00:05:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/skeletal_mesh.cc
r395 r406 16 16 { 17 17 const mesh_raw_channel* pnt_chan = a_mesh_data->get_channel<md5_vtx_pnt>(); 18 m_pntdata.assign( (const md5_vtx_pnt*)pnt_chan->data, pnt_chan->count );18 m_pntdata.assign( reinterpret_cast<const md5_vtx_pnt*>( pnt_chan->data ), pnt_chan->count ); 19 19 m_bone_offset.resize( bones->get_count() ); 20 20 m_transform.resize( bones->get_count() ); … … 35 35 if ( a_anim ) 36 36 { 37 skeletal_animation_entry_cpu * anim = (skeletal_animation_entry_cpu*)a_anim;38 anim->update_skeleton( m_transform.data(), (float)a_anim_time);37 skeletal_animation_entry_cpu * anim = static_cast<skeletal_animation_entry_cpu*>( a_anim ); 38 anim->update_skeleton( m_transform.data(), static_cast<float>( a_anim_time ) ); 39 39 { 40 40 size_t skeleton_size = m_bone_offset.size(); … … 51 51 const md5_vtx_pntiw& vert = m_vtx_data[i]; 52 52 53 for ( size_t j = 0; j < 4; ++j )53 for ( int j = 0; j < 4; ++j ) 54 54 { 55 unsigned index = (unsigned)vert.boneindex[j];55 unsigned index = unsigned( vert.boneindex[j] ); 56 56 float weight = vert.boneweight[j]; 57 57 const quat& orient = m_transform[index].get_orientation(); … … 71 71 void nv::skeletal_animation_entry_cpu::update_skeleton( transform* skeleton, float time ) const 72 72 { 73 float frame_duration = 1000.f / (float)m_node_data->get_frame_rate();73 float frame_duration = 1000.f / static_cast<float>( m_node_data->get_frame_rate() ); 74 74 float anim_duration = frame_duration * m_node_data->get_duration(); 75 75 float new_time = fmodf( time, anim_duration ) * 0.001f; … … 152 152 if ( bi != bone_names.end() ) 153 153 { 154 bone_id = (sint16)bi->second;154 bone_id = sint16( bi->second ); 155 155 } 156 156 m_bone_ids[n] = bone_id; … … 207 207 if ( m_bone_data && a_anim ) 208 208 { 209 skeletal_animation_entry_gpu * anim = (skeletal_animation_entry_gpu*)a_anim;209 skeletal_animation_entry_gpu * anim = static_cast<skeletal_animation_entry_gpu*>( a_anim ); 210 210 anim->prepare( m_bone_data ); 211 211 anim->update_skeleton( m_transform, a_anim_time );
Note: See TracChangeset
for help on using the changeset viewer.