i want to add stuff to a terrain and take advanatage of the quad tree culling. is there a way to do this without manually looking for the right terrainblock?
What exactly do you want to 'add' to the terrain?
blood and body parts:
they are added to the rootnode right now
Is there a problem with them being in the root node? Besides, the terrain is a TriMesh, not a node, so you can't really add anything to it anyway.
I believe he wants objects on the terrain to be culled away at the same time as the terrain.
@fan: grmpfh…i want it to be a node. i demand it. no wait, it's enough if the terrainpage is a node, because the last terrainpage could contain my trees.
@seysayux: yes, you are right.
What about making a class that implements both the stuff from terrainpage and node? (make sure it extends terrainpage and not node, since you'll have to attach it to your terrain handler or whatever – I don't use heightmap based terrain)
is there a way to do this without manually looking for the right terrainblock?
The answer is no.
You would need to modify TerrainPage so that it finds the right block for a location. Looking at the source, I think the findQuadrant method in TerrainPage could help.
Also you could try using bounding volumes of the page and find the block which collided with your tree's location.