@@ -207,12 +207,14 @@ Animation to_animation(gltf2cpp::Animation const& animation, std::span<gltf2cpp:
207207 auto ret = Animation{};
208208 for (auto const & channel : animation.channels ) {
209209 auto const & sampler = animation.samplers [channel.sampler ];
210+ if (sampler.interpolation == gltf2cpp::Interpolation::eCubicSpline) { continue ; } // facade constraint
210211 auto const & input = accessors[sampler.input ];
211212 assert (input.type == gltf2cpp::Accessor::Type::eScalar && input.component_type == gltf2cpp::ComponentType::eFloat);
212213 auto times = std::get<gltf2cpp::Accessor::Float>(input.data ).span ();
213214 auto const & output = accessors[sampler.output ];
214215 assert (output.component_type == gltf2cpp::ComponentType::eFloat);
215216 auto const values = std::get<gltf2cpp::Accessor::Float>(output.data ).span ();
217+ ret.transform .target = channel.target .node ;
216218 switch (channel.target .path ) {
217219 case Path::eTranslation:
218220 case Path::eScale: {
@@ -221,9 +223,11 @@ Animation to_animation(gltf2cpp::Animation const& animation, std::span<gltf2cpp:
221223 vec.resize (values.size () / 3 );
222224 std::memcpy (vec.data (), values.data (), values.size_bytes ());
223225 if (channel.target .path == Path::eScale) {
224- ret.animator .scale = make_interpolator<glm::vec3>(times, vec);
226+ ret.transform .scale = make_interpolator<glm::vec3>(times, vec);
227+ ret.transform .scale .interpolation = static_cast <Interpolation>(sampler.interpolation );
225228 } else {
226- ret.animator .translation = make_interpolator<glm::vec3>(times, vec);
229+ ret.transform .translation = make_interpolator<glm::vec3>(times, vec);
230+ ret.transform .translation .interpolation = static_cast <Interpolation>(sampler.interpolation );
227231 }
228232 break ;
229233 }
@@ -232,7 +236,8 @@ Animation to_animation(gltf2cpp::Animation const& animation, std::span<gltf2cpp:
232236 auto vec = std::vector<glm::quat>{};
233237 vec.resize (values.size () / 4 );
234238 std::memcpy (vec.data (), values.data (), values.size_bytes ());
235- ret.animator .rotation = make_interpolator<glm::quat>(times, vec);
239+ ret.transform .rotation = make_interpolator<glm::quat>(times, vec);
240+ ret.transform .rotation .interpolation = static_cast <Interpolation>(sampler.interpolation );
236241 break ;
237242 }
238243 case Path::eWeights: {
0 commit comments