Hard to solve: Custom SceneNode and Jirr (Java Binding)

Discussion about Irrlicht's Java wrapper
Post Reply
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Hard to solve: Custom SceneNode and Jirr (Java Binding)

Post by cr_itm »

Hello,

currently, I'm working with Jirr, the Java Binding for Irrlicht. I presume, not many people got experience with Jirr (most of you propably use Irrlicht with C++).

Here is a problem, an experienced Irrlicht user may have a solution for (I hope so):

I want to create my own cutom scene node. I created a class, that is almost the same as a CMeshSceneNode class (just with java syntax). Now I do the following:

Code: Select all

SimMeshNode node = new SimMeshNode( mesh, scene.getRootSceneNode(), scene, -1, new vector3df(0, 50.0f, 0), new vector3df(0, 0, 0), new vector3df(1.0f, 1.0f, 1.0f) );
Where "scene" is my SceneManager. When I start my program, it crashes with a weird error, something with "error in irrlicht.dll" and a lot of hex adresses. I don't post any error log because I'm sure no one can get any useful information out of it.

My idea why the code doesn't work is the following: CSceneManager is in the source a class derived from ISceneManager _and_ ISceneNode, so a CSceneManager _is_ also an ISceneNode.

I think in Jirr, this is not the case. In the code above, I use "scene.getRootSceneNode()", and when you have a look at the Irrlicht source code, "getRootSceneNode" returns "this", and "this" is the CSceneManager class, and so a ISceneNode.

I think the problem is (why my program crashes), that in Jirr, I get the Scenemanager with "device.getSceneManager();", it returns an object of type "ISceneManager". But that object ist _not_ a ISceneNode! You get the problem?

When I do "scene.getRootSceneNode()" when I create my own custom SceneNode, the parameter should be an ISceneNode, but it is not. So the Irrlicht code can't run correctly, and the whole thing crashes.


So, when you do have _any_ ideas how I may use my custom SceneNode in Jirr (even when the idea is crazy), that would ne great :)

Honestly, I don't believe I get a response from someone, who uses Jirr, are there any people? :) So please, any response is welcome :)
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

Can't say I'm too familiar with JIrr, but I am with Irrlicht. Have you overloaded the onPreRender function? I think that one was essential for proper overloading of scene node classes ( I could be wrong ). But if that were the case, I assure you it would cause a crash the first time a scene started to render.
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Post by cr_itm »

Thanks for the answer, yes I overloaded the onPreRender. As I said, my class is exactly the CMeshSceneNode.cpp, but in Java syntax.

With the Debugger, I could examine the line, where the crash occurs. It is the

registerNodeForRendering( this, E_SCENE_NODE_RENDER_PASS.ESNRP_SOLID );

line in OnPreRender(). When I comment the line out, the program does not crash, but the scene node is not visible/does not exist in the scene graph perhaps.

Meanwhile, I almost accepted the fact, that I apparently am not able to use my own custom scenenodes with Irrlicht in Java :(

Any ideas are welcome... please! :?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Just so you don't feel alone, i use jIrr too, you could try posting this on the jIrr forum aswell if you havn't already, but it's an Irrlicht based error i think so stefan won't be able to help you a huge amount possibly.

As for me i'm afraid i can't help you either, i don't know all that stuff about custom scene nodes and messing around with the pre and post render stuff.
Image Image Image
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Post by cr_itm »

JP wrote:Just so you don't feel alone, i use jIrr too, you could try posting this on the jIrr forum aswell if you havn't already,
Thanks, now I dont feel alone anymore :)
I haven't posted it on the Jirr forums, so far I thought the Jirr forum isn't well visited.
Post Reply