Skip to content

Commit

Permalink
-Integers and Float should interpolate on animation, maybe fixes godo…
Browse files Browse the repository at this point in the history
…tengine#1891, please test
  • Loading branch information
reduz committed May 16, 2015
1 parent bbe9a37 commit adb709a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/variant_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3388,7 +3388,15 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const {
void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r_dst) {

if (a.type!=b.type) {
r_dst=a;
if (a.is_num() && b.is_num()) {
//not as efficient but..
real_t va=a;
real_t vb=b;
r_dst=(1.0-c) * va + vb * c;

} else {
r_dst=a;
}
return;
}

Expand Down

0 comments on commit adb709a

Please sign in to comment.