Changeset 374 for trunk/nv/interface/interpolation_template.hh
- Timestamp:
- 05/26/15 17:35:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/interface/interpolation_template.hh
r368 r374 19 19 20 20 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& ) 22 22 { 23 23 key_slot_info< KEY, SLOT >::interpolate( key, k1, k2, factor ); … … 25 25 26 26 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& ) 28 28 { 29 29 } … … 32 32 void interpolate_key( KEY& key, const KEY& k1, const KEY& k2, float factor ) 33 33 { 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 >() ); 38 38 } 39 39 … … 85 85 86 86 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& ) 88 88 { return mat4(); } 89 89 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& ) 91 91 { return extract_matrix_p_impl(k); } 92 92 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& ) 94 94 { return extract_matrix_r_impl(k); } 95 95 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& ) 97 97 { return extract_matrix_s_impl(k); } 98 98 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& ) 100 100 { return extract_matrix_pr_impl(k); } 101 101 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& ) 103 103 { return extract_matrix_rs_impl(k); } 104 104 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& ) 106 106 { return extract_matrix_ps_impl(k); } 107 107 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& ) 109 109 { return extract_matrix_prs_impl(k); } 110 110 111 111 112 112 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(); } 114 114 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 ); } 116 116 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 ); } 118 118 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 ); } 120 120 121 121 122 122 123 123 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& ) 125 125 { 126 126 static_assert( key_has_slot< KEY, animation_slot::POSITION >::value == false, "key!"); … … 131 131 132 132 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& ) 134 134 { 135 135 static_assert( key_has_slot< KEY, animation_slot::TFORM >::value == false, "key!"); 136 136 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 >() 140 140 ); 141 141 } 142 142 143 143 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& ) 145 145 { 146 146 static_assert( key_has_slot< KEY, animation_slot::POSITION >::value == false, "key!"); … … 151 151 152 152 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& ) 154 154 { 155 155 static_assert( key_has_slot< KEY, animation_slot::TFORM >::value == false, "key!"); 156 156 static_assert( key_has_slot< KEY, animation_slot::SCALE >::value == false, "key!"); 157 157 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 >() 160 160 ); 161 161 } … … 165 165 mat4 extract_matrix( const KEY& k ) 166 166 { 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 >() ); 168 168 } 169 169 … … 171 171 transform extract_transform( const KEY& k ) 172 172 { 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 >() ); 174 174 } 175 175
Note: See TracChangeset
for help on using the changeset viewer.