Physical rant

posted in Better Together
Published July 19, 2006
Advertisement
Today's been a most unproductive day. Unproductive in the sense of progress made, not work commited. Even more unsatisfactory [depressed]

The better part of the day I spent trying to get mesh-mesh collisions going in Ageia PhysX; between our level and some arbitrary object. The thing just went mad with jittering, bouncing, and seemingly random behaviour.

I assumed it was something to do with the way the engine sets up the physics system and objects (skin width, center of mass, inertia tensors, something like that). No luck tweaking values or setting flags.

It all boils down to this. In PhysX, for mesh mesh collisions, you need to create pmaps for the meshes. pmaps only work properly on meshes that represent some sort of closed volume. As far as I can understand from the documentation, the process of generation applies raycasts to find extents of the volume, and further stores this in some sort of voxel structure for faster and more robust intersection tests. Now, our level naturally isn't a closed volume mesh, so ultimatly that screws up the pmap and any hope of arbitrary meshes colliding with the world [smile]

To resolve this I suppose we could remodell the level with closed volume colission meshes, which in turn might make the character interaction less smooth (pluss our level designer will probably be jumping with joy [rolleyes]). Perhaps more realistically, we can restrict all world-interacting bodies to be of convex shapes, which should work fine without pmaps.

None of this is too hard in itself, but working through someone else's wrapper (the engine we're using), hacking and slashing through their indirections, adding here and there, and never quite knowing if a problem stems from a bug in our code, their code, or in Ageia's PhysX itself, makes for a somewhat frustrating experience.

May tomorrow be a better day [rolleyes]
Previous Entry Half way
Next Entry Dare finished
0 likes 5 comments

Comments

Jesse Chounard
You've learned about the physics system and the engine you're using. While it's isn't something you can hand somebody else to show what you've done, learning is never unproductive. Though I appreciate how frustrating it can be.

I wish you better luck for tomorrow. :)
July 19, 2006 03:04 PM
SimmerD
My understanding is that pmaps are sort of deprecated in the api.

Instead, you can use multiple convex shapes, attached to each other if you need a more complex shape. Ragdoll is one common example of this, but you can combine any set of shapes, and tag as part of the same collision group so they don't intersect each other.
July 19, 2006 11:07 PM
c2_0
Ye, I came across similar information about pmaps, although they it's not quite clear from the official documentation. In any case, like Jesse said, I've learned [smile]

We'll be building our all game objects from convex, or groups of convex shapes as suggested. The way the engine is set up at the momement, they have a one-to-one binding between actors and shapes, so for objects statically combined of multiple shapes we might have to do some trickery. I don't think we'll run in to any such issue though, since most our game objects should be convext shapes anyway.


Suggestions and input always appriciated. Thanks [smile]
July 20, 2006 03:45 AM
sirob
It's been a while since I've touched PhysX (was Novodex back then), but I seem to recall there being a special case handling for terrain/levels. It might have only applied to a heightmap, or something like that, but I do remember it as a special geometry type/object type or something.

Might be worth spending a couple minutes to see if there's something like that still there :).
July 22, 2006 06:21 AM
c2_0
Thanks for the suggestion. They do support a special case for height map meshes, but that wouldn't work for our level.

After rethinking things, being constrained to convex shapes for dynamic objects interacting with the world isn't really an issue for this prototype. I added this to the engine's physics plugin the other day, and just the default all our rigid bodies to be cooked as convex meshes. As long as we keep that in mind, it works just fine [smile]
July 22, 2006 07:32 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Dare finished

990 views

Physical rant

873 views

Half way

1005 views

Dare starts

1023 views

The Team

1060 views

Booting up

982 views
Advertisement