Irrlicht frustration.

Alright, some of you may have guessed that this is by far the largest project I have attempted with irrlicht. Well as of late that has been showing. I was planning on creating a proxy class for the fps camera so I could automatically update the listener location in openal.

However I hit a snag when I realized that it was actually just a normal camera with a animator attached to it. I also hit another snag when I realized I couldn't just create my own contreat scene nodes and insert them into the scene.

For one the contreat types of the other classes aren't even accessable using the development headers. There aren't any for the C classes only the I classes with few exceptions. I also couldn't find an insert scene node function that actually took a scene node. I found one that takes the name of a type but again it wants to control every part of the scene nodes life cycle. And as my new type would be unknown to the engine this presents a bit of a problem.

So I was thinking hey I'll just attach the animator to both classes so I'll at least get the updates like a want. That is all I really cared about anyway.

Well I struck out again. I got around the fact that I couldn't create and instance of the animator by just grabbing a reference to the fps cameras animator. Then attached that to my proxy class which isn't really a proxy class anymore.

But it never got called. I throw in a few cout calls in the functions to confirm. Later I opened up the fps animator cpp file to see why it my be ignoring it. As it turns out it has a function that is called that passes in a scene node. In this case it was getting the camera. Then it iterates through the animator list and works it's magic. So somehow the program flow works in the opposite order I would expect. Or seems too I haven't dug into the source all that far and I don't plan too.

One of my project goals was to avoid reinventing the wheel. I'm sure the developers have a reason for it working like this so I'll just role with it because for the most part it is really easy to use. As long as I don't try to do anything tricky I should be ok.

So in the end I just ended up updating the listener position every frame. This may or may not be the best way to do it but it works so I'm happy.

The question will be how will this all work out when I go to do sound sources. I don't need to worry about sound sources that don't move but moving sources will be a pain. Plus I need a way to tell my engine where to place sounds when it loads a file. if I could simply use a custom scenenode type it would work great but who knows if that will work.

Oh well each day enough troubles of it's own.

Comments

Popular posts from this blog

VK9 - Milestone8 Completed

VK9 - Milestone13 Completed

VK9 - Milestone16 Completed