Index: trunk/src/gfx/skeletal_mesh.cc
===================================================================
--- trunk/src/gfx/skeletal_mesh.cc	(revision 288)
+++ trunk/src/gfx/skeletal_mesh.cc	(revision 289)
@@ -18,4 +18,6 @@
 	m_pntdata.assign( (const md5_vtx_pnt*)pnt_chan->data, pnt_chan->count );
 	m_bone_offset.resize( bones->get_count() );
+	m_transform.resize( bones->get_count() );
+
 	for ( uint32 i = 0; i < bones->get_count(); ++i )
 	{
@@ -32,10 +34,5 @@
 	{
 		skeletal_animation_entry * anim = (skeletal_animation_entry*)a_anim;
-		float frame_duration = 1000.f / (float)anim->get_frame_rate();
-		float anim_duration = frame_duration * anim->get_duration();
-		float new_time = fmodf( (float)a_anim_time, anim_duration );
-		anim->update_skeleton( m_transform.data(), new_time * 0.001f );
-
-		//m_mesh_data->apply( m_transform.data() );
+		anim->update_skeleton( m_transform.data(), (float)a_anim_time );
 		{
 			size_t skeleton_size = m_bone_offset.size();
@@ -72,4 +69,20 @@
 }
 
+
+void nv::skeletal_animation_entry::update_skeleton( transform* skeleton, float time ) const
+{
+	float frame_duration = 1000.f / (float)m_node_data->get_frame_rate();
+	float anim_duration = frame_duration * m_node_data->get_duration();
+	float new_time = fmodf( time, anim_duration ) * 0.001f;
+
+	float frame_num = new_time * m_node_data->get_frame_rate();
+	for ( size_t i = 0; i < m_node_data->get_count(); ++i )
+	{
+		skeleton[i] = m_node_data->get_node(i)->data->get_transform( frame_num );
+	}
+}
+
+
+
 nv::skeletal_mesh::~skeletal_mesh()
 {
@@ -81,6 +94,4 @@
 	if ( a_anim != nullptr )
 	{
-		skeletal_animation_entry * anim = (skeletal_animation_entry*)(a_anim);
-		m_transform.resize( anim->get_num_joints() );
 		update_animation( a_anim, 0 );
 	}
