• Create Account

### #Actualbelfegor

Posted 17 December 2012 - 04:26 PM

What to do with an object that is split by one or more grid planes?

That is not a problem at all, I'll put it in both cubes, and then when i iterate over octree i just set a flag to visible for that object. No harm done doing it multiple times.

this:
octree->process(camera.frustum);
...// more work here
...
...
...
...
drawAll()
if(object[i].visible)
object[i].draw()

there is no redundant drawing only redundant copies of pointers.

The problem is that there is something wrong with my code for creating cubes.

### #2belfegor

Posted 17 December 2012 - 04:25 PM

What to do with an object that is split by one or more grid planes?

That is not a problem at all, I'll put it in both cubes, and then when i iterate over octree i just set a flag to visible for that object. No harm done doing it multiple times.

this:
octree->process(camera.frustum);
...// more work here
...
...
...
...
drawAll()
if(object[i].visible)
object[i].draw()

there is no redundant drawing only redundant copies of pointers.

The problem is that there is something wrong with my code for creating cubes.

### #1belfegor

Posted 17 December 2012 - 04:25 PM

What to do with an object that is split by one or more grid planes?

That is not a problem at all, I'll put it in both cubes, and then when i iterate over octree i just set a flag to visible for that object. No harm done doing it multiple times.

this:
octree->process(camera.frustum);
...// more work here
...
...
...
...
drawAll()
if(object[i].visible)
draw()

there is no redundant drawing only redundant copies of pointers.

The problem is that there is something wrong with my code for creating cubes.

PARTNERS