OctTreeSceneNode - Advantagades/disadvantages?

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.
Post Reply
[DEF]
Posts: 17
Joined: Thu Jul 29, 2010 8:30 am

OctTreeSceneNode - Advantagades/disadvantages?

Post by [DEF] »

Hi all,

I'm thinking of using an OctTreeSceneNode in my project, used for very large terrain. The way I have the terrain set up is; The world is split into "chunks" and within each chunk there are 16x16x16 voxels, so this means the terrain is destructable (by manipulating voxels), so I'm wondering:

1. When I need to regenerate the terrain (when I add / remove a voxel), I'll need to update the whole OctTreeSceneNode mesh, correct? There's no easy way to just add / remove certain vertices?

2. Would this be easier with multiple OctTreeSceneNodes, for each chunk, or some 'group' of chunks (i.e 3 chunks in a node)? Obviuosly the chunk(s) the player(s) are currently in will need to be seperate, for quick updating. So would just using an IMeshSceneNode be enough? I'm assuming so.

Thanks in advance! :D
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Yes, I think currently the whole octree would have to be recalculated. I suppose in your situation I would most likely try to write my own triangle-selector (a quad-tree or a grid data structure are maybe more effective when it comes to floor triangle-selectors). Or look around in other collision libraries like those coming with most physic-engines (which you usually add anyway sooner or later).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
[DEF]
Posts: 17
Joined: Thu Jul 29, 2010 8:30 am

Post by [DEF] »

Ah cool, thanks for that. I was looking for a quick way to do LOD, but recalculating all the vertices it each time the terrain changes would defeat the purpose :P yeah looks like I'll have to try setting up ROAM or chunked LOD (chunked may be better considering my world is already in chunks). But thanks again for the insight! :D
Post Reply