godot
godot copied to clipboard
Add new methods to `AABB` and `Rect2` classes
What I did
- Added the following methods to
AABB
andRect2
classes:lerp()
,cubic_interpolate()
andcubic_interpolate_in_time()
; - Modified the source code of following methods of
Animation
class:_cubic_interpolate_in_time()
andinterpolate_variant()
.
Closes: #80627
In the future please be aware of when people have already said they wanted to solve an issue like this case, first ask if they are still working on it, otherwise you might cost someone a lot of lost time when you grab the issue
This doesn't solve the linked issue unless you also integrate these methods with the animation
In the future please be aware of when people have already said they wanted to solve an issue like this case, first ask if they are still working on it, otherwise you might cost someone a lot of lost time when you grab the issue
Alright, I'll pay more attention next time. For sure isn't nice to waste someone's time!
This doesn't solve the linked issue unless you also integrate these methods with the animation
@AThousandShips can you please give me more info of how can I do it?
I'll try find the relevant code later today
Thanks, really appreciate it! I'll come back to this later as well, I'll keep looking further into the code trying to understand what else is needed to implement/modify.
I'd suggest looking at scene/resources/animation.cpp
, look at lines:
- 2357
- 2396
- 5664
Also might be good to look into adding the same to AABB
for completeness
The missing function is not the only problem, but the substance of the problem is the need to force a positive value with abs() at the end of the interpolation function.
@AThousandShips @TokageItLab I've implemented the following methods for AABB
and Rect2
classes: lerp()
, cubic_interpolate()
and cubic_interpolate_in_time()
. Also I started using these new methods in the source code of the following Animation
class methods: _cubic_interpolate_in_time()
and interpolate_variant()
.
Please use clang-format
locally instead of depending on the CI status to check your code style
@TokageItLab can you take a look in this PR? I've made the requested changes
@AThousandShips I've modified what you've pointed out. I've also solved the conflicts.