|
What the heck is wrong with CONVEX?!
#380421
08/17/11 14:37
08/17/11 14:37
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
I'm trying to make simple truck physics... and I found out that CONVEX hull doesn't work for me... Works perfectly when I set POLY hull on, but that's for static things only... At the end, I can't get simple truck physics to work, it's simply sucks... I don't know, I think I'm doing everything right, but still doesn't work properly.. Here is the demo: Track source Still, I haven't seen proper vehicle physics made on GS by PhysX... I've learned from Knights on wheels from samples, but it sucks as well...and it has noting to do with original version from ODE which is awesome!
|
|
|
Re: What the heck is wrong with CONVEX?!
[Re: 3run]
#380509
08/18/11 14:34
08/18/11 14:34
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Ohh, thanks I didn't know about that one. About addshape, is there any way to stretch box hull? If I understand correctly, stretching after pXent_addshape is not possible. But simply try this way: ... // Initialize physX properties: ENTITY* shape1 = ent_create(" shape1.mdl",0,0); ENTITY* shape2 = ent_create(" shape2.mdl",0,0); vec_set(shape1.x, my.x);vec_add(shape1.x,vector(95,0,1.5)); vec_set(shape2.x, my.x);vec_add(shape2.x,vector(-34.7,0,-25.5)); pXent_settype(my, PH_RIGID, PH_BOX); pXent_addshape(my, shape1, PH_BOX); set(shape1,INVISIBLE); pXent_addshape(my, shape2, PH_BOX); set(shape2,INVISIBLE); pXent_removeshape(my, 0); ...
|
|
|
Re: What the heck is wrong with CONVEX?!
[Re: 3run]
#380590
08/19/11 13:40
08/19/11 13:40
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
...but I can't move shapes positions, they always created at the my origin. You mean the whole truck or just specific shape? ... And I would like to ask you about removing shapes ... Try with ent_remove function like code below, but warn_level should be commented in or you get continuously an Error E1514 message!
// Initialize physX properties:
pXent_settype(my,PH_RIGID,PH_CONVEX);
ENTITY* shape1 = ent_create("shape1.mdl",0,0);
ENTITY* shape2 = ent_create("shape2.mdl",0,0);
vec_set(shape1.x, my.x); vec_add(shape1.x,vector(95,0,1.5));
vec_set(shape2.x, my.x); vec_add(shape2.x,vector(-34.7,0,-25.5));
pXent_addshape(my, shape1, PH_BOX); ent_remove(shape1); // warn_level should be commented in or you get continuously an Error E1514 message!
pXent_addshape(my, shape2, PH_BOX); ent_remove(shape2);
pXent_removeshape(my, 0);
//pXent_setcollisionflag(my,NULL,NX_NOTIFY_ON_START_TOUCH);
...And isn't it better to use PH_MODIFIED for my entity? Yes, in combination with PH_POLY or PH_CONVEX hull, but I had omitted it because the original shape hull was removed. ...will my entity still have that modified hull? Yes, like screenshot below.
|
|
|
Re: What the heck is wrong with CONVEX?!
[Re: rojart]
#380612
08/19/11 17:07
08/19/11 17:07
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Here is how I do it:
// Create shapes:
ENTITY* shape1 = ent_create("shape1.mdl",0,0);
vec_set(shape1.x,my.x);
vec_add(shape1.x,vector(70,0,-50));
ENTITY* shape2 = ent_create("shape2.mdl",0,0);
vec_set(shape2.x,my.x);
vec_add(shape2.x,vector(-70,0,-110));
// Initialize physX properties:
pXent_settype(my,PH_RIGID,PH_BOX);
// Attach shapes:
pXent_addshape(my,shape1,PH_BOX);
pXent_addshape(my,shape2,PH_BOX);
pXent_removeshape(my,0);
|
|
|
|