Ignore:
Timestamp:
05/26/15 17:35:06 (10 years ago)
Author:
epyon
Message:
  • MASSIVE commit
  • common.hh - size_t, ptrdiff_t, nv:: namespace, NV_ALIGN_OF and basic template tools
  • STL - algorithm.hh, iterator.hh, limits.hh, numeric.hh and type_info.hh
  • STL - updates to memory, array and string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/interface/interpolation_template.hh

    r368 r374  
    1919
    2020        template < typename KEY, animation_slot SLOT >
    21         void interpolate_slot( KEY& key, const KEY& k1, const KEY& k2, float factor, const std::true_type& )
     21        void interpolate_slot( KEY& key, const KEY& k1, const KEY& k2, float factor, const true_type& )
    2222        {
    2323                key_slot_info< KEY, SLOT >::interpolate( key, k1, k2, factor );
     
    2525
    2626        template < typename KEY, animation_slot SLOT >
    27         void interpolate_slot( KEY&, const KEY&, const KEY&, float, const std::false_type& )
     27        void interpolate_slot( KEY&, const KEY&, const KEY&, float, const false_type& )
    2828        {
    2929        }
     
    3232        void interpolate_key( KEY& key, const KEY& k1, const KEY& k2, float factor )
    3333        {
    34                 interpolate_slot< KEY, animation_slot::POSITION >( key, k1, k2, factor, std::integral_constant< bool, key_has_slot< KEY, animation_slot::POSITION >::value >() );
    35                 interpolate_slot< KEY, animation_slot::ROTATION >( key, k1, k2, factor, std::integral_constant< bool, key_has_slot< KEY, animation_slot::ROTATION >::value >() );
    36                 interpolate_slot< KEY, animation_slot::SCALE >( key, k1, k2, factor, std::integral_constant< bool, key_has_slot< KEY, animation_slot::SCALE >::value >() );
    37                 interpolate_slot< KEY, animation_slot::TFORM >( key, k1, k2, factor, std::integral_constant< bool, key_has_slot< KEY, animation_slot::TFORM >::value >() );
     34                interpolate_slot< KEY, animation_slot::POSITION >( key, k1, k2, factor, integral_constant< bool, key_has_slot< KEY, animation_slot::POSITION >::value >() );
     35                interpolate_slot< KEY, animation_slot::ROTATION >( key, k1, k2, factor, integral_constant< bool, key_has_slot< KEY, animation_slot::ROTATION >::value >() );
     36                interpolate_slot< KEY, animation_slot::SCALE >( key, k1, k2, factor, integral_constant< bool, key_has_slot< KEY, animation_slot::SCALE >::value >() );
     37                interpolate_slot< KEY, animation_slot::TFORM >( key, k1, k2, factor, integral_constant< bool, key_has_slot< KEY, animation_slot::TFORM >::value >() );
    3838        }
    3939
     
    8585
    8686                template < typename KEY >
    87                 mat4 extract_matrix_prs( const KEY&, const std::false_type&, const std::false_type&, const std::false_type& )
     87                mat4 extract_matrix_prs( const KEY&, const false_type&, const false_type&, const false_type& )
    8888                { return mat4(); }
    8989                template < typename KEY >
    90                 mat4 extract_matrix_prs( const KEY& k, const std::true_type&, const std::false_type&, const std::false_type& )
     90                mat4 extract_matrix_prs( const KEY& k, const true_type&, const false_type&, const false_type& )
    9191                { return extract_matrix_p_impl(k); }
    9292                template < typename KEY >
    93                 mat4 extract_matrix_prs( const KEY& k, const std::false_type&, const std::true_type&, const std::false_type& )
     93                mat4 extract_matrix_prs( const KEY& k, const false_type&, const true_type&, const false_type& )
    9494                { return extract_matrix_r_impl(k); }
    9595                template < typename KEY >
    96                 mat4 extract_matrix_prs( const KEY& k, const std::false_type&, const std::false_type&, const std::true_type& )
     96                mat4 extract_matrix_prs( const KEY& k, const false_type&, const false_type&, const true_type& )
    9797                { return extract_matrix_s_impl(k); }
    9898                template < typename KEY >
    99                 mat4 extract_matrix_prs( const KEY& k, const std::true_type&, const std::true_type&, const std::false_type& )
     99                mat4 extract_matrix_prs( const KEY& k, const true_type&, const true_type&, const false_type& )
    100100                { return extract_matrix_pr_impl(k); }
    101101                template < typename KEY >
    102                 mat4 extract_matrix_prs( const KEY& k, const std::false_type&, const std::true_type&, const std::true_type& )
     102                mat4 extract_matrix_prs( const KEY& k, const false_type&, const true_type&, const true_type& )
    103103                { return extract_matrix_rs_impl(k); }
    104104                template < typename KEY >
    105                 mat4 extract_matrix_prs( const KEY& k, const std::true_type&, const std::false_type&, const std::true_type& )
     105                mat4 extract_matrix_prs( const KEY& k, const true_type&, const false_type&, const true_type& )
    106106                { return extract_matrix_ps_impl(k); }
    107107                template < typename KEY >
    108                 mat4 extract_matrix_prs( const KEY& k, const std::true_type&, const std::true_type&, const std::true_type& )
     108                mat4 extract_matrix_prs( const KEY& k, const true_type&, const true_type&, const true_type& )
    109109                { return extract_matrix_prs_impl(k); }
    110110
    111111
    112112                template < typename KEY >
    113                 transform extract_transform_pr_impl( const KEY&, const std::false_type&, const std::false_type& ) { return transform(); }
     113                transform extract_transform_pr_impl( const KEY&, const false_type&, const false_type& ) { return transform(); }
    114114                template < typename KEY >
    115                 transform extract_transform_pr_impl( const KEY& k, const std::true_type&, const std::true_type& ) { return transform( k.position, k.rotation ); }
     115                transform extract_transform_pr_impl( const KEY& k, const true_type&, const true_type& ) { return transform( k.position, k.rotation ); }
    116116                template < typename KEY >
    117                 transform extract_transform_pr_impl( const KEY& k, const std::true_type&, const std::false_type& ) { return transform( k.position ); }
     117                transform extract_transform_pr_impl( const KEY& k, const true_type&, const false_type& ) { return transform( k.position ); }
    118118                template < typename KEY >
    119                 transform extract_transform_pr_impl( const KEY& k, const std::false_type&, const std::true_type& ) { return transform( k.rotation ); }
     119                transform extract_transform_pr_impl( const KEY& k, const false_type&, const true_type& ) { return transform( k.rotation ); }
    120120
    121121
    122122
    123123                template < typename KEY >
    124                 mat4 extract_matrix_impl( const KEY& k, const std::true_type& )
     124                mat4 extract_matrix_impl( const KEY& k, const true_type& )
    125125                {
    126126                        static_assert( key_has_slot< KEY, animation_slot::POSITION >::value == false, "key!");
     
    131131
    132132                template < typename KEY >
    133                 mat4 extract_matrix_impl( const KEY& k, const std::false_type& )
     133                mat4 extract_matrix_impl( const KEY& k, const false_type& )
    134134                {
    135135                        static_assert( key_has_slot< KEY, animation_slot::TFORM >::value == false, "key!");
    136136                        return extract_matrix_prs( k,
    137                                 std::integral_constant< bool, key_has_slot< KEY, animation_slot::POSITION >::value >(),
    138                                 std::integral_constant< bool, key_has_slot< KEY, animation_slot::ROTATION >::value >(),
    139                                 std::integral_constant< bool, key_has_slot< KEY, animation_slot::SCALE >::value >()
     137                                integral_constant< bool, key_has_slot< KEY, animation_slot::POSITION >::value >(),
     138                                integral_constant< bool, key_has_slot< KEY, animation_slot::ROTATION >::value >(),
     139                                integral_constant< bool, key_has_slot< KEY, animation_slot::SCALE >::value >()
    140140                                );
    141141                }
    142142
    143143                template < typename KEY >
    144                 transform extract_transform_impl( const KEY& k, const std::true_type& )
     144                transform extract_transform_impl( const KEY& k, const true_type& )
    145145                {
    146146                        static_assert( key_has_slot< KEY, animation_slot::POSITION >::value == false, "key!");
     
    151151
    152152                template < typename KEY >
    153                 transform extract_transform_impl( const KEY& k, const std::false_type& )
     153                transform extract_transform_impl( const KEY& k, const false_type& )
    154154                {
    155155                        static_assert( key_has_slot< KEY, animation_slot::TFORM >::value == false, "key!");
    156156                        static_assert( key_has_slot< KEY, animation_slot::SCALE >::value == false, "key!");
    157157                        return extract_transform_pr_impl( k,
    158                                 std::integral_constant< bool, key_has_slot< KEY, animation_slot::POSITION >::value >(),
    159                                 std::integral_constant< bool, key_has_slot< KEY, animation_slot::ROTATION >::value >()
     158                                integral_constant< bool, key_has_slot< KEY, animation_slot::POSITION >::value >(),
     159                                integral_constant< bool, key_has_slot< KEY, animation_slot::ROTATION >::value >()
    160160                                );
    161161                }
     
    165165        mat4 extract_matrix( const KEY& k )
    166166        {
    167                 return detail::extract_matrix_impl( k, std::integral_constant< bool, key_has_slot< KEY, animation_slot::TFORM >::value >() );
     167                return detail::extract_matrix_impl( k, integral_constant< bool, key_has_slot< KEY, animation_slot::TFORM >::value >() );
    168168        }
    169169
     
    171171        transform extract_transform( const KEY& k )
    172172        {
    173                 return detail::extract_transform_impl( k, std::integral_constant< bool, key_has_slot< KEY, animation_slot::TFORM >::value >() );
     173                return detail::extract_transform_impl( k, integral_constant< bool, key_has_slot< KEY, animation_slot::TFORM >::value >() );
    174174        }
    175175
Note: See TracChangeset for help on using the changeset viewer.