Page 1 of 1

.Net Custom Scene Node

Posted: Sun Jul 16, 2006 9:11 pm
by mg_mchenry
One thing that is holding me back from using Irrlicht is that I really prefer to work with a managed language, specifically C#, and using a non-native .Net library can cause a lot of friction.

Part of the reason I'm looking for a native .Net engine is that I'm almost certain I want custom scene nodes, I really prefer C#, and my C++ is a little rusty.

When I looked at Irrlicht before (version 0.12), it seemed to me that I would have to write a custom scene node in C++. Over the last 30 minutes or so, I decided to check this - it couldn't be that hard, right? Well, the Irrlicht.Net.Scene.ISceneNode class is just a wrapper around the C++ version. In fact, the single parameter to the ISceneNode constructor is a irr::scene::ISceneNode* named realSceneNode.

This means in order to have a .Net scene node, you have to have a C++ scene node for it to wrap. This means to have a custom .Net scene node, I would have to create a a DotNetSceneNodeWrapper class in C++ that implements irr::scene::ISceneNode and take a .Net custom scene node in it's constructor.

Sure, I can make it so something like:
sceneManager.AddCustomDotNetSceneNode(new MySceneNode() ) works.

But first, the .Net custom SceneNode would be created, then passed to the scenemanager to be wrapped in a new Irrlicht::Scene::CustomDotNetSceneNodeProxy so it could be added to the scene. Maybe that's not so bad.

Later the SceneManager calls OnPreRender for all the scene nodes.
you'd have irr::scene::ISceneNode overriden by Irrlicht::Scene"::CustomDotNetSceneNodeProxy (written in C++)
CustomDotNetSceneNodeProxy->OnPreRender() would call the underlying CustomDotNetSceneNode (written in C#) OnPreRender code.

That's not as many layers of indirection as I had worried about, but it still seems like it would have to move between managed and unmanaged code far too often.

And it still seems like a bad idea to try to implement a custom scene node in C#.

What do you guys think? Has anyone ever proposed a .Net native port of Irrlicht? I've probably put too much thought into this already without searching the forums.

search button :-)

Posted: Tue Jul 18, 2006 6:30 pm
by buhatkj
http://irrlichtsharp.sourceforge.net/wi ... /Main_Page
that is a c# port of irrlicht, which has been being developed for some time, but I am not sure how complete it is yet. I don't think it is really usable yet at this time.
also, DeusXL has created a better .NET wrapper
http://irrlicht.sourceforge.net/phpBB2/ ... 9&start=15
though I don't know if that would allow inheriting or creating custom nodes yet or not.

I agree that the inability to create custom nodes is a big limitation.

Posted: Tue Jul 18, 2006 7:47 pm
by DeusXL
For now, Irrlicht .NET CP only allows to create Particle affectors and emitters but on the future, I'll try to implement every possibilities such as SceneNodes or MeshLoaders !

Thanks

Posted: Wed Jul 19, 2006 1:51 am
by mg_mchenry
Thanks for the tips guys.

I'm certain I'm going to stick with an all-managed and open source engine for now.

I checked out Irrlicht#, and it has a way to go before it will be usefull. Ironically, I think I'm better off with a less ambitious library. My immediate goal is to make a pong game. My long-term goal involves real-time procedural planet generation.

I don't think Irrlicht will help me much with either, so I'm off to build from the ground up.

unless I end up using RetinaX, that is.

HADDD

Posted: Wed Jul 19, 2006 2:17 am
by buhatkj
check out HADDD also. its a pure c# directx engine with a lot of features.
http://www.funmangames.com/haddd/index. ... &idioma=uk

Posted: Wed Jul 19, 2006 12:17 pm
by mg_mchenry
I will be looking into HADDD once the source is released.

Unfortunately, I don't have PS 2.0. I thought I did well when I bought my Ti 4200 (having VS 1.1), but the DX 9 cards came out shortly after. Looking forward to an upgrade...

I bought my daughter a 5200FX thining that it would support 2.0, although slowly, but I haven't gotten a single 2.0 demo to run on it so far.

Posted: Wed Jul 19, 2006 3:44 pm
by sh1ny
5200-5700 series are so bad they arent worth the money at all. If you want a good equivalent ( yea im an nvidia fan too but im a money fan also ) get an ATi 9550 gamer edition and get the omega drivers for it to become a 9600 Pro :) For the money you give it's more than good :)