Hello! I have too trucks and, to calculate collisions and such, I need a reliable system to measure their angle difference. Then, If angle difference = x, I know that one car is, say, perpendicularly against second truck's side.
Is it even possible in construct, since angles go from -8 to +8?
I've tried to come up with my own formula, but I am a bit unsure with the results.
Thanks in advance.
Develop games in your browser. Powerful, performant & highly capable.
you can use the bbox top and bottom of the standing truck, and measure between angle of those positions its a bad solution though to play with angles. better use distance.
There is the angleDiff(a,b) expression that will do that. It gives a value of 0 to 180.
If you need a signed angle result of -180 to 180 you can do angle(0,0,cos(a-b),sin(a-b))