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
62
S
35
G
13
Posts: 231
Reputation: 12,400

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
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

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
62
S
35
G
13
Posts: 231
Reputation: 12,400


Return to Construct 2 General

Who is online

Users browsing this forum: Cojoyo, mihirolover and 11 guests