PH_CONVEX vs PH_CUBE

Posted By: Rei_Ayanami

PH_CONVEX vs PH_CUBE - 08/24/12 16:04

Hey,

I have (another) small problem:

If I use PH_CUBE with attached wheels attached to another model.
(Imagine a car and a trailer).

Everything works fine when PH_CUBE is used. As soon as I use
PH_CONVEX the model starts floating as it would be a balloon.

I made sure that the model has less than 256 polys. (It has way
less)

There are no differences beside the PhysX hull on the setup.

Regards,
Marian
Posted By: rojart

Re: PH_CONVEX vs PH_CUBE - 08/25/12 09:07

Take a look at PVD, what's going on?

If you don't have PVD, could you please make a small demo?
Posted By: Rei_Ayanami

Re: PH_CONVEX vs PH_CUBE - 08/25/12 10:43

Going to prepare a demo.

Thanks!
Posted By: Rei_Ayanami

Re: PH_CONVEX vs PH_CUBE - 08/25/12 14:28

Okay, while preparing the demo for your, I found the problem:

The collision model was not centered (but positioned correctly). This led to the odd behavior, and everything works, as soon as I center the model in MED and adjust the position in the code.

Odd, however...


Still want a demo?
Posted By: 3run

Re: PH_CONVEX vs PH_CUBE - 08/25/12 15:08

I do grin (Yeeaahhh, I'm a rare bustard grin )
Posted By: rojart

Re: PH_CONVEX vs PH_CUBE - 08/25/12 15:55

Originally Posted By: Rei_Ayanami
Okay, while preparing the demo for your, I found the problem:

The collision model was not centered (but positioned correctly). This led to the odd behavior, and everything works, as soon as I center the model in MED and adjust the position in the code.

Odd, however...

Still want a demo?

Not needed, if works properly, recently I had a similar problem with my Ragdoll code, I remember now.
Posted By: Rei_Ayanami

Re: PH_CONVEX vs PH_CUBE - 08/25/12 16:33

Hmn, okay.

Still odd.


Another (for me big) problem: CONVEX does not allow any special forms. PH_POLY is only for static. Is there no chance besides pXent_addshape?
Posted By: HeelX

Re: PH_CONVEX vs PH_CUBE - 08/25/12 17:39

PhysX allows only either spheres, cubes, capsules and convex things - custom shapes made of several, custom orientated, scaled and positioned shapes.

For a client, I needed very accurate physics shapes. So I took WED and created several scaled boxes, imported them, positioned, rotated and scaled them, to match the needed shape:



Then, I wrote a small Lite-C script, that took the arrangement and wrote a MDL file, that encoded the position, scale, rotation and type of each sub-shape. During runtime, I load the MDL, read out the data and use pXent_addshape to build my custom and yet accurate complex physics shape.

Yes, and it involves work. But in an ideal work, your modeller creates the model for your vehicle once and therefore you need only once to create such a setup.
Posted By: Rei_Ayanami

Re: PH_CONVEX vs PH_CUBE - 08/25/12 21:04

Okay, thanks for the answer laugh!
© 2024 lite-C Forums