Skip to content

Commit

Permalink
Make curve interpolate crash less.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed May 21, 2021
1 parent af788d1 commit c1147d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5592,6 +5592,8 @@ struct EditorSceneImporterGLTFInterpolate<Quat> {

template <class T>
T GLTFDocument::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp) {
ERR_FAIL_COND_V(!p_values.size(), T());
ERR_FAIL_COND_V(p_times.size() != p_values.size(), p_values[0]);
//could use binary search, worth it?
int idx = -1;
for (int i = 0; i < p_times.size(); i++) {
Expand Down

0 comments on commit c1147d7

Please sign in to comment.