Lerp vs AngleLerp

Discussion and feedback on Construct 2

Post » Sun Feb 05, 2017 5:27 am

anglelerp(a, b, x) Linearly interpolate the angle a to b by x. Unlike the standard lerp, this takes in to account the cyclical nature of angles.

Can someone explain to me what angleLerp does different than Lerp would for angles?
I am not fully understanding the point.

I have an object that rotates to 180 when clicked on and back to 0 when clicked on again.
I have lerp on one and anglelerp on the other and don't see a difference.
B
80
S
41
G
13
Posts: 257
Reputation: 13,511

Post » Sun Feb 05, 2017 5:36 am

Try instead something like 300 to 30 to see the difference.
Lerp(300,30, t) will go counter clockwise.
Anglelerp(300,30,t) will go clockwise. It basically will pick the shortest direction.
B
100
S
38
G
134
Posts: 5,556
Reputation: 85,325

Post » Sun Feb 05, 2017 5:54 am

Oh that is useful.
I only needed 180, I will just use lerp.
I figure if that isn't needed then anglelerp may just add more calculations.

Thanks
B
80
S
41
G
13
Posts: 257
Reputation: 13,511


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests