Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
shortest rotation #211035
06/14/08 15:18
06/14/08 15:18
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Im trying to figure out how to get my enemy to rotate the shortest way to the player. However with the pan angles constrianed to 0>180/0>-180, the flip from 180 to -180 is giving me no end of trouble.

Is there a good way of dealing with this in a simple manner?

Cheers

Re: shortest rotation [Re: TigerTao] #211036
06/14/08 15:24
06/14/08 15:24
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
i gues it is not 180 and -180 it is 0 and 360?


3333333333
Re: shortest rotation [Re: Quad] #211038
06/14/08 15:39
06/14/08 15:39
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
You can use the ang()-function.
Just have a look at this thread.

Re: shortest rotation [Re: Fenriswolf] #211042
06/14/08 16:12
06/14/08 16:12
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Thank you very much FenrisWolf

Your code works perfectly. Also if I change the order of entities in the vec_diff line, my enemies run away from me. Awesomeness!

Re: shortest rotation [Re: TigerTao] #211056
06/14/08 17:32
06/14/08 17:32
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
question frequency -> suggest placement in faq forum category:
ang function use in 'shortest rotation'



Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1