Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Which pXent commands will apply force so model goes straight? #406657
08/27/12 05:48
08/27/12 05:48
Joined: Sep 2006
Posts: 36
Tempe, AZ
B
bpc31 Offline OP
Newbie
bpc31  Offline OP
Newbie
B

Joined: Sep 2006
Posts: 36
Tempe, AZ
For example if I use pXent_setvelocity(my, vector(500, 0, 0)); //my boat moves along the X-axis not straight ahead. Somehow it needs to adjust based on the boats current pan?

Code:
if( key_cul ) pXent_addtorquelocal (my, vector(0, 0, 30000*time_step));
if( key_cur ) pXent_addtorquelocal (my, vector(0, 0, -30000*time_step));
if( key_cuu ) ???????


Re: Which pXent commands will apply force so model goes straight? [Re: bpc31] #406659
08/27/12 07:17
08/27/12 07:17
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you need a local vector for this. so you have to convert your speed to the local speed. this is simply done with vec_rotate:

Code:
VECTOR speed;
vec_set(speed, vector(500, 0, 0));
vec_rotate(speed, my.pan);
pXent_setvelocity(my, speed);



Visit my site: www.masterq32.de
Re: Which pXent commands will apply force so model goes straight? [Re: MasterQ32] #406663
08/27/12 08:26
08/27/12 08:26
Joined: Sep 2006
Posts: 36
Tempe, AZ
B
bpc31 Offline OP
Newbie
bpc31  Offline OP
Newbie
B

Joined: Sep 2006
Posts: 36
Tempe, AZ
That works great - Thanks so much!


Moderated by  HeelX, Spirit 

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