@@ -207,12 +207,14 @@ Animation to_animation(gltf2cpp::Animation const& animation, std::span<gltf2cpp:
207
207
auto ret = Animation{};
208
208
for (auto const & channel : animation.channels ) {
209
209
auto const & sampler = animation.samplers [channel.sampler ];
210
+ if (sampler.interpolation == gltf2cpp::Interpolation::eCubicSpline) { continue ; } // facade constraint
210
211
auto const & input = accessors[sampler.input ];
211
212
assert (input.type == gltf2cpp::Accessor::Type::eScalar && input.component_type == gltf2cpp::ComponentType::eFloat);
212
213
auto times = std::get<gltf2cpp::Accessor::Float>(input.data ).span ();
213
214
auto const & output = accessors[sampler.output ];
214
215
assert (output.component_type == gltf2cpp::ComponentType::eFloat);
215
216
auto const values = std::get<gltf2cpp::Accessor::Float>(output.data ).span ();
217
+ ret.transform .target = channel.target .node ;
216
218
switch (channel.target .path ) {
217
219
case Path::eTranslation:
218
220
case Path::eScale: {
@@ -221,9 +223,11 @@ Animation to_animation(gltf2cpp::Animation const& animation, std::span<gltf2cpp:
221
223
vec.resize (values.size () / 3 );
222
224
std::memcpy (vec.data (), values.data (), values.size_bytes ());
223
225
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 );
225
228
} 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 );
227
231
}
228
232
break ;
229
233
}
@@ -232,7 +236,8 @@ Animation to_animation(gltf2cpp::Animation const& animation, std::span<gltf2cpp:
232
236
auto vec = std::vector<glm::quat>{};
233
237
vec.resize (values.size () / 4 );
234
238
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 );
236
241
break ;
237
242
}
238
243
case Path::eWeights: {
0 commit comments