Drag[en]gine Script Module DragonScript Script API  1.0
Octree Class Referenceabstract
Inheritance diagram for Octree:
DefaultOctree

Classes

enum  eOctants
 

Public Member Functions

bool containsBox (Vector boxCenter, Vector boxHalfSize)
 
bool containsPoint (Vector point)
 
Octree createOctree (int octant)
 
void dispose ()
 
Octree findNodeAtBox (Vector boxCenter, Vector boxHalfSize)
 
Octree findNodeAtPoint (Vector point)
 
int findOctantAtBox (Vector boxCenter, Vector boxHalfSize)
 
int findOctantAtPoint (Vector point)
 
Vector getCenter ()
 
Vector getHalfSize ()
 
Octree getNodeAt (int index)
 
Octree getNodeAtBox (Vector boxCenter, Vector boxHalfSize)
 
Octree getParent ()
 
Octree new (Vector center, Vector halfSize)
 
Octree searchTreeForBox (Vector boxCenter, Vector boxHalfSize)
 
Octree searchTreeForPoint (Vector point)
 
void setNodeAt (int index, Octree node)
 
void setParent (Octree parent)
 

Public Attributes

final int MAX_DEPTH = 8
 

Detailed Description

Extendible octree implementation. The class has to be subclassed to provide the required behavior like content management and creation of new nodes.

Author
Roland Pl├╝ss
Version
1.0

Member Function Documentation

§ containsBox()

bool containsBox ( Vector  boxCenter,
Vector  boxHalfSize 
)

Determines if the box is located completely in this node.

§ containsPoint()

bool containsPoint ( Vector  point)

Determines if the point is located in this node.

§ createOctree()

Octree createOctree ( int  octant)

Creates new octree for the specified octant. Implement this function to create a new octree of your own type. Do not set the parent of octree. The caller is responsible for this action if applicable.

§ dispose()

void dispose ( )

Disposes of the octree freeing all cross references.

§ findNodeAtBox()

Octree findNodeAtBox ( Vector  boxCenter,
Vector  boxHalfSize 
)

Looks for the child node in which the box lies. If found the node is returned. If no node could be found null or the node does not exist yet null is returned.

§ findNodeAtPoint()

Octree findNodeAtPoint ( Vector  point)

Looks for the child node in which the point lies. If found the node is returned. If no node could be found null or the node does not exist yet null is returned.

§ findOctantAtBox()

int findOctantAtBox ( Vector  boxCenter,
Vector  boxHalfSize 
)

Looks for the octant in which the element lies. Returns OCTANT_NOT_FOUND if no octant fully contains the element.

§ findOctantAtPoint()

int findOctantAtPoint ( Vector  point)

Looks for the octant in which the point lies.

§ getCenter()

Vector getCenter ( )

Retrieves the center of the node.

§ getHalfSize()

Vector getHalfSize ( )

Retrieves the half size of the node.

§ getNodeAt()

Octree getNodeAt ( int  index)

Retrieves one of the 8 child nodes. This is null if there exists no such node yet. You can use either an index from 0 to 7 inclusive or use one of the the OCTANT_* constants.

§ getNodeAtBox()

Octree getNodeAtBox ( Vector  boxCenter,
Vector  boxHalfSize 
)

Looks for the child node in which the given box lies. If the child node does not yet exist it is created. If found the node is returned. If no node could be found null is returned.

§ getParent()

Octree getParent ( )

Retrieves the parent of the octree or null if this is the root.

§ new()

Octree new ( Vector  center,
Vector  halfSize 
)

Creates a new Octree covering the given sub space. The eigth sub-nodes are initially empty.

§ searchTreeForBox()

Octree searchTreeForBox ( Vector  boxCenter,
Vector  boxHalfSize 
)

Searches for the Node containing a given box.

§ searchTreeForPoint()

Octree searchTreeForPoint ( Vector  point)

Searches for the Node where the given point lies in.

§ setNodeAt()

void setNodeAt ( int  index,
Octree  node 
)

Sets one of the eight child nodes. You can use either an index from 0 to 7 inclusive or use one of the the OCTANT_* constants. Node can be null to remove the child node.

§ setParent()

void setParent ( Octree  parent)

Sets the parent of the octree or null if this is the root.

Member Data Documentation

§ MAX_DEPTH

final int MAX_DEPTH = 8

Max depth.


The documentation for this class was generated from the following file: