how to use ISceneManager::registerSceneNodeFactory() ?
how to use ISceneManager::registerSceneNodeFactory() ?
i want to register irrklangScenenode
how to use this command i ask niko for this
http://www.ambiera.com/cgi-bin/forum/Bl ... 182924476/
________
Free gift cards
how to use this command i ask niko for this
http://www.ambiera.com/cgi-bin/forum/Bl ... 182924476/
________
Free gift cards
Last edited by koller202 on Thu Feb 17, 2011 1:10 am, edited 1 time in total.
You need to create an instance of a class derived from ISceneNodeFactory and pass a pointer to it to the scene manager. Like so...
Travis
Code: Select all
audio::ISoundEngine* engine = audio::createIrrKlangDevice();
ISceneNodeFactory* factory = new audio::CIrrKlangSceneNodeFactory(engine, smgr);
smgr->registerSceneNodeFactory(factory);
factory->drop();
Code: Select all
ISoundEngine* engine = createIrrKlangDevice();
// audio::ISoundEngine* engine = audio::createIrrKlangDevice();
ISceneNodeFactory* factory = new CIrrKlangSceneNodeFactory(engine, smgr);
smgr->registerSceneNodeFactory(factory);
factory->drop();
smgr->loadScene("../../media/sound.irr");
but i have one more question
in irredit i heard 3d sound ( far decrease sound )
but load irr in irricht i heard 2d sound
irredit can put 3d sound ?
________
MACUMBA DICUSSION
Last edited by koller202 on Thu Feb 17, 2011 1:10 am, edited 1 time in total.
oh i can do it
put in main update loop
thank you
________
Cocaine Rehab Forum
Code: Select all
engine->setListenerPosition(core::vector3df(camera->getAbsolutePosition().X,camera->getAbsolutePosition().Y,camera->getAbsolutePosition().Z), core::vector3df(camera->getAbsolutePosition().X,camera->getAbsolutePosition().Y,camera->getAbsolutePosition().Z));
thank you
________
Cocaine Rehab Forum
Last edited by koller202 on Thu Feb 17, 2011 1:10 am, edited 1 time in total.
You might look at the sound listener and sound emitter nodes that I posted a while back. At the very least you might want to look at the listener node.
It automatically updated the listener 3d position as it moved around the scene. You would need to update it to work with Irrlicht 1.3.1 and write your own factory class, but that would be trivial.
Travis.
It automatically updated the listener 3d position as it moved around the scene. You would need to update it to work with Irrlicht 1.3.1 and write your own factory class, but that would be trivial.
Travis.
I am also using the CIrrKlangSceneNodeFactory.
I am using this code:
And am getting this error:
1>.\irrlichtdev.cpp(167) : error C2259: 'CIrrKlangSceneNodeFactory': Instanz von abstrakter Klasse kann nicht erstellt werden
In english: Instance of abstract class cannot be created.
Any suggestions?
________
Video Reviews
I am using this code:
Code: Select all
//Initialize Sound Factory to load sound in level
ISceneNodeFactory* soundfactory = new CIrrKlangSceneNodeFactory(engine, smgr);
smgr->registerSceneNodeFactory(soundfactory);
soundfactory->drop();
1>.\irrlichtdev.cpp(167) : error C2259: 'CIrrKlangSceneNodeFactory': Instanz von abstrakter Klasse kann nicht erstellt werden
In english: Instance of abstract class cannot be created.
Any suggestions?
________
Video Reviews
Last edited by plotti on Tue Feb 22, 2011 8:14 am, edited 1 time in total.
If I remember correctly, the error message should describe the problem in more detail.
The error is probably because the signature [name, parameter types, or return type] of one ore more member function of the base class has changed in Irrlicht and it needs to be updated in the IrrKlangSceneNodeFactory code.
Yes, that it it. Here is the declaration for scene node factories in Irrlicht...
Here are the functions implemented by the CIrrKlangSceneNodeFactory derived class.
You need to update the IrrKlang code to match the Irrlicht declarations.
Travis
The error is probably because the signature [name, parameter types, or return type] of one ore more member function of the base class has changed in Irrlicht and it needs to be updated in the IrrKlangSceneNodeFactory code.
Yes, that it it. Here is the declaration for scene node factories in Irrlicht...
Code: Select all
virtual ISceneNode* addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent=0);
virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0);
virtual u32 getCreatableSceneNodeTypeCount() const;
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const;
virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const;
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const;
Code: Select all
virtual ISceneNode* addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent=0);
virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0);
virtual s32 getCreatableSceneNodeTypeCount();
virtual const c8* getCreateableSceneNodeTypeName(s32 idx);
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(s32 idx);
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type);
Travis
hi vitek thanks a lot for your help.
I updated the information and it compiled.
Another problem I have now I changed one line in the implementation:
which was:
before since I am using the CSoundEmitterSceneNode and CSoundListenerNode implementation.
As far as I see i need to somehow get that sound attached to the soundengine or something...
It seems the Constructor of the irrKlangSceneNode is alreade pre-setting the values:
So I guess I have to pre-set them too, although for exmaple the min and max distance somehow should be present in the soundnote, and not set again to some default values.
EDIT: Sorry my fault. The IrrKlangSceneNode has those serialize functions and deserialize to read in the parameters etc...
I wonder how I can bring those two into the CSoundEmitterSoundNode thing?
ANOTHER EDIT: I think I will simply include those two, since they seem to be for different purposes, somehow. With one I can load the sounds from the map and with the other I can attach sounds to things during execution time.
________
Yamaha Mio History
I updated the information and it compiled.
Another problem I have now I changed one line in the implementation:
Code: Select all
ISceneNode* CIrrKlangSceneNodeFactory::addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent)
{
if (!parent)
parent = Manager->getRootSceneNode();
if (type == IRRKLANG_SCENE_NODE_ID)
{
CSoundEmitterSceneNode* emitter = new CSoundEmitterSceneNode(parent, Manager, -1);
node->drop();
return node;
}
return 0;
}
Code: Select all
CIrrKlangSceneNode* node = new CIrrKlangSceneNode(SoundEngine, parent, Manager, -1);
As far as I see i need to somehow get that sound attached to the soundengine or something...
It seems the Constructor of the irrKlangSceneNode is alreade pre-setting the values:
Code: Select all
setAutomaticCulling(scene::EAC_OFF);
MinDistance = 20.0f; // a usual good value for irrlicht engine applications
MaxDistance = -1.0f;
PlayMode = EPM_RANDOM;
TimeMsDelayFinished = 0;
DeleteWhenFinished = false;
MaxTimeMsInterval = 5000;
MinTimeMsInterval = 1000;
Sound = 0;
PlayedCount = 0;
if (SoundEngine)
SoundEngine->grab();
EDIT: Sorry my fault. The IrrKlangSceneNode has those serialize functions and deserialize to read in the parameters etc...
I wonder how I can bring those two into the CSoundEmitterSoundNode thing?
ANOTHER EDIT: I think I will simply include those two, since they seem to be for different purposes, somehow. With one I can load the sounds from the map and with the other I can attach sounds to things during execution time.
________
Yamaha Mio History
Last edited by plotti on Tue Feb 22, 2011 8:14 am, edited 1 time in total.
The code I wrote is different than what niko wrote. The sound emitter scene node doesn't use the sound engine, so it doesn't need a pointer to it. You, as the application developer, will use the engine to create audio::ISound instances. You then associate those sounds with the sound emitter scene node.
As for setting the defaults, you would need to setup the sound before you create the scene node, so most of them don't matter.
If you have any intention of using irrEdit to make scenes or serialize your scenes, I suggest you use the IrrKlangSceneNode stuff that niko provides. If you need the sound listener scene node functionality, you can easily add it to work with niko's code.
Travis
As for setting the defaults, you would need to setup the sound before you create the scene node, so most of them don't matter.
If you have any intention of using irrEdit to make scenes or serialize your scenes, I suggest you use the IrrKlangSceneNode stuff that niko provides. If you need the sound listener scene node functionality, you can easily add it to work with niko's code.
Travis
-
- Posts: 98
- Joined: Fri Oct 03, 2008 1:25 pm
- Location: UK
- Contact:
Where does derive from?
Is it custom or built into the irrklang?, I tried to open the first topics link but it's void now so I can only imagine it's to do with that links code as I can't can't seem to find audio anywere and dont know where it's derived from, and because of that I can run this code.
Thus I can't create an irrKlangSceneNode, can someone please clarify it for me.
Code: Select all
audio
Is it custom or built into the irrklang?, I tried to open the first topics link but it's void now so I can only imagine it's to do with that links code as I can't can't seem to find audio anywere and dont know where it's derived from, and because of that I can run this code.
Code: Select all
audio:: //...
-System error
-
- Posts: 98
- Joined: Fri Oct 03, 2008 1:25 pm
- Location: UK
- Contact:
BUMP*
So I can' uset :
etc because I don't know where CIrrKlangSceneNodeFactory is derived from, help please.
So I can' uset :
Code: Select all
CIrrKlangSceneNodeFactory(engine, smgr);CIrrKlangSceneNodeFactory(engine, smgr);
-System error
That code doesn't do anything on its own. The namespace audio used to be where the IrrKlang scene node and scene node factory were. Those declarations do not seem to be in a namespace anymore, so you can remove the audio:: mention from the code posted above.
Oh, and it wouldn't hurt to take some time to get familliar with C++.
Travis
Oh, and it wouldn't hurt to take some time to get familliar with C++.
Travis
-
- Posts: 98
- Joined: Fri Oct 03, 2008 1:25 pm
- Location: UK
- Contact:
My C, C++ knowledge is fine thanks \: it's this part of the API i'm strugling with, perhaps you mis-understood me:
I have used the code:
And I get this error:
I hope their is an alternative.
I have used the code:
Code: Select all
//Initialize Sound Factory to load sound in level
scene::ISceneNodeFactory* soundfactory = new CIrrKlangSceneNodeFactory(engine, smgr);
smgr->registerSceneNodeFactory(soundfactory);
soundfactory->drop();
Thus, 'CIrrKlangSceneNodeFactory' can not be found in any classes (namespace isn't their like you said) etc, that's were I'm having the trouble and can't find a replacement... should I just create my own that takes an argument if the irrklang engine initialization/definition and scene manager?1>.\Main.cpp(327) : error C2061: syntax error : identifier 'CIrrKlangSceneNodeFactory'
I hope their is an alternative.
-System error
Then why would you expect to get such a compiler error? Perhaps the type CIrrKlangSceneNodeFactory hasn't been declared? Did you include the appropriate header file?Systemerror wrote:My C, C++ knowledge is fine thanks \:
You're proposing you add your own declaration for the type? I don't know why you think that would be a good idea.Systemerror wrote:Thus, 'CIrrKlangSceneNodeFactory' can not be found in any classes (namespace isn't their like you said) etc, that's were I'm having the trouble and can't find a replacement... should I just create my own that takes an argument if the irrklang engine initialization/definition and scene manager?
If the type CIrrKlangSceneNodeFactory isn't declared in any of the headers you have, perhaps you should find the header (and source) that declares (and defines) the type. I'd guess that the best place to look would be here.
Travis
-
- Posts: 98
- Joined: Fri Oct 03, 2008 1:25 pm
- Location: UK
- Contact: