Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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