Compound Shape ?

Amnuriak

12-10-2009 13:28:59

Hi there,

I was just trying to get an actor with several distinct shapes to work but I stumbled upon one little problem: when pushing the shapes into an NxOgre::Array<NxOgre::Shape*> I need to position them in some way or they will overlap. Now how would I do this since there is nothing like a setPosition() method on NxOgre::Shape.

I searched the forum and found this topic dealing with multi shaped actors. That's exactly what I want and I was really glad ... until I saw there is no NxOgre::CompoundShape class anymore - at least not in the version I compiled. I grepped the whole sdk include directory but I only got one hit in NxOgreCommon.h
enum ShapeFlags
{
ShapeFlags_Visualisation = (1<<3), //!< \brief Allow a visualation of this shape in the VisualDebugger.
ShapeFlags_NoCollision = (1<<4), //!< \brief Use only with Compound Shapes, ...


Now this looks like there was this NxOgre::CompoundShape class, since it's even mentioned in the source code documentation. But I'm too blind to find it.... can someone please show me where I didn't look ?

Thanks,
Amnu

Karan

12-10-2009 13:39:35

You can use Shape::setLocalPose() or ShapeBlueprint::mLocalPose for positioning (the Shape constructors take a ShapeBlueprint as the last parameter).

betajaen

12-10-2009 13:56:25

CompoundShape is now called "Shapes" which is a simple container class, You'll see all Actor/Body/KinematicActor/SceneGeometries, etc. all have two create methods. One for Shape* (Singular) and one for Shapes& (Compound).

As for localpose - You set it via the Blueprint for each shape.

Amnuriak

12-10-2009 14:19:08

So setLocalPose() also sets the position not only the "direction/orientation" ? I find the name somewhat misleading. Also, I have to admit I don't know how to work with these matrices. If I remember correctly they are used to transform the object inside their coordinate system - but which row/coloumn corresponds to which axis and so forth is beyond my memory. Is there a tutorial for this ? (sry for the OT question)

betajaen

12-10-2009 15:12:20

Sets both, yes.

There is a setTranslation and setOrientation functions for Matrix44s, that uses Vectors and Quaternions if they suit you more.

Amnuriak

16-10-2009 09:25:12

Hm, where are those functions ? I grepped the whole sdk but could not find them. I'm using the version from Git (though I also grepped the Bloody Mess' sources without success).

Edit:
Never mind, you were talking about the Matr44s constructor overloads I suppose. Thanks :-)