[Bloody Mess] trigger volume is not correct in Tutorial 4

kaneyxt

29-04-2009 04:47:36

I set up Bloody Mess with Ogre 1.6.1 and PhysX 2.8.1, then I try to run the tutorials of Bloody Mess.
When I go to the 4th tutorial: http://www.ogre3d.org/wiki/index.php/Bl ... Tutorial_4. I just copy all the code and run. But I find there is some problems with the trigger volume. Seems the trigger volume is not created successfully. Instead, there is a static box there (I see the static box in Remote Debugger). So the small dynamic box will fall on the static box and stay still there. The trigger callback function will never be called.

Does anyone meet the same problem with me? I will investigate it if I have time...

kaneyxt

29-04-2009 07:00:02

Well, I debug this problem a little bit. Seems the shape flag NX_TRIGGER_ENABLE is not set anywhere. So when we create a rigid body volume, it is always a static one, not a trigger shape at all.
Then I add the following code after line 138 of NxOgreRigidBody.cpp:
if (prototype->mType == Enums::RigidBodyType_Volume)desc.shapeFlags |= NX_TRIGGER_ENABLE;
(Note: as in this Tutorial, only box trigger shape is used, I only make change to the box shape. To make it work for other shapes, you need to change the code accordingly.)
After this change, I can create the trigger shape, and the funciton PhysXCallback::onTrigger() will be called. But this function crashes because the volumeBody and collisionBody are always NULL. I am not sure why the NxOgre can not find the correct RigidBody. And for the input parameters of onTrigger() function, the triggerShape and collisionShape are the same! This is really a strange problem!

I have no time to debug further. But this problem seems to be a global issue for the whole trigger system...
Any comments, guys?

spacegaier

29-04-2009 08:34:08

Ahh...yes. It worked in 1.5.2, but not with 1.5.3. Already told that betajaen and I think he even fixed it in the next release.

dzL

29-04-2009 18:53:38

Hello

been struggling with this problem for for a while, didn't know what was really happening, i thought i was doing something wrong..

So, is there a any way to correct this? Should i change Bloody Mess version, or there is a update coming up soon?

Sorry if i'm asking twice, but i really didn't get you meant by this "Already told that betajaen and I think he even fixed it in the next release."

@betajaen: thanks for NxOgre, its amazingly simple and well done.
@spacegaier: thanks for the tutorials, they are really helpful! please make more :P

Best regards

betajaen

29-04-2009 19:08:24

He meant, that he found out the triggers wasn't working, and I found the cause and made a fix. However, I'm still working on the next release which this fix is in.

kaneyxt

30-04-2009 02:37:58

Thanks, betajaen, but I just would like to know when the new version will be ready.
You know, I am considering to use NxOgre in my project. Or will you suggest me to use an ealier version?

Another question is for softbody, are you planning to support this feature in NxOgre? I know this will be much more difficult than rigid body, especially for the tearable softbody. I have implemented tearable softbody support in Unreal Engine 3, it costs other two engineers and me more than two months. However, we spend much time to fight with UE3's massive rendering system and data transformation. I think it would be easier to implement this with Ogre. If you would like to do this, we can have further discussion.

Anyway, NxOgre is really a good way to integrate PhysX into Ogre, good work, man!

He meant, that he found out the triggers wasn't working, and I found the cause and made a fix. However, I'm still working on the next release which this fix is in.

betajaen

30-04-2009 09:51:52

I've had some success in implementing it in previous versions, and in BloodyMess some of the classes required (Renderable/OGRE3DRenderable) are already there. In many cases it's just the same as implementing cloth.

kaneyxt

04-05-2009 07:14:08

Yes, in most cases, softbody is similar to cloth. Actually, in the low level, softbody and cloth are implemented by the same class - deformable object. That's why they have similar APIs. The biggest difference is that: softbody has two meshes, one triangle mesh for its rendering surface, one tetrahedron mesh for its physics simulation. In PhysX's samples, you can find how to update the rendering mesh by tetrahedron mesh.
However, when we would like to use tearable softbody, it is not that straight forward. When a big force is applied to the tetrahedron mesh, and the mesh gets torn. The rendering triangle mesh need to be torn accordingly. Some triangles along the tearing line need to be collapsed. And inside the torn surface, we need to add triangles dynamically to keep the surface mesh as a closed-maniford one. To implement this in UE3, we create two hash stacks for the triangle-tetrahedron reference. Find all the torn tetrahedrons, collapse all the triangles interact with them. Then generate new triangles along the out-surface of the tetrahedrons, and merge them together with original surface mesh.
I am interested in how you implement softbody in Ogre, will you please tell me which version you have it and where can I get it? Do you implement tearable support for softbody? Or for cloth? Thanks!