Skip to content

Commit

Permalink
adjust easings.ease_between
Browse files Browse the repository at this point in the history
  • Loading branch information
labuzm committed Sep 27, 2020
1 parent 7fe6223 commit 4ac5dbd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kaacore
Submodule kaacore updated 2 files
+0 −4 src/camera.cpp
+4 −3 src/physics.cpp
12 changes: 11 additions & 1 deletion src/kaa/easings.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,22 @@ def ease(object easing, double progress):


def ease_between(object easing, double progress, a, b):
if isinstance(a, (int, float)):
assert isinstance(b, (int, float)), \
"`a` is a number, `b` must have the same type."
return c_ease_between[double](
<CEasing>(<uint8_t>easing.value),
progress, a, b
)

if isinstance(a, Vector):
assert isinstance(b, Vector), \
"`a` is a Vector, `b` must have the same type."
return Vector.from_c_vector(c_ease_between[CDVec2](
<CEasing>(<uint8_t>easing.value),
progress,
(<Vector>a).c_vector,
(<Vector>b).c_vector,
(<Vector>b).c_vector
))

raise Exception('Unsupported type of parameters.')

0 comments on commit 4ac5dbd

Please sign in to comment.