About “.nxs” question

btx2397

22-07-2011 09:50:07

hi everyone,i have a problem like this. i used flour 0.4.7 make my owns triangle .nxs file. i load this file is ok but when i call getMeshData() ,it crash .......i try and try. and i find if i use the barrel.nxs file inside Nxogre.zip .everything go well. so i want to know is the ".nxs" maked by flour 0.4.7 can't call getMeshData(). here is my code
CreateStaticGeomtery(const Ogre::String &iFileName,Ogre::Vector3&iPos,Ogre::Quaternion& iQuate,Ogre::Vector3 &iScale)
{

NxOgre::Mesh* tPlaypenMesh=NULL;
SceneGeometry* tScene_geom=NULL;
TriangleGeometryDescription tGeomDes;
if (NxOgre::MeshManager::getSingleton()->hasMesh(iFileName.c_str()))
{
tPlaypenMesh=NxOgre::MeshManager::getSingleton()->getByName(iFileName.c_str());
}
else
{
Ogre::String iFilePah="ogre://General/";
iFilePah+=iFileName;
iFilePah+=".nxs";
tPlaypenMesh=NxOgre::MeshManager::getSingleton()->load(iFilePah.c_str(), iFileName.c_str());


}
if (tPlaypenMesh!=NULL)
{

NxOgre::MeshData* tData=tPlaypenMesh->getMeshData(); //crash here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NxOgre::ManualMesh m(tData);
for (unsigned int i=0;i < m.nbVertices();i++)
m.scaleVertex(i, Vec3(iScale.x,iScale.y,iScale.z) );
NxOgre::Mesh* myNewScaledMesh = m.end();


NxOgre::Vec3 iNxPos=iPos;
NxOgre::Quat iNxQuate=iQuate;
tGeomDes.mMesh=myNewScaledMesh;
tGeomDes.mGroup=Walls;
tScene_geom = mSceneMgr->createSceneGeometry(tGeomDes, NxOgre::Matrix44(iNxPos,iNxQuate));
mSceneGeomList.push_back(tScene_geom);
delete tData;
return tScene_geom;
}
else
{
return NULL;
}
}

Terry

22-07-2011 15:31:40

Hi

Not sure what you are tring to do are you trying to cook a perticular Ogre mesh ??