Last change
on this file since 498 was
480,
checked in by epyon, 10 years ago
|
- cleanup of legacy code
- resource updates
|
File size:
1.1 KB
|
Rev | Line | |
---|
[395] | 1 | // Copyright (C) 2011-2015 ChaosForge Ltd
|
---|
| 2 | // http://chaosforge.org/
|
---|
| 3 | //
|
---|
| 4 | // This file is part of Nova libraries.
|
---|
| 5 | // For conditions of distribution and use, see copying.txt file in root folder.
|
---|
[227] | 6 |
|
---|
| 7 | #include "nv/gfx/skeletal_mesh.hh"
|
---|
| 8 |
|
---|
| 9 | #include "nv/interface/context.hh"
|
---|
| 10 | #include "nv/interface/device.hh"
|
---|
[392] | 11 | #include "nv/stl/unordered_map.hh"
|
---|
[227] | 12 |
|
---|
[475] | 13 | #include "nv/core/logging.hh"
|
---|
[480] | 14 | #if 0
|
---|
[477] | 15 | void nv::skeletal_animation_entry::update_skeleton( skeleton_instance& data, uint32 a_ms_time ) const
|
---|
[283] | 16 | {
|
---|
[479] | 17 | float fframe = ( a_ms_time * 0.001f ) * m_fps;
|
---|
| 18 | float nframe = nv::floor( fframe );
|
---|
[470] | 19 | uint32 duration = get_frame_count();
|
---|
| 20 | if ( duration == 0 )
|
---|
| 21 | {
|
---|
[479] | 22 | fframe = static_cast<float>( get_start_frame() );
|
---|
[470] | 23 | }
|
---|
[479] | 24 | else if ( nframe >= duration )
|
---|
[470] | 25 | {
|
---|
| 26 | if ( is_looping() )
|
---|
[479] | 27 | fframe = nv::fmodf( fframe, nv::f32( duration ) );
|
---|
[470] | 28 | else
|
---|
[479] | 29 | fframe = static_cast<float>( get_end_frame() );
|
---|
[470] | 30 | }
|
---|
[287] | 31 |
|
---|
[477] | 32 | if ( data.size() == 0 )
|
---|
| 33 | data.initialize( m_temp_anim->size() );
|
---|
| 34 | data.animate( m_temp_anim, m_data, fframe );
|
---|
[283] | 35 | }
|
---|
| 36 |
|
---|
[467] | 37 | void nv::skeletal_animation_entry::prepare( const mesh_nodes_data* bones )
|
---|
[283] | 38 | {
|
---|
[477] | 39 | m_data.prepare( m_temp_anim, bones ? bones : m_temp_anim );
|
---|
[283] | 40 | }
|
---|
[480] | 41 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.