Accessing to each material/mesh after loading...

ahmadi

26-03-2006 15:07:00

After loading a scene how can i access to each material?
for example i want that after some event i make all material without texture filtering. it mean that i want make my scene high quality.
for example(my pseudo code):

oScene.initialise("file4.osm", &oe_Callback);
// create and setup the scene in the root node
oScene.createScene();
for(i=0;i<oScene.mat.count;i++)
oScene.mat[i].quality=highquality;


also i need to access each mesh position and bound . because maybe i need to check that my player is near of one of my object or no?
for example(my pseudo code):

oScene.initialise("file4.osm", &oe_Callback);
// create and setup the scene in the root node
oScene.createScene();
for(i=0;i<oScene.meshobject.count;i++)
mybound=oScene.meshobject[i].getbound;

Thanks for anyhelp.

Lioric

26-03-2006 19:09:33

For the entity (or other objects) positions, you can use the "getXList" methods of the oScene object


CameraList& getCameraList(void);
LightList& getLightList(void);
EntityList& getEntityList(void);


See the OgreOSMScene.h file for more details

After you get the entity list, you can parse it and get the materials of each entity to set the needed settings

ahmadi

27-03-2006 14:33:37

For the entity (or other objects) positions, you can use the "getXList" methods of the oScene object


CameraList& getCameraList(void);
LightList& getLightList(void);
EntityList& getEntityList(void);


See the OgreOSMScene.h file for more details

After you get the entity list, you can parse it and get the materials of each entity to set the needed settings

i can not find getXList, also
sorry for my request but if its possible please give me a example code or at least a pseudo code.

manowar

27-03-2006 15:45:32

I have not tested this code but it should work. This code prints the name of all the entities in your osm scene.

oScene is your osm scene loaded before

OSMScene::EntityList::iterator it;
OSMScene::EntityList eList = oScene.getEntityList();
for(it = eList.begin();it != eList.end() ; ++it)
{
std::cout << "Entity Name: " << (*it)->getName() << std::endl;
}

It is something really simple using an iterator.

Eric