Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, chsmac85, NeoDumont, dr_panther, TedMar), 1,095 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
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 Offline OP
Senior Expert
3run  Offline 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!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: What the heck is wrong with CONVEX?! [Re: 3run] #380500
08/18/11 11:49
08/18/11 11:49
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Thats normal when you use the convex mesh hull, but for creating dynamic actors with complex shapes is better to use the pXent_addshape.




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: What the heck is wrong with CONVEX?! [Re: rojart] #380503
08/18/11 13:01
08/18/11 13:01
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Ohh, thanks I didn't know about that one. About addshape, is there any way to stretch box hull?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: 3run
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:

Quote:
...
// 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);
...



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: What the heck is wrong with CONVEX?! [Re: rojart] #380515
08/18/11 15:17
08/18/11 15:17
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I think, there should be such feature which could allow to stretch added shapes.. other ways, it's not that much useful. Thank you for an idea, it seems useful.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: What the heck is wrong with CONVEX?! [Re: 3run] #380534
08/18/11 20:01
08/18/11 20:01
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
rojart, just tried an example you gave, but I can't move shapes positions, they always created at the my origin. And I would like to ask you about removing shapes, will my entity still have that modified hull? And isn't it better to use PH_MODIFIED for my entity? Thank you.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: 3run
...but I can't move shapes positions, they always created at the my origin.

You mean the whole truck or just specific shape?

Originally Posted By: 3run
... 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!

Code:
// 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);


Originally Posted By: 3run
...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.

Originally Posted By: 3run
...will my entity still have that modified hull?

Yes, like screenshot below.




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: What the heck is wrong with CONVEX?! [Re: rojart] #380602
08/19/11 15:05
08/19/11 15:05
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Sorry, I've explained wrong. Not move, but I can't change offsets position, models are always placed at the my origin.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: What the heck is wrong with CONVEX?! [Re: 3run] #380609
08/19/11 16:31
08/19/11 16:31
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Hmm strange, that happens also when vec_add(shape1.x,vector(95,0,1.5)); is executed?


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
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 Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Here is how I do it:
Code:
// 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);




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 1 of 3 1 2 3

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