[help] 0.9 howto create a CubeShape! And findBody ?

tsky

15-05-2007 22:02:32

Hi,

i want to know if this new way is correct to create a shape :


// create material
Ogre::String strMatName = Ogre::String("mat_" + strName);
NxOgre::Material *pMaterial = new NxOgre::Material(strMatName, m_pNxOgreSceneRef);
pMaterial->setAll(fElasticity, fDynamicFriction, fStaticFriction);

// set pose
NxOgre::ShapeParams pShapeParam;
pShapeParam.mOrientation = shapePoseParent.getQuat();
pShapeParam.mMaterial = strMatName;

// create shape
NxOgre::CubeShape *pCubeShape = new NxOgre::CubeShape(width, height, length, pShapeParam);
if (pCubeShape != NULL) {
if (fMass > 0) {
pCubeShape->mShapeDescription.mass = fMass;
}
}


It compiles but if it works...

At this moment i couldn´t try it because of the next question:

Is the NxOgre::Scene::findBody() method deleted intentional ?

tom

betajaen

15-05-2007 22:14:48

Materials not implemented in shapes yet so I can't show that code yet, but this is more efficient and "NxOgrey":

new CubeShape(width,height,length, "orientation:" + Ogre::StringConverter::toString(shapePoseParen.getQuat()))


Also, NxOgre has a rule - You "new" it, you "delete" it.