Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,253 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 Offline
Senior Expert
Quad  Offline
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