Changeset 285 for trunk/src/formats/nmd_loader.cc
- Timestamp:
- 07/21/14 02:19:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/nmd_loader.cc
r284 r285 138 138 m_animation->nodes[i].parent_id = node_header.parent_id; 139 139 m_animation->nodes[i].transform = node_header.transform; 140 m_animation->nodes[i].channel_count = ch_count; 141 m_animation->nodes[i].channels = nullptr; 140 m_animation->nodes[i].data = nullptr; 142 141 if ( ch_count > 0 ) 143 142 { 144 m_animation->nodes[i].channels = new key_raw_channel* [ch_count]; 143 key_data* kdata = new key_data; 144 m_animation->nodes[i].data = kdata; 145 145 for ( uint32 c = 0; c < ch_count; ++c ) 146 146 { … … 151 151 key_raw_channel* channel = key_raw_channel::create( cheader.format, cheader.count ); 152 152 source.read( channel->data, channel->desc.size, channel->count ); 153 m_animation->nodes[i].channels[c] = channel;153 kdata->add_channel( channel ); 154 154 } 155 155 } … … 168 168 { 169 169 nmd_node& node = m_animation->nodes[n]; 170 key_animation_data* keys = nullptr; 171 if ( node.channel_count > 1 ) 172 { 173 keys = new nv::key_vectors_prs( node.channels[0], node.channels[1], node.channels[2] ); 174 } 175 else if ( node.channel_count == 1 ) 176 { 177 keys = new nv::transform_vector( node.channels[0] ); 178 node.channels[0] = nullptr; 179 node.channel_count = 0; 180 } 181 m_data.push_back( keys ); 170 m_data.push_back( node.data ); 171 node.data = nullptr; 182 172 } 183 173 … … 239 229 nv::mat4 node_mat( node->transform ); 240 230 241 if ( m_data[n] && !m_data[n]->empty())231 if ( m_data[n] ) 242 232 { 243 233 node_mat = m_data[n]->get_matrix( anim_time ); … … 257 247 mat4 node_mat( node->transform ); 258 248 259 if ( m_data[ node_id ] && !m_data[ node_id ]->empty())249 if ( m_data[ node_id ] ) 260 250 { 261 251 node_mat = m_data[ node_id ]->get_matrix( time );
Note: See TracChangeset
for help on using the changeset viewer.