PixelLightAPI  .
Public Member Functions
PLMath::Quadtree Class Reference

Quadtree. More...

#include <Quadtree.h>

List of all members.

Public Member Functions

PLMATH_API Quadtree ()
 Constructor.
virtual PLMATH_API ~Quadtree ()
 Destructor.
PLMATH_API void Init (PLCore::uint32 nXOffset=0, PLCore::uint32 nYOffset=0, PLCore::uint32 nXSize=0, PLCore::uint32 nYSize=0, Quadtree *pParent=nullptr)
 Initializes the quadtree.
PLMATH_API bool Build ()
 Builds the quadtree.
PLMATH_API void Destroy ()
 Destroy the quadtree.
PLMATH_API void UpdateBoundingBoxes (QuadtreePatch **ppPatch)
 Updates the bounding boxes of the quadtree.
PLMATH_API void UpdateVisibility (const PlaneSet &cPlaneSet, QuadtreePatch **ppPatch) const
 Updates the visibility information of the quadtree patches.
PLMATH_API void GetBoundingBoxMinMax (Vector3 &vMin, Vector3 &vMax) const
 Returns the bounding box minimum/maximum values.
PLMATH_API PLCore::uint32 GetNumOfChildren () const
 Returns the number of children.
PLMATH_API QuadtreeGetChild (PLCore::uint32 nChild) const
 Returns a child.

Detailed Description

Quadtree.


Constructor & Destructor Documentation

Constructor.

virtual PLMATH_API PLMath::Quadtree::~Quadtree ( ) [virtual]

Destructor.


Member Function Documentation

PLMATH_API void PLMath::Quadtree::Init ( PLCore::uint32  nXOffset = 0,
PLCore::uint32  nYOffset = 0,
PLCore::uint32  nXSize = 0,
PLCore::uint32  nYSize = 0,
Quadtree pParent = nullptr 
)

Initializes the quadtree.

Parameters:
[in]nXOffsetQuadtree x offset
[in]nYOffsetQuadtree y offset
[in]nXSizeQuadtree x dimension
[in]nYSizeQuadtree y dimension
[in]pParentParent quadtree, can be a null pointer
Note:
  • You should destroy the old quadtree before you initialize the new one!
PLMATH_API bool PLMath::Quadtree::Build ( )

Builds the quadtree.

Returns:
'true' if all went fine, else 'false'
Note:
  • The quadtree must be initialized first!
PLMATH_API void PLMath::Quadtree::Destroy ( )

Destroy the quadtree.

PLMATH_API void PLMath::Quadtree::UpdateBoundingBoxes ( QuadtreePatch **  ppPatch)

Updates the bounding boxes of the quadtree.

Parameters:
[out]ppPatchPointer to the quadtree patches, can be a null pointer (in that case this function is quite useless...)
Note:
  • There must be x size * y size patches in the array!
  • The quadtree patches must have correct bounding boxes
  • If the bounding box of a patch is changed you have to recall this function!
PLMATH_API void PLMath::Quadtree::UpdateVisibility ( const PlaneSet cPlaneSet,
QuadtreePatch **  ppPatch 
) const

Updates the visibility information of the quadtree patches.

Parameters:
[in]cPlaneSetPlane set to check
[out]ppPatchPatches to be updated, can be a null pointer (in that case this function is quite useless...)
Note:
  • The quadtree bounding boxes must being initialized with this patches!
See also:
PLMATH_API void PLMath::Quadtree::GetBoundingBoxMinMax ( Vector3 vMin,
Vector3 vMax 
) const

Returns the bounding box minimum/maximum values.

Parameters:
[out]vMinReceives the bounding box minimum value
[out]vMaxReceives the bounding box maximum value
PLMATH_API PLCore::uint32 PLMath::Quadtree::GetNumOfChildren ( ) const

Returns the number of children.

Returns:
Number of children
PLMATH_API Quadtree* PLMath::Quadtree::GetChild ( PLCore::uint32  nChild) const

Returns a child.

Parameters:
[in]nChildChild to return
Returns:
The requested child, a null pointer on error

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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:20
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported