@@ -132,4 +132,51 @@ namespace geode
132132 }
133133 };
134134 ALIAS_1D_AND_2D_AND_3D ( Vector );
135+
136+ template < index_t dimension >
137+ struct AttributeLinearInterpolationImpl < Vector< dimension > >
138+ {
139+ template < template < typename > class Attribute >
140+ static Vector< dimension > compute (
141+ const AttributeLinearInterpolation &interpolator,
142+ const Attribute< Vector< dimension > > &attribute )
143+ {
144+ Vector< dimension > result;
145+ for ( const auto i : Indices{ interpolator.indices_ } )
146+ {
147+ result = result
148+ + attribute.value ( interpolator.indices_ [i] )
149+ * interpolator.lambdas_ [i];
150+ }
151+ return result;
152+ }
153+ };
154+
155+ template < index_t dimension >
156+ struct GenericAttributeConversion < Vector< dimension > >
157+ {
158+ static float converted_value ( const Vector< dimension > &vector )
159+ {
160+ return converted_item_value ( vector, 0 );
161+ }
162+
163+ static float converted_item_value (
164+ const Vector< dimension > &vector, local_index_t item )
165+ {
166+ OPENGEODE_ASSERT ( item < nb_items (),
167+ " [GenericAttributeConversion] Accessing "
168+ " incorrect item value" );
169+ return static_cast < float >( vector.value ( item ) );
170+ }
171+
172+ static bool is_genericable ()
173+ {
174+ return true ;
175+ }
176+
177+ static local_index_t nb_items ()
178+ {
179+ return dimension;
180+ }
181+ };
135182} // namespace geode
0 commit comments