#include <GDynamicGeneratorAgent.cpp>
Collaboration diagram for GBE::GDynamicGeneratorOctreeNode:

| GBE::GDynamicGeneratorOctreeNode::GDynamicGeneratorOctreeNode | ( | QDomElement | data, | |
| unsigned long | rand_seed, | |||
| const GCS::GVector3 & | position, | |||
| double | segment_size | |||
| ) |
Constructor.
| GBE::GDynamicGeneratorOctreeNode::~GDynamicGeneratorOctreeNode | ( | ) |
Destructor, deletes all child nodes.
| bool GBE::GDynamicGeneratorOctreeNode::expandNode | ( | Util::PseudoRNG & | rng | ) |
Creates all 8 child nodes for this octree node.
| rng | specifies the random number generator to use. |
false on out of memory errors.
| GDynamicGeneratorOctreeNode * GBE::GDynamicGeneratorOctreeNode::getChildNodeForPosition | ( | const GCS::GVector3 & | position | ) |
NULL if position is completely outside of this node!
| QList< GDynamicGeneratorOctreeNode * > GBE::GDynamicGeneratorOctreeNode::getChildNodes | ( | ) |
| QList< GDynamicGeneratorOctreeNode * > GBE::GDynamicGeneratorOctreeNode::getChildNodesForArea | ( | const GCS::GVector3 & | position, | |
| double | radius | |||
| ) |
| GVector3 GBE::GDynamicGeneratorOctreeNode::getPosition | ( | ) |
| GVector3 GBE::GDynamicGeneratorOctreeNode::getRandomPositionInCube | ( | Util::PseudoRNG & | rng | ) |
| unsigned long GBE::GDynamicGeneratorOctreeNode::getRandomSeed | ( | ) |
| double GBE::GDynamicGeneratorOctreeNode::getSegmentSize | ( | ) |
| void GBE::GDynamicGeneratorOctreeNode::initFromData | ( | ) |
Reads the random seed from the element data. The random seed is stored in the rs attribute. Additionally all child nodes are initialized from element data as well.
This is the usual procedure when reinitializing an element that is opend - or woken - from the persistent storage.
| bool GBE::GDynamicGeneratorOctreeNode::isAreaInsideNode | ( | const GVector3 & | position, | |
| double | radius | |||
| ) |
| bool GBE::GDynamicGeneratorOctreeNode::isGenerated | ( | ) |
| bool GBE::GDynamicGeneratorOctreeNode::isNodeExpanded | ( | ) |
| bool GBE::GDynamicGeneratorOctreeNode::isPositionInsideNode | ( | const GCS::GVector3 & | position | ) |
| void GBE::GDynamicGeneratorOctreeNode::reduceGenerated | ( | bool | recursive = true |
) |
Reduces all child nodes that have been used for element creation (isGenerated()==true)
| void GBE::GDynamicGeneratorOctreeNode::reduceNode | ( | ) |
Deletes all child nodes.
| void GBE::GDynamicGeneratorOctreeNode::setGenerated | ( | ) |
Sets Generated to true.
| bool GBE::GDynamicGeneratorOctreeNode::touchesArea | ( | const GCS::GVector3 & | position, | |
| double | radius | |||
| ) |
Array of child nodes. Seen FROM positive y: the first four are the first four (mathematical) quadrants and the second four children are the last four quadrants.
QDomElement GBE::GDynamicGeneratorOctreeNode::Data [protected] |
Each octreee node directly has access to its data in the element data document. This makes fast updates easily possible. In particular the element data can be kept in sync with the octree with low overhead.
bool GBE::GDynamicGeneratorOctreeNode::Generated [protected] |
Set to true when this node is an end node and the element for this node has been created. If this node is not an end node but all child nodes have been used for creating elements then this is also set to true.
This means that if Generated is set to true then the whole cubic area this node covers had been generated. Thus it is possible to reduce nodes and save memory. In the end, when the whole element was created, there will be only one node left: the top node, and its Generated attribute will be set to true.
The position relative to the element centre.
unsigned long GBE::GDynamicGeneratorOctreeNode::RandomSeed [protected] |
The RNG seed number for this node. THIS is the actual data we need for child generation at the node's position.
double GBE::GDynamicGeneratorOctreeNode::SegmentSize [protected] |
Segment size of the enclosing cube. This value is both required to generate positions and sizes of child nodes as well as to be able to "randomly" place the created child element somewhere in this cube. If this second functionality were not given, a randomly created element content (=children of one specific element) could look like a grid.
1.4.7