that meas to replace that OctTreeSceneNode by COctTreeSceneNode??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.
Time to create OctTree SceneNode
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??
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??
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().
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().
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.
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.