Gamestudio Links
Zorro Links
Newest Posts
long time to load data
by qin. 12/29/25 14:06
The new evaluation shell
by jcl. 12/29/25 09:56
about Zorro S (monthly)
by AndrewAMD. 12/29/25 03:24
Xor Memory Problem.
by TipmyPip. 12/26/25 19:14
ZorroFix. ini /data and /log path
by Martin_HH. 12/19/25 21:02
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Quad, AndrewAMD, vicknick), 8,212 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Syndrela, HDRSEO, AOUNZA, digitalboy381, agasior
19190 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,211
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,211
İ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 | 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