IrrKlangSceneNode?

Discussion about everything. New games, 3d math, development tips...
Post Reply
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

IrrKlangSceneNode?

Post by Ravi08 »

Hi,

i hav created a scene using irredit where i used the irrklang node to play a sound on my scene.

I loaded the scene and i get this error about the sound node: Could not create scene node of unknown type: irrKlangSceneNode.

I have declared irrklang in my program.

I also thought that there was a problem with irrklang so i loaded the sound using engine->play2D("../media/JetFlyby1.wav"); this worked but the sound is used cause i hav called it not within the scene.

Also i know that some of u will say y dont u just use the play2D way but the thing is in the scene the sound is attached to a plane which is animated to fly over a town and got nothing to do with the game.

PS i know that this question has probably been asked before so thanks, i have looked for an answer but all i could find is somethin to do with IrrKlangSceneNodeFactory but i dont understand wat this is.

THANKS
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

If you are going to deserialize a scene that contains an CIrrKlangSceneNode, then you need to register a CIrrKlangSceneNodeFactory with the scene manager so it knows how to create the scene node. This question has been asked before. To top it off, here is the comment from the top of irrKlangSceneNode.h...

Code: Select all

// This file contains a scene node for the Irrlicht engine which is able to
// play back sounds and music in 3D. Just place it into 3d space and set
// what sound it should play.
// It uses the free irrKlang sound engine (http://www.ambiera.com/irrklang).
// This file also contains a sound engine factory, CIrrKlangSceneNodeFactory. Just 
// register this factory in your scene manager, and you will be able to load and
// save irrKlang scene nodes from and into .irr files:
//
// irrklang::ISoundEngine* soundEngine = createIrrKlangDevice();
// CIrrKlangSceneNodeFactory* factory = new CIrrKlangSceneNodeFactory(soundEngine, sceneManager);
// sceneManager->registerSceneNodeFactory(factory);
// factory->drop();
Travis
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

thanks ill try it
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

i hav a little problem which i dont understand, this is the error message i get:

C:\Documents and Settings\HI\My Documents\irrlicht-1.4\Shooting01\main.o:main.cpp:(.text+0x2f6): undefined reference to `CIrrKlangSceneNodeFactory::CIrrKlangSceneNodeFactory(irrklang::ISoundEngine*, irr::scene::ISceneManager*)'

This is wat i put in my program, at the top #include<irrKlangSceneNode.h>

before the main
irrklang::ISoundEngine* soundEngine = createIrrKlangDevice();

within the main
CIrrKlangSceneNodeFactory* factory = new CIrrKlangSceneNodeFactory(soundEngine, smgr);
smgr->registerSceneNodeFactory(factory);

at the bottom
factory->drop();

Thanks and sorry for wasting ur time
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Did you add the lib to the linker settings? It's not enough to just include the header file, you also have to link the lib to your app. Otherwise it will know the function's names but not actually have the functions.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

yea all linked up, also not sure if this will help but the first time i ran it, the complier also didnt like the #endif at the bottom of irrKlangSceneNode.h but thats gone now just tellin u anyway.
Post Reply