Gamestudio Links
Zorro Links
Newest Posts
Old models with Mixamo animations
by rayp
Yesterday at 21:21
rayp's old school fast zombie FPS project
by rayp
Yesterday at 21:10
Votes for future features
by AndrewAMD
Yesterday at 18:08
Series within loop
by tradingest
Yesterday at 15:24
TMF info
by AndrewAMD
Yesterday at 15:24
text outline breiter machen?
by tagimbul
Yesterday at 12:26
Reset vars
by tradingest
Yesterday at 00:40
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
5 registered (Akow, RealSerious3D, AndrewAMD, thewalruss, 1 invisible), 442 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
jiffdbf, jgtrader, Chefmac, BazGen, pallab1964
18079 Registered Users
Topic Options
Rate This Topic
#472942 - 06/01/18 04:12 Movement
LaserJock2000 Offline
Newbie

Registered: 05/13/18
Posts: 7
I have a car entity on an arena. The car drives well with my joystick however I want to drive it in a relative vice absoulute fashion.
AKA: I want the car to drive forward based on entity not world coordinates. I have tried both:
pXent_move(me, vector(my.x -= joy_axis(1,2) * .01, my.y -= joy_axis(1, 1) * .01, my.pan -= joy_axis(1, 4) * .01), nullvector);

and

c_move(me, vector(my.x -= joy_axis(1,2) * .01, my.y -= joy_axis(1, 1) * .01, my.pan -= joy_axis(1, 4) * .01), nullvector, GLIDE);

The car always drives in world coordinates.

Any ideas?
Thanks

Top
#472946 - 06/01/18 09:10 Re: Movement [Re: LaserJock2000]
txesmi Offline
Serious User

Registered: 06/13/07
Posts: 1164
Loc: Hiporope and its pain
Hi,
pXent_move moves physx actors with no collision detection. On pX, actors are moved with forces. pXent_addforcelocal adds forces in object space.

Salud!

Top
#472947 - 06/01/18 10:15 Re: Movement [Re: txesmi]
Kartoffel Offline
Expert

Registered: 06/11/09
Posts: 2210
Loc: Bavaria, Germany
what txesmi said, unless you're using a kinematic character. In that case you have to use pXent_move().
_________________________
POTATO-MAN saves the day! - Random

Top
#472963 - 06/03/18 03:35 Re: Movement [Re: Kartoffel]
LaserJock2000 Offline
Newbie

Registered: 05/13/18
Posts: 7
Good point. Here is my code. The car drives but goes through the arena walls and is always in world coordinates.

////////////////////////////////////////////////////////////////////
#include <default.c>
#include <ackphysx.h>
////////////////////////////////////////////////////////////////////

// joyNum 1/2, axisNum 1-6
var joy_axis(int joyNum, int axisNum)
{
VECTOR *source[2];

if(axisNum < 1 || axisNum > 6) return 0;
if(joyNum == 2)
{
source[0] = &joy2_raw;
source[1] = &joy2_rot;
}
else
{
source[0] = &joy_raw;
source[1] = &joy_rot;
}
axisNum--;
var *pv = source[axisNum/3];
return pv[axisNum%3]; // read var at x,y,z
}

function main()
{
VECTOR Car1;
ENTITY* Car1;
ENTITY* Level1;
physX_open();
video_mode = 12;
level_load ("2018_arena_MKIII.wmb");
Car1 = ent_create (Car1, vector(64, 100, 2.5), NULL); // create the Car
Level1 = ent_create ("2018_arena_MKIII.wmb", vector(0,0,0), NULL);


wait (2);

}
action move_me()
{
while (1)
{
pXent_move(me, vector(my.x -= joy_axis(1,2) * .01, my.y -= joy_axis(1, 1) * .01, my.pan -= joy_axis(1, 4) * .01), nullvector);
wait (1);
}
}

Top
#472964 - 06/03/18 10:55 Re: Movement [Re: LaserJock2000]
Kartoffel Offline
Expert

Registered: 06/11/09
Posts: 2210
Loc: Bavaria, Germany
you have to register your entities as physics objects
_________________________
POTATO-MAN saves the day! - Random

Top
#472977 - 06/04/18 22:16 Re: Movement [Re: Kartoffel]
LaserJock2000 Offline
Newbie

Registered: 05/13/18
Posts: 7
Thanks. Umm. How do I do that please?

Top
#472980 - 06/04/18 22:29 Re: Movement [Re: LaserJock2000]
Kartoffel Offline
Expert

Registered: 06/11/09
Posts: 2210
Loc: Bavaria, Germany
Take a look at the physics workshop at http://tutorial.3dgamestudio.net/ wink
_________________________
POTATO-MAN saves the day! - Random

Top


Moderator:  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de