ug4
|
Classes | |
class | BoxedGroupNode |
A group node featuring a bounding box. More... | |
class | CollisionEdgesNode |
holds index pairs defining edges. More... | |
struct | CollisionElementID |
class | CollisionTreeRootNode |
A group node featuring a bounding box and a set of points. More... | |
class | CollisionTrianglesNode |
holds index tuples defining triangles. More... | |
class | GroupNode |
You can group nodes using the GroupNode. More... | |
class | Node |
Nodes serve as base-objects for items of wich a scene-graph consists. More... | |
class | Object |
An Object serves as the base-class for most of the polymorphic node-tree objects. More... | |
class | Traverser |
Derivates of a Traverser can be used to traverse a scenegraph. More... | |
class | Traverser_CollisionTree |
Enhances the Traverser base-class by methods to traverse a collision tree. More... | |
class | Traverser_IntersectFaces |
traverses a node-tree and intersect a given face with the contained geometry. More... | |
class | Traverser_ProjectPoint |
traverses a node-tree and projects a given point to the contained geometry. More... | |
Typedefs | |
typedef SmartPtr< BoxedGroupNode > | SPBoxedGroupNode |
the smartpointer used to encapsulate the node More... | |
typedef SmartPtr< CollisionEdgesNode > | SPCollisionEdgesNode |
the smartpointer used to encapsulate the node More... | |
typedef SmartPtr< CollisionTreeRootNode > | SPCollisionTreeRootNode |
the smartpointer which will be used to encapsulate the node More... | |
typedef SmartPtr< CollisionTrianglesNode > | SPCollisionTrianglesNode |
the smartpointer used to encapsulate the node More... | |
typedef SmartPtr< GroupNode > | SPGroupNode |
the smartpointer used to encapsulate the node More... | |
typedef SmartPtr< Node > | SPNode |
the smartpointer used to encapsulate the node More... | |
Enumerations | |
enum | ObjectCode { OC_INVALID = 0xFFFFFFFF , OC_OBJECT = 0 , OC_NODE = 1 , OC_GROUP_NODE , OC_BOXED_GROUP_NODE , OC_COLLISION_TREE_ROOT_NODE , OC_COLLISION_EDGES_NODE , OC_COLLISION_TRIANGLES_NODE , OC_NODES_END , OC_CUSTOM_OBJECT } |
ids associated with objects. Values shouldn't be unnessesarily high. More... | |
Functions | |
static void | CalculateBoundingBox (vector3 &boxMinOut, vector3 &boxMaxOut, const vector3 *points, const int *inds, size_t numInds) |
static void | CalculateBoundingBox (vector3 &boxMinOut, vector3 &boxMaxOut, const vector3 *points, size_t numPoints) |
SPCollisionTreeRootNode | CreateOctree (vector3 *points, size_t numPoints, int *elemInds, size_t numElemInds, int numIndsPerElem, CollisionElementID *elemIDs, int maxDepth, int elemThreshold, bool bLoose) |
Creates an Octree from a list of elements. More... | |
void | CreateSubOctrees (BoxedGroupNode *parentNode, vector3 *points, size_t numPoints, int *elemInds, size_t numElemInds, int numIndsPerElem, CollisionElementID *elemIDs, int maxDepth, int elemThreshold, bool bLoose) |
Creates sub-trees of an Octree. More... | |
static void | GrowBox (vector3 &minInOut, vector3 &maxInOut, number scaleFac) |
the smartpointer used to encapsulate the node
the smartpointer used to encapsulate the node
the smartpointer which will be used to encapsulate the node
the smartpointer used to encapsulate the node
typedef SmartPtr<GroupNode> ug::node_tree::SPGroupNode |
the smartpointer used to encapsulate the node
typedef SmartPtr<Node> ug::node_tree::SPNode |
the smartpointer used to encapsulate the node
|
static |
calculates the bounding box around a set of elements which are given by a set of indices referencing a set of points. This method is particularily useful if the elements only reference a subset of the given points. If not the bounding box should be calculated directly on the set of points.
Referenced by CreateOctree(), and CreateSubOctrees().
|
static |
calculates the bounding box around a set of points
SPCollisionTreeRootNode ug::node_tree::CreateOctree | ( | vector3 * | points, |
size_t | numPoints, | ||
int * | elemInds, | ||
size_t | numElemInds, | ||
int | numIndsPerElem, | ||
CollisionElementID * | elemIDs, | ||
int | maxDepth, | ||
int | elemThreshold, | ||
bool | bLoose | ||
) |
Creates an Octree from a list of elements.
Given a list of points and a list of element-indices (describing edges or triangles) that reference those points, this method constructs a CollisionTree in the form of an octree and returns the root-node of the tree.
Arrays passed to this method will be copied to the resulting tree and may thus be deleted after the method returned.
points | an array of points which are referenced by the triangleInds. |
numPoints | The number of points in the points array. |
elemInds | Array of indices which reference the points array. 'numIndsPerElem' consecutive indices form an element. Note that the size of elemInds has to be numElemInds. |
numElemInds | The number of elements in the elemInds array. |
numIndsPerElem | The number of points required to describe an element. Please note, that currently only 2 or 3 are supported. |
elemIDs | Array of size numElemInds / numIndsPerElem, that allows to specify an identifier associated with each element in the oct-tree. This parameter may be NULL. |
maxDepth | Maximal depth of the generated trees. |
elemThreshold | The minimal number of elements that leads to an additional refinement of a node. |
bLoose |
References CalculateBoundingBox(), create(), CreateSubOctrees(), SmartPtr< T, FreePolicy >::get(), and GrowBox().
Referenced by ug::AdjustEdgeLength(), and ug::CreateOctree().
void ug::node_tree::CreateSubOctrees | ( | BoxedGroupNode * | parentNode, |
vector3 * | points, | ||
size_t | numPoints, | ||
int * | elemInds, | ||
size_t | numElemInds, | ||
int | numIndsPerElem, | ||
CollisionElementID * | elemIDs, | ||
int | maxDepth, | ||
int | elemThreshold, | ||
bool | bLoose | ||
) |
Creates sub-trees of an Octree.
This method is mostly used internally during oct-tree-construction. Given a list of points and a element-index-list (edges or triangles), it constructs sub-trees of the specified parent-node. This method recursivly calls itself.
Make sure that all passed points lie inside the parent-nodes box.
Arrays passed to this method will be copied to the resulting tree and may thus be deleted after the method returned.
parentNode | The tree-node into which created trees shall be inserted. |
points | an array of points which are referenced by the triangleInds. |
numPoints | The number of points in the points array. |
elemInds | Array of indices which reference the points array. 'numIndsPerElem' consecutive indices form an element. Note that the size of elemInds has to be numElemInds. |
numElemInds | The number of elements in the elemInds array. |
numIndsPerElem | The number of points required to describe an element. Please note, that currently only 2 and 3 are supported. |
elemIDs | Array of size numElemInds / numIndsPerElem, that allows to specify an identifier associated with each element in the oct-tree. This parameter may be NULL. |
maxDepth | Maximal depth of the generated trees. |
elemThreshold | The minimal number of elements that leads to an additional refinement of a node. |
bLoose | if true, elems will be assigned to the box that contains their center. Each element will be assigned to exactly one leaf-node in this case. Note that the bounding-boxes of a loose tree normally overlap each other. |
if false, elems will be assigned to each leaf-node, whose box intersects the element. Each element may be assigned to multiple leaf-nodes in this case. However the boxes of leaf-nodes will not overlap in this case.
References ug::node_tree::GroupNode::add_child(), ug::BoxBoundProbe(), CalculateBoundingBox(), create(), SmartPtr< T, FreePolicy >::get(), GrowBox(), ug::LineBoxIntersection(), ug::node_tree::BoxedGroupNode::max_corner(), ug::node_tree::BoxedGroupNode::min_corner(), ug::MathVector< N, T >::size(), ug::TriangleBoxIntersection(), ug::VecAdd(), and ug::VecScale().
Referenced by CreateOctree().
|
static |
Increases the size of the bounding box by scaling around its center
References ug::VecAdd(), ug::VecScale(), and ug::VecSubtract().
Referenced by CreateOctree(), and CreateSubOctrees().