pjcast
13-06-2006 01:45:44
First, I want to say good job on the bindings! I was able to grab the precompiled bindings for VS8, and have Ogre in my Winform's app in less then half an hour.
However, I did not build OgreDotNet myself, so i don't really have the source to step into. I was hoping maybe someone would show me what I am doing wrong, or have an idea of what is wring.
Anyway, I'm trying to iterate over the nodes in the Ogre scenegraph (for an editor, to build a treeview). I can get the rootscenenode, and then grab the iteratr. However, using the hasMoreElement() method causes an instant crash with no exception information or anything. So, i tried working around that, and using the getNext(0 method, however, it only ever returns bad references, and eventually causes a crash.
Here is my code:
I am using the standard startup stuff as in the demos right now (my app works if I do not traverse the iterator). I am using Visual Studio 8 Standard, and the latestet OgreDotNet bindings for VC8 + Dagon 1.2 SDK. As you can see, I should have a few scenenodes to travers through. Any ideas of why I'm crashing with this? Has anyone else used this iterator with no troubles?
However, I did not build OgreDotNet myself, so i don't really have the source to step into. I was hoping maybe someone would show me what I am doing wrong, or have an idea of what is wring.
Anyway, I'm trying to iterate over the nodes in the Ogre scenegraph (for an editor, to build a treeview). I can get the rootscenenode, and then grab the iteratr. However, using the hasMoreElement() method causes an instant crash with no exception information or anything. So, i tried working around that, and using the getNext(0 method, however, it only ever returns bad references, and eventually causes a crash.
Here is my code:
mOgreContainer.mSceneManager.RootSceneNode.CreateChildSceneNode(new Math3D.Vector3(0.0f, 6.5f, -67.0f)).AttachObject(mParticleSystem);
mOgreContainer.mSceneManager.RootSceneNode.CreateChildSceneNode("Test1");
mOgreContainer.mSceneManager.RootSceneNode.CreateChildSceneNode("Test2");
Node rootNode = mOgreContainer.mSceneManager.GetRootSceneNode();
ChildNodeIteratorWrap children = rootNode.GetChildIterator();
Node nextNode = null;
while (children.hasMoreElements())
{
nextNode = children.getNext();
}
I am using the standard startup stuff as in the demos right now (my app works if I do not traverse the iterator). I am using Visual Studio 8 Standard, and the latestet OgreDotNet bindings for VC8 + Dagon 1.2 SDK. As you can see, I should have a few scenenodes to travers through. Any ideas of why I'm crashing with this? Has anyone else used this iterator with no troubles?