ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > irrEdit
forum topic indicator How to to access nodes loaded from an *.irr file
person icon
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?

person icon
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;


person icon
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/...

person icon
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?

person icon
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:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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