Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 04/05/26 10:06
TMFs on options in live trading
by Spirit. 03/26/26 19:52
TDAmeritrade plugin with new Schwab accountt?
by AndrewAMD. 03/24/26 17:11
Black Book, 4th edition
by jcl. 03/17/26 09:28
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 2,931 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ondrej, mredit, vestriaa, Lukudo, mldenoiser
19205 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: rotate player the shortest way [Re: Espér] #259072
04/03/09 17:53
04/03/09 17:53
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
its ont a vector, where to rotate, its the position, where to look

for example, BotTurnTo(my, player.x);


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: rotate player the shortest way [Re: VeT] #259082
04/03/09 18:28
04/03/09 18:28
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
ah.. yes.. i need the player to rotate into the direction i give him.. not to look at a model ^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: rotate player the shortest way [Re: Espér] #259103
04/03/09 21:41
04/03/09 21:41
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
So that's really easy!

Code:
function turnPlayer(var angle, var turnspeed){
   if (player.pan%360 >= angle - 180 && player.pan%360 < angle){
      while(player.pan%360 < angle){
         player.pan += time_step * turnspeed;
      }
      player.pan = angle;
   }else{
      while(player.pan%360 > angle){
         player.pan -= time_step * turnspeed;
      }
      player.pan = angle;
   }
}


not tested!


GameStudio Version: A7 Pro v7.86
Re: rotate player the shortest way [Re: garv3] #259117
04/03/09 23:33
04/03/09 23:33
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm.. it works a bit.. but now the rotation into the new direction is missing.. Doesn´t matter what turnspeed i add..


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Page 2 of 2 1 2

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