Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Ok irredit looks really nice and the lightining system is pretty cool so i thought it might be a good leveleditor. But the problem is when loading an irredit file directly with irrlicht it simply loads all scenenodes without providing acces to the meshdata or pointers to specific nodes. that is a problem because my gameengine uses an entity system in which every scenenode is linked to an entity.(for interaction and stuff like that) And honestly i don't want to write a write my own .irr loader....so my question is if there is some interface in development for this or is there already one? PS: if there is no other way than writing my own parser could u guide me a place where i find the full irr-format specs |
||||
|
After you have loaded the scene, you can easily access the scene graph and access your nodes and meshes. You can either use the name of the scene node or the id for this. Take a look at getSceneNodeFromId() and getSceneNodeFromName(). Based on the type of a scene node (getType()) you can then access the mesh for example. |
||||
|
really? i remember that i couldn'T acces the mesh from a scenenode.....many things changed i guess....i should upgrade to a newer version of irrlicht...lol thanks for ur help niko |
||||
|
Hi, Vitek helped me a lot with this. I define the static mesh (buildings and other non-moving things that I want in my level as OCCTREE) Then I load my IRRscene. After loading I can process the entine scene graphs. Most of the codes where provided By Vitek, And I adapted it to my need. First you define that procedure I've defined this globally first: IrrlichtDevice *intro = 0; Then this procedure that will parse the node tree (Thanks to Vitek) [code]void recursiveFillMetaSelector(scene::ISceneNode* node, scene::IMetaTriangleSelector* meta ) { // // the following if is basically the same as ISceneNode_assignTriangleSelector // printf ("Node name is: %s \n",node->getName()); printf ("Node id is: %d \n",node->getID()); printf ("Node type:"); // printf ("Node type: %s=",smgr->getSceneNodeTypeName()); if (node->getType() == ESNT_UNKNOWN) printf("Unknown mesh type \n\n"); if (node->getType() == ESNT_MESH) printf("Standard Mesh \n\n"); if (node->getType() == ESNT_ANIMATED_MESH) printf("Animated Mesh! \n\n"); if (node->getType() == ESNT_SKY_BOX) printf("SkyBox! \n\n"); if (node->getType() == ESNT_CAMERA_FPS) printf("Fps Camera! \n\n"); if (node->getType() == ESNT_CAMERA_MAYA ) printf("Maya Camera! \n\n"); if (node->getType() == ESNT_CAMERA ) { printf("STD Camera! \n"); printf ("The current position of this camera is: %f,%f,%f\n\n",node->getPosition().X,node->getPosition().Y,node->getPosition().Z); camera->setPosition(node->getPosition()); } if (node->getType() == ESNT_PARTICLE_SYSTEM ) printf("Particles! \n\n"); if (node->getType() == ESNT_LIGHT ) printf("Light! \n\n"); if (node->getType() == ESNT_OCT_TREE) { // Occ Trees are for land printf("Occtree! \n"); io::IAttributes* attribs = intro->getFileSystem()->createEmptyAttributes(); if (attribs) {// get the mesh name out node->serializeAttributes(attribs); core::stringc name = attribs->getAttributeAsString("Mesh"); attribs->drop(); // get the animated mesh for the object scene::IAnimatedMesh* mesh = smgr->getMesh(name.c_str()); if (mesh) { scene::ITriangleSelector* selector = smgr->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128); node->setTriangleSelector(selector); &n |
||||
|
|