|
OpenMW
|
A node in the quad tree for our terrain. Depending on LOD, a node can either choose to render itself in one batch (merging its children), or delegate the render process to its children, rendering each child in at least one batch. More...
#include <quadtreenode.hpp>
Public Member Functions | |
| QuadTreeNode (World *terrain, ChildDirection dir, float size, const Ogre::Vector2 ¢er, QuadTreeNode *parent) | |
| ~QuadTreeNode () | |
| void | setVisible (bool visible) |
| void | applyMaterials () |
| Rebuild all materials. | |
| void | initNeighbours () |
| Initialize neighbours - do this after the quadtree is built. | |
| void | initAabb () |
| void | createChild (ChildDirection id, float size, const Ogre::Vector2 ¢er) |
| void | markAsDummy () |
| bool | isDummy () |
| QuadTreeNode * | getParent () |
| Ogre::SceneNode * | getSceneNode () |
| int | getSize () |
| Ogre::Vector2 | getCenter () |
| bool | hasChildren () |
| QuadTreeNode * | getChild (ChildDirection dir) |
| QuadTreeNode * | getNeighbour (Direction dir) |
| Get neighbour node in this direction. | |
| ChildDirection | getDirection () |
| Returns our direction relative to the parent node, or Root if we are the root node. | |
| void | setBoundingBox (const Ogre::AxisAlignedBox &box) |
| const Ogre::AxisAlignedBox & | getBoundingBox () |
| Get bounding box in local coordinates. | |
| World * | getTerrain () |
| void | update (const Ogre::Vector3 &cameraPos, Loading::Listener *loadingListener) |
| Adjust LODs for the given camera position, possibly splitting up chunks or merging them. | |
| void | updateIndexBuffers () |
| void | destroyChunks (bool children) |
| Destroy chunks rendered by this node *and* its children (if param is true) | |
| size_t | getNativeLodLevel () |
| size_t | getActualLodLevel () |
| Get the effective current LOD level used by the chunk rendering this node. | |
| bool | hasChunk () |
| Is this node currently configured to render itself? | |
| void | prepareForCompositeMap (Ogre::TRect< float > area) |
Private Member Functions | |
| void | ensureLayerInfo () |
| void | ensureCompositeMap () |
Private Attributes | |
| MaterialGenerator * | mMaterialGenerator |
| bool | mIsActive |
| bool | mIsDummy |
| float | mSize |
| size_t | mLodLevel |
| Ogre::AxisAlignedBox | mBounds |
| Ogre::AxisAlignedBox | mWorldBounds |
| ChildDirection | mDirection |
| Ogre::Vector2 | mCenter |
| Ogre::SceneNode * | mSceneNode |
| QuadTreeNode * | mParent |
| QuadTreeNode * | mChildren [4] |
| QuadTreeNode * | mNeighbours [4] |
| Chunk * | mChunk |
| World * | mTerrain |
| Ogre::TexturePtr | mCompositeMap |
A node in the quad tree for our terrain. Depending on LOD, a node can either choose to render itself in one batch (merging its children), or delegate the render process to its children, rendering each child in at least one batch.
| QuadTreeNode::QuadTreeNode | ( | World * | terrain, |
| ChildDirection | dir, | ||
| float | size, | ||
| const Ogre::Vector2 & | center, | ||
| QuadTreeNode * | parent | ||
| ) |
| terrain | |
| dir | relative to parent, or Root if we are the root node |
| size | size (in *cell* units!) |
| center | center (in *cell* units!) |
| parent | parent node |
| void QuadTreeNode::applyMaterials | ( | ) |
Rebuild all materials.
| void QuadTreeNode::createChild | ( | ChildDirection | id, |
| float | size, | ||
| const Ogre::Vector2 & | center | ||
| ) |
| void QuadTreeNode::destroyChunks | ( | bool | children | ) |
Destroy chunks rendered by this node *and* its children (if param is true)
| void QuadTreeNode::ensureCompositeMap | ( | ) | [private] |
| void QuadTreeNode::ensureLayerInfo | ( | ) | [private] |
| size_t QuadTreeNode::getActualLodLevel | ( | ) |
Get the effective current LOD level used by the chunk rendering this node.
| const Ogre::AxisAlignedBox & QuadTreeNode::getBoundingBox | ( | void | ) |
Get bounding box in local coordinates.
| Ogre::Vector2 Terrain::QuadTreeNode::getCenter | ( | ) | [inline] |
| QuadTreeNode* Terrain::QuadTreeNode::getChild | ( | ChildDirection | dir | ) | [inline] |
| ChildDirection Terrain::QuadTreeNode::getDirection | ( | ) | [inline] |
Returns our direction relative to the parent node, or Root if we are the root node.
| size_t Terrain::QuadTreeNode::getNativeLodLevel | ( | ) | [inline] |
Get the effective LOD level if this node was rendered in one chunk with ESM::Land::LAND_SIZE^2 vertices
Get neighbour node in this direction.
| QuadTreeNode* Terrain::QuadTreeNode::getParent | ( | ) | [inline] |
| Ogre::SceneNode* Terrain::QuadTreeNode::getSceneNode | ( | ) | [inline] |
| int Terrain::QuadTreeNode::getSize | ( | ) | [inline] |
| World* Terrain::QuadTreeNode::getTerrain | ( | ) | [inline] |
| bool Terrain::QuadTreeNode::hasChildren | ( | ) | [inline] |
| bool QuadTreeNode::hasChunk | ( | ) |
Is this node currently configured to render itself?
| void QuadTreeNode::initAabb | ( | ) |
Initialize bounding boxes of non-leafs by merging children bounding boxes. Do this after the quadtree is built - note that leaf bounding boxes need to be set first via setBoundingBox!
| void QuadTreeNode::initNeighbours | ( | ) |
Initialize neighbours - do this after the quadtree is built.
| bool Terrain::QuadTreeNode::isDummy | ( | ) | [inline] |
| void Terrain::QuadTreeNode::markAsDummy | ( | ) | [inline] |
Mark this node as a dummy node. This can happen if the terrain size isn't a power of two. For the QuadTree to work, we need to round the size up to a power of two, which means we'll end up with empty nodes that don't actually render anything.
| void QuadTreeNode::prepareForCompositeMap | ( | Ogre::TRect< float > | area | ) |
Add a textured quad to a specific 2d area in the composite map scenemanager. Only nodes with size <= 1 can be rendered with alpha blending, so larger nodes will simply call this method on their children.
| area | area in image space to put the quad |
| quads | collect quads here so they can be deleted later |
| void QuadTreeNode::setBoundingBox | ( | const Ogre::AxisAlignedBox & | box | ) |
Set bounding box in local coordinates. Should be done at load time for leaf nodes. Other nodes can merge AABB of child nodes.
| void QuadTreeNode::setVisible | ( | bool | visible | ) |
| void QuadTreeNode::update | ( | const Ogre::Vector3 & | cameraPos, |
| Loading::Listener * | loadingListener | ||
| ) |
Adjust LODs for the given camera position, possibly splitting up chunks or merging them.
| void QuadTreeNode::updateIndexBuffers | ( | ) |
Adjust index buffers of chunks to stitch together chunks of different LOD, so that cracks are avoided. Call after QuadTreeNode::update!
Ogre::AxisAlignedBox Terrain::QuadTreeNode::mBounds [private] |
Ogre::Vector2 Terrain::QuadTreeNode::mCenter [private] |
QuadTreeNode* Terrain::QuadTreeNode::mChildren[4] [private] |
Chunk* Terrain::QuadTreeNode::mChunk [private] |
Ogre::TexturePtr Terrain::QuadTreeNode::mCompositeMap [private] |
bool Terrain::QuadTreeNode::mIsActive [private] |
Is this node (or any of its child nodes) currently configured to render itself? (only relevant when distant land is disabled, otherwise whole terrain is always rendered)
bool Terrain::QuadTreeNode::mIsDummy [private] |
size_t Terrain::QuadTreeNode::mLodLevel [private] |
QuadTreeNode* Terrain::QuadTreeNode::mNeighbours[4] [private] |
QuadTreeNode* Terrain::QuadTreeNode::mParent [private] |
Ogre::SceneNode* Terrain::QuadTreeNode::mSceneNode [private] |
float Terrain::QuadTreeNode::mSize [private] |
World* Terrain::QuadTreeNode::mTerrain [private] |
Ogre::AxisAlignedBox Terrain::QuadTreeNode::mWorldBounds [private] |
1.7.6.1