Changeset 242


Ignore:
Timestamp:
05/25/14 09:57:11 (11 years ago)
Author:
epyon
Message:
  • fix for animation transform_vector
  • common four_cc template
Location:
trunk/nv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/common.hh

    r237 r242  
    174174        struct empty_type {};
    175175
     176        template < int a, int b, int c, int d >
     177        struct four_cc
     178        {
     179                static const unsigned int value = (((((d << 8) | c) << 8) | b) << 8) | a;
     180        };
     181
    176182} // namespace nv
    177183
  • trunk/nv/gfx/animation.hh

    r241 r242  
    165165                        if ( m_keys.size() == 0 ) return transform();
    166166                        if ( m_keys.size() == 1 ) return m_keys[0];
    167                         size_t index = glm::clamp<size_t>( size_t( time ), 0, m_keys.size() - 1 );
     167                        size_t index = glm::clamp<size_t>( size_t( time ), 0, m_keys.size() - 2 );
    168168                        float factor = glm::clamp<float> ( time - index, 0.0f, 1.0f );
    169169                        return interpolate( m_keys[ index ], m_keys[ index + 1 ], factor );
Note: See TracChangeset for help on using the changeset viewer.