summaryrefslogtreecommitdiff
path: root/AnimationRender/F_Interpolate.c
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2026-03-28 23:49:45 +0200
committerSyndamia <kamen@syndamia.com>2026-03-28 23:49:45 +0200
commit7bca1ce8c15c3a5892aa44624d270f6ae8d35aaa (patch)
treeea3f50abb889c668d8d701bde622f87340337fd5 /AnimationRender/F_Interpolate.c
parentaa16453072477ed1f90def01bdd55bebac696f61 (diff)
downloadppm_graphics-7bca1ce8c15c3a5892aa44624d270f6ae8d35aaa.tar
ppm_graphics-7bca1ce8c15c3a5892aa44624d270f6ae8d35aaa.tar.gz
ppm_graphics-7bca1ce8c15c3a5892aa44624d270f6ae8d35aaa.zip
feat: Implement line segment and make node moving animation
Diffstat (limited to 'AnimationRender/F_Interpolate.c')
-rw-r--r--AnimationRender/F_Interpolate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/AnimationRender/F_Interpolate.c b/AnimationRender/F_Interpolate.c
index 3cb3b5a..4686adf 100644
--- a/AnimationRender/F_Interpolate.c
+++ b/AnimationRender/F_Interpolate.c
@@ -63,6 +63,15 @@ void Interpolate_Image(Image* value, const Image* start, const Image* end, doubl
fprintf(stderr, "Refusing to interpolate between images!");
}
+void Interpolate_LineSegment(LineSegment* value, const LineSegment* start, const LineSegment* end, double progress) {
+ value->aX = NUM_INTERPOLATE(start->aX, end->aX, progress);
+ value->aY = NUM_INTERPOLATE(start->aY, end->aY, progress);
+ value->bX = NUM_INTERPOLATE(start->bX, end->bX, progress);
+ value->bY = NUM_INTERPOLATE(start->bY, end->bY, progress);
+ value->width = NUM_INTERPOLATE(start->width, end->width, progress);
+ value->color = colorInterpolate(start->color, end->color, progress);
+}
+
void Interpolate_TransformCenter(TransformCenter* value, const TransformCenter* start, const TransformCenter* end, double progress) {
value->centerX = NUM_INTERPOLATE(start->centerX, end->centerX, progress);
value->centerY = NUM_INTERPOLATE(start->centerY, end->centerY, progress);