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
1 registered members (TipmyPip), 18,633 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
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 | 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