Deji
03-03-2009 14:31:01
So far NxOgre has been a huge step forward for our project, however I have been having problems trying to apply a trianglemesh from a loaded nxs file.
The .nxs is created with flour and stored in our models directory. Plan is to use this for a large static object in our scene. (Using NxOgre 1.0(Bleeding))
The following is part of a function to replace the default BodyShape with a triangle mesh. For example m_Robot->setNewTriangleMesh("file://../../media/models/robot.nxs","Robot")
Just for completeness;
It just doesn't seem to load any mesh data (I may be doing something wrong ) however I also get a couple of warnings converting the ogre mesh into a nxs. This is using flour 0.3.2. It does however produce a 5.8Kb .nxs file from the ogre Robot.
Any comments / abuse about my code would be great at this point Thanks
The .nxs is created with flour and stored in our models directory. Plan is to use this for a large static object in our scene. (Using NxOgre 1.0(Bleeding))
The following is part of a function to replace the default BodyShape with a triangle mesh. For example m_Robot->setNewTriangleMesh("file://../../media/models/robot.nxs","Robot")
void WorldEntity::setNewTriangleMesh(string _filelocation,string _name){
//Name the mesh ie RobotMesh
string meshName;
meshName = (_name+"Mesh");
NxOgre::Resources::ResourceSystem* rSystem = NxOgre::Resources::ResourceSystem::getSingleton();
//Add the mesh from provided file location
rSystem->addMeshAs((NxOgre::Resources::ResourceIdentifier)_filelocation,meshName);
//Get a pointer to the mesh by name and create a new TriangleMesh
NxOgre::Resources::Mesh* tempMesh = rSystem->getMesh(meshName);
NxOgre::TriangleMesh* newShape = new NxOgre::TriangleMesh(tempMesh);
//Add the new shape in place of the base shape
setNewBodyShape(newShape);
}
Just for completeness;
void WorldEntity::setNewBodyShape(NxOgre::Shape * _Shape){
//HM - need to perform actions in this order (physX gets upset if a body has no shapes)
m_Body->addShape(_Shape);
m_Body->removeShape(m_BaseShape);
m_BaseShape = _Shape;
}
It just doesn't seem to load any mesh data (I may be doing something wrong ) however I also get a couple of warnings converting the ogre mesh into a nxs. This is using flour 0.3.2. It does however produce a 5.8Kb .nxs file from the ogre Robot.
PhysX ERROR! NXE_DB_WARNING (f:/file path..../RegistryHardwareSelection.cpp:71) CUDA not available
Any comments / abuse about my code would be great at this point Thanks