Trimesh collision?

BlasterN

01-07-2006 01:03:47

I have a question/request.

Is it available trimesh collision??
I searched in the forum and find 6 post anyone related with NxOgre.

betajaen

01-07-2006 08:28:54

I have a question/request.

Is it available trimesh collision??
I searched in the forum and find 6 post anyone related with NxOgre.


Do you mean is there tri-mesh collision against primitives then yes, if you mean tri-mesh against tri-mesh then no; You'd use a convex shape or more than one shape organised into a group.

This is mentioned in the PhysX SDK and many times on the NxOgre.org website.

BlasterN

01-07-2006 15:09:05

So if I want trimesh collision aganist other trimesh I must write a Ogre::Mesh To convexShape?

betajaen

01-07-2006 18:42:45

So if I want trimesh collision aganist other trimesh I must write a Ogre::Mesh To convexShape?

If you want to, but if your mesh is very complicated you should break it down into primitives and organise them into a group of shapes. It is a lot faster that way.

I've also split your post from the Preview 4 topic as it's not related to it.

BlasterN

02-07-2006 02:01:15

ok, np.

The problem to split it into a basic shapes is that It's a huge MAP, for test purpose I'm using a HL2 map.

What do you thing it would be the best way to make a MAP collision mesh?

betajaen

02-07-2006 10:06:05

Oh right. If it's a map then you'd use a meshShape in a static body.

Some how if you can convert the HL2 map into a Ogre Mesh so it can be read by the meshShape it should work (assuming you don't use shared vertices - PhysX is really picky about that).

If you want to use a meshShape in a dynamic body however; it's best not to. You'd use either a convex or a mixture of convex and other shapes in a shapeGroup to make up a rough version of the collision model. But if you do it well enough, nobody will know except for you. :wink:

To sum it up: meshShapes are only used for maps, or other complicated things that never move and shouldn't be used in dynamic bodies.

BlasterN

02-07-2006 17:32:57

I madre a MAP (q3 & HL type) To Mesh. Take each triangle and made a submesh so no shared vertices. I did it because it deal better with Ogre::StaticGeometry, that require all in triangles. (see this: http://www.ogre3d.org/phpBB2/viewtopic. ... ometry+gta )

I think I can start to code now.

One more question.
NxOgre support ray collision with animated meshes or I have to use OgreOpcode ?
I used OgreOpcode in the past for a little shooter game (like Time Crisis), but i want to remove unnecesary libs from the core.

betajaen

02-07-2006 17:58:14

If that is the map you intend to use, I'd cut down the amount of triangles by at least half or at least split it into separate blocks and page them in and out when needed, because PhysX would cry if it handled that.

As for animated meshes, NxOgre doesn't support them. But if you use OpCode then PhysX/NxOgre won't know about it so again it can't support them.

anear

03-07-2006 15:14:30

Can I use meshShape for a kinematic body which is controlled by a tracking sensor? Will collisions between this kinematic meshShape and primitive shapes work?


To sum it up: meshShapes are only used for maps, or other complicated things that never move and shouldn't be used in dynamic bodies.

betajaen

03-07-2006 17:07:12

I assume it would work, but Kinematic bodies if you don't know what they are don't follow standard laws of physics, basically you tell them there to go, and they go there. adding a mesh shape into the mix would be possible, I can just see the computer going all crazy of the calculations.

What type of body you want to model is so complicated that a mix of bodies or a convex shape can't satisfy?

anear

03-07-2006 17:30:21

Thanks for your reply, betajaen. It's not that my model is too complex to break down, but I don't know how to do it :( Is there any tool for breaking down complex mesh into primitives and convex mesh?

I've just posted a question on "Artists & Content Creators" forum
http://www.ogre3d.org/phpBB2/viewtopic.php?t=22029

I've tried this: in Novodex if you define a concave mesh as convex, it will fill the concave part and convert it to a convex obj. If I don't want to lose shape details, I have to partition it before doing this.

I know it's not the proper forum to discuss this. Shall I break complex objects into primitives manually in modelling s/w (I'm using 3dsMax)?


What type of body you want to model is so complicated that a mix of bodies or a convex shape can't satisfy?

betajaen

03-07-2006 18:41:05

How I do it is this:

- I load up the mesh
- Then using the primatives, I get say a cube then scale it (and rotate it if needed), to match a certain part of the mesh. Then continue on until the entire mesh is loaded.
- Then write down all of the primatives; sizes, positions, and rotations
- Then convert it into code.

It does take it's time, but unless I wrote a program to help you along with it. But I cannot see how code could work it out by itself, thats venturing into artificial intelligence and really complicated code there.

BlasterN

03-07-2006 23:51:25

I post the reply in the artist forum. and yes, the solution is really complicated, but not imposible.

@betajaen
Cool solution for models but not for maps. And not to diffucult to do.

betajaen

03-07-2006 23:52:35



@betajaen
Cool solution for models but not for maps. And not to diffucult to do.


That's why you would use a meshShape ;)