Time to create OctTree SceneNode

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post by Thomaskkc »

CuteAlien wrote:Seems the most time get's lost when you create the triangleselector.
I had the same problem, so i made a triangleselector which does use the octree which is already available for OctreeSceneNodes. The code can be found on http://www.michaelzeilfelder.de/irrlicht.htm
I've currently no time to make a clean patch, so unfortunatly you will have to find out yourself if those files do work with a current version of irrlicht. But i think it won't be much of a problem to fix em if they cause any problems.
that meas to replace that OctTreeSceneNode by COctTreeSceneNode??
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post by Thomaskkc »

is that OctTree.h is create ourself or it include in Irr library?

and CuteAlien

would you explain more about those file in that OctTreeSceneNodeTriangleSelector, coz it include OctTree.h, however there is existed

and is that just use the function in that class?

my original code is

scene::ITriangleSelector* Selector =
smgr->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
node->setTriangleSelector(Selector);

// Add the level's triangle selector to the main collision bucket
m_pMetaSelector->addTriangleSelector(Selector);
Selector->drop();

so is that change to apply the function in COctTreeSceneNodeTriangleSelector??
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

To get my changes running you have to change the irrlicht engine itself. I documented it now some more on my page and i also updated the sources (they had still some profile code in them).

With my version you don't need to create a triangleselector anymore. My class does create a wrapper around the octree which is created anyway for rendering the scenenode. You can access it with scenenode->getTriangleSelector().
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post by Thomaskkc »

but the cpp and h file include "OctTree.h" which doesn't exist
how can i find the OctTree.h??

and do you have any example on how to using your class?
thx~
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

OctTree.h is already part of the Irrlichtengine sources. Like i wrote you have to change the engine itself when you want to use my sources. Once you have done that you can just access the octree which was so far only used for rendering also as triangle selector by calling scenenode->getTriangleSelector(). I didn't programme an octree - i just made a wrapper which give access to the octree which is already available as triangleselector. So you don't need any time to create an new octreeselector which is so slow.

You need to know how to compile the engine yourself. Than just add those files to the engine project and try recompiling it. If it still causes problems you can ask me again :)
The selector itself can be used like all other triangleselectors.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

this triangle selector fix seems very useful, would it be okay to add it into irrlicht?
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post by Thomaskkc »

but the compile said can't find OctTree.h
and the Irr included lib also can't find
so where i can find it?
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

OctTree.h is in the irrlicht source folder. Not in the include folder.
Post Reply