Changeset 480 for trunk/src/gfx/skeleton_instance.cc
- Timestamp:
- 11/03/15 19:06:23 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/skeleton_instance.cc
r477 r480 6 6 7 7 #include "nv/gfx/skeleton_instance.hh" 8 9 #include "nv/core/profiler.hh" 8 10 9 11 void nv::skeleton_binding::prepare( const mesh_nodes_data* node_data, const mesh_nodes_data* bone_data ) … … 62 64 for ( uint32 n = 0; n < node_data->size(); ++n ) 63 65 if ( ( *node_data )[n]->get_parent_id() == -1 ) 64 animate_rec( node_data, binding, frame, n, mat4() );66 animate_rec( node_data, binding, frame, n, transform() ); 65 67 } 66 68 } 67 69 } 68 70 69 void nv::skeleton_instance::animate_rec( const mesh_nodes_data* node_data, const skeleton_binding& binding, float frame, uint32 id, const mat4& parent )71 void nv::skeleton_instance::animate_rec( const mesh_nodes_data* node_data, const skeleton_binding& binding, float frame, uint32 id, const transform& parent ) 70 72 { 71 73 // TODO: fix transforms, which are now embedded, 72 74 // see note in assimp_loader.cc:load_node 73 75 const data_channel_set* node = ( *node_data )[id]; 74 mat4node_mat( node->get_transform() );76 transform node_mat( node->get_transform() ); 75 77 76 78 if ( node->size() > 0 ) 77 79 { 78 80 raw_channel_interpolator interpolator( node, binding.m_key ); 79 node_mat = interpolator.get< mat4>( frame );81 node_mat = interpolator.get< transform >( frame ); 80 82 } 81 83 82 mat4global_mat = parent * node_mat;84 transform global_mat = parent * node_mat; 83 85 84 86 sint16 bone_id = binding.m_indices[id]; 85 87 if ( bone_id >= 0 ) 86 88 { 87 m_transform[bone_id] = global_mat * binding.m_offsets[bone_id];89 m_transform[bone_id] = global_mat.extract() * binding.m_offsets[bone_id]; 88 90 } 89 91
Note: See TracChangeset
for help on using the changeset viewer.