- Joined
- Mar 16, 2008
- Messages
- 941
Okay, I'm giving up now 
I realy like maths, but I can't think of these angle-calculations.
Just can't think right with the warcraft angle stuff.
I got two angles.
One is the actual movement direction of a missle.
The second one is the angle between the missle and a unit.
Let's for example say, I want the missle to change the direction
by 10% towards the unit.
I wanted to divide the angles, depending one which one is bigger:
.oldangle is the movement of the missle,
angle the one between the two units.
This example applies the angle difference by ACCURACY%,
at least I hope that this is right.
Like you might know, this fails as soon as for example
angle is 10 and .oldangle is 320.
Angle would be bigger, but the value of .oldangle is.
I know that many people know how to correctly calculate
this, but I can't ^^'
Can anyone help me?
Greets, Justify
I realy like maths, but I can't think of these angle-calculations.
Just can't think right with the warcraft angle stuff.
I got two angles.
One is the actual movement direction of a missle.
The second one is the angle between the missle and a unit.
Let's for example say, I want the missle to change the direction
by 10% towards the unit.
I wanted to divide the angles, depending one which one is bigger:
JASS:
if angle > .oldangle then
set .oldangle = .oldangle+(angle-oldangle)*ACCURACY
else
set .oldangle = .oldangle-(oldangle-angle)*ACCURACY
endif
angle the one between the two units.
This example applies the angle difference by ACCURACY%,
at least I hope that this is right.
Like you might know, this fails as soon as for example
angle is 10 and .oldangle is 320.
Angle would be bigger, but the value of .oldangle is.
I know that many people know how to correctly calculate
this, but I can't ^^'
Can anyone help me?
Greets, Justify