Compound Shapes

Bajter

06-07-2008 16:54:05

Hello,
On my way to create a glorious and monumental application I encountered an humongeous problem!
I want to create an shape consisting of three other shapes (so, a compound shape) , and make it appear as one actor (as I want it to behave like one actor, without any glitches)
The problem is - I can't find a solution to the problem above, even though people are writing (on this forums here!) about using that method. (no way how to do it, though)

I think that after seeing this image here, you will get the idea of what I want to do (I wasn't able to move my shapes to form one actor, which is a bit strange for me)



// And if I may ask a small offtopic question :)
How are the works on scythe-like application for nxOgre going, Betajaen?
I tried using scythe, but it seems a bit bugged, plus I just can't find a way to export created things into nxOgre format ^^ (and samples from scythe for physx are connected with newton engine, but thats completly another thing :D)

Gohla

06-07-2008 18:12:02

Use flour to create a triangle (static only) or convex mesh from an Ogre mesh:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6900

Search for triangle or convex on this forum for on info how to implement and use these shapes.

Bajter

06-07-2008 18:26:19

Thanks Gohla, but I already used flour :)
But I need this shape to be both dynamic and not-convex (so I can keep the walls, if I use convex for this mesh, I get a simple... Box)
That's why Im talking about mixing shapes :)
I just don't have any idea how to connect (for example) three boxes into one body. That's my problem, and reason for calling this topic 'compound shapes' (maybe thats better explanation of it :) )
PS. Thanks again for the last response, it was one of most useful things I found on this forums :D

betajaen

06-07-2008 18:30:32

It's called a CompoundShape in NxOgre Bleeding. You add the shapes normally how you would with an Actor to the CompoundShape, then pass on the CompoundShape to the Actor as a shape.

CompoundShape* cs = new CompoundShape();
cs->add(new Cube(3, 0.5, 1, "offset: 0 -0.05 0"));
cs->add(new Cube(0.05, 0.1, 0.5, "offset: 1.26 0.25 0"));
cs->add(new Cube(0.05, 0.1, 0.5, "offset: -1.26 0.25 0"));

mActor = mScene->createActor("test", cs, Vector3(0, 10, 0), "mass: 10");


Easy. :D

Bajter

06-07-2008 19:16:11

Wow.
I haven't even realised there is such thing! ^^
Now it's really easy :D

// What about my second question? :)
// And a documentation showing things like this one, would be really appreciated ^^ Im sure that at least me and my group would appreciate it :)

betajaen

06-07-2008 19:54:54

I haven't heard from the person who was kind enough to take on producing a Scythe importer in a while. But I'm sure he's working on it in his spare time.

I'm working on the documentation though; I've taken on an apprentice who is/will be tidying up my English on the NxOgre.org wiki, I'm also redesigning the software to allow user accounts so anyone can contribute.

Bajter

06-07-2008 21:43:26

That's a message that made me happy after day of hard work :)
Thanks, Betajaen. (and thanks to your apprentice, I'm sure you are both going to make life easier for all the humanity! :D )
(Oh, and BTW. I had your own scythe-like application in mind :) )