How to compare the scene node type?

Discussion about Irrlicht's Java wrapper
Post Reply
johnrico2000
Posts: 6
Joined: Fri Aug 29, 2008 10:16 pm

How to compare the scene node type?

Post by johnrico2000 »

Hi everyone

This is my second day taking a closer look on Jirr and it really fascinates me. It's preety cool so far.

Unfortunately I have come to a point that got me stuck.

I have been loading an irredit scene from an .irr file and would like to set camera collision processing on the loaded meshes now.
I'm orienting myself on the code seen in this thread (http://irrlicht3d.de/forum2/viewtopic.php?f=1&t=724) to recursivly add collision handlers for the meshes of the loaded irredit scene.

My problem is that there a several spots in the C++ code I cannot transfer into the Jirr Java world.

In the code you find things like these:

Code: Select all

if (node->getType() == scene::ESNT_MESH) {...}
or

Code: Select all

if (node->getType() == scene::ESNT_ANIMATED_MESH) {...}
or

Code: Select all

if (node->getType() == scene::ESNT_TERRAIN) {...}
to check the type of a scene node. Depending on that type you possibly have to define different collision handlers on that node.
I have tried really hard, but haven't found a way to transfer the displayed if-statements into Jirr Java code (with Jirr Enumerations for example).

Could someone please advice what to do in order to achieve the semantics of the condinitional expressions above. I would be really grateful for replies and I'm sure this is interesting not only for me.

Regards
Frank
jirr
Posts: 36
Joined: Sat Feb 19, 2005 8:05 am

Post by jirr »

Hi Frank,
currently node.getType() returns a swig-pointer instead of an usable java object. Will have a look at this for jirr 1.4.

Big sorry for the meantime.

By the way: a workaround for the moment would be managing the node types within java structures if possible (e.g. using a Hashtable etc.).
jirr
Posts: 36
Joined: Sat Feb 19, 2005 8:05 am

Post by jirr »

Just to let you know my current results:

Fixed it by patching irrlicht includes. So as far as I can say I could release a new version shortly after the release of irrlicht 1.4.2+. Due to the opengl bug in irrlicht at least on ati cards there will be no new jirr version before that one will be released since I own and test on ati cards only.

Thank you for your appreciation.
johnrico2000
Posts: 6
Joined: Fri Aug 29, 2008 10:16 pm

Post by johnrico2000 »

Hi

Thank you very much for your support!

I'm looking forward to the new Jirr release. But maybe due to lack of patience I will try your ingenious suggestion concerning using Hashmaps!

Regards
Frank
jirr
Posts: 36
Joined: Sat Feb 19, 2005 8:05 am

Post by jirr »

For your information: current release of jirr 1.4.2 is planned for the end of this month.
Post Reply