Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrEdit
How to to access nodes loaded from an *.irr file

dreamwalker
Registered User
Quote
2013-09-25 22:28:37

Hi,

Yeah as the title states, if I load an "example.irr" file that has, lets say a cube, animated node etc how can I access that within my code so I can use it? or is that not possible?


dreamwalker
Registered User
Quote
2013-09-25 23:04:04

Something along the lines of:

 smgr->loadScene("media/test.irr");

// create the reader using one of the factory functions
irr::io::IrrXMLReader* xml = createIrrXMLReader("media/test.irr");
if (xml == 0)
return 0; // file could not be opened

const char* terrain = xml->getAttributeValue("terrain");

delete xml;



niko
Moderator
Quote
2013-09-26 09:31:31

The loadScene() function loads all the stuff into your scene. So you will have all the nodes already loaded and transformed into real, 3d objects in the scene manager. You can access a single node for example by name, using

irr::scene::ISceneNode* node = sceneManager->getSceneNodeFromName("terrain");

see here: http://irrlicht.sourceforge.net/...


dreamwalker
Registered User
Quote
2013-09-29 09:38:31

For some reason I haven't been able to access by NAME, but via ID and that was through casting, ie:

[code=cpp]scene::ISceneNode * viking1 = static_cast<scene::ISceneNode*>(smgr->getSceneNodeFromId(21));[/code]

While we are on the topic, do you know how I can access an IrrKlangSceneNode the same way?


niko
Moderator
Quote
2013-09-30 21:36:42

Ah, at least. :) I've written it here: http://www.ambiera.com/forum.php...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact