gmz1982
14-02-2009 18:23:56
Hi,
I would like to create a multi-shaped actor / body but with the code below I can only see the "mainshape" working.
I assume I do it in the wrong way or the createBody method doesn't use the shapes from the shapes I added to the actorparams.
What did I miss? How else can it be done?
Any help would be appreciated!
Thanks in advance!
I would like to create a multi-shaped actor / body but with the code below I can only see the "mainshape" working.
NxActorDesc actorDesc;
NxBodyDesc bodyDesc;
NxBoxShapeDesc bDesc1;
NxBoxShapeDesc bDesc2;
bDesc1.dimensions.set(50,10,50);
bDesc1.localPose.t = NxVec3(0,50,0);
actorDesc.shapes.pushBack(&bDesc1);
bDesc2.dimensions.set(10,50,10);
bDesc2.localPose.t = NxVec3(0,0,0);
actorDesc.shapes.pushBack(&bDesc2);
bDesc2.mass = 3.0;
bDesc2.mass = 3.0;
actorDesc.body = &bodyDesc;
actorDesc.density = 1.0;
actorDesc.globalPose.t = NxVec3(300,100,100);
NxOgre::ActorParams ap;
ap.setToDefault();
ap.fromNxActorDesc( actorDesc );
NxOgre::Shape* mainshape = new NxOgre::Cube(60);
NxOgre::NodeRenderableParams nrp;
nrp.setToDefault();
nrp.mIdentifierUsage = NxOgre::NodeRenderableParams::IU_Use;
nrp.mIdentifier = object->node->getName();
Ogre::String bodyname = "Body_" + Ogre::StringConverter::toString( newID );
object->PX_body = PXScene->createBody( bodyname, mainshape, Vector3(0,200,0), nrp, ap );
I assume I do it in the wrong way or the createBody method doesn't use the shapes from the shapes I added to the actorparams.
What did I miss? How else can it be done?
Any help would be appreciated!
Thanks in advance!