PixelLightAPI
.
|
Base octree class. More...
#include <Octree.h>
Public Member Functions | |
PLMATH_API | Octree () |
Constructor. | |
virtual PLMATH_API | ~Octree () |
Destructor. | |
PLMATH_API bool | IsBuild () const |
Returns whether the octree is build or not. | |
PLMATH_API void | Init (Octree *pParent=nullptr, int nSubdivide=-1, PLCore::uint32 nMinGeometries=0, PLCore::uint32 nIDOffset=0) |
Initializes the octree. | |
PLMATH_API void | Destroy () |
Destroys the octree. | |
PLMATH_API PLCore::uint32 | GetLevel () const |
Returns the subdivision level. | |
PLMATH_API bool | IsVisible () const |
Returns whether the octree is currently visible or not. | |
PLMATH_API void | SetVisible (bool bVisible=true) |
Sets whether the octree is currently visible or not. | |
PLMATH_API const BoundingBox & | GetBoundingBox () const |
Returns the octrees bounding box. | |
PLMATH_API int | GetSubdivide () const |
Returns the subdivide. | |
PLMATH_API PLCore::uint32 | GetMinGeometries () const |
Returns the minimum number of geometries per octree. | |
PLMATH_API const Vector3 & | GetPos () const |
Returns the current position. | |
PLMATH_API void | SetPos (const Vector3 &vPos) |
Set the current position. | |
PLMATH_API const Vector3 & | GetScale () const |
Returns the current scale. | |
PLMATH_API void | SetScale (const Vector3 &vScale) |
Set the current scale. | |
PLMATH_API const Matrix3x3 & | GetRot () const |
Returns the current rotation matrix. | |
PLMATH_API void | SetRot (const Matrix3x3 &mRot) |
Set the current rotation matrix. | |
PLMATH_API void | UpdateVisibility (const PlaneSet &cPlaneSet, PLCore::Bitset *pBitset=nullptr) |
Updates the visibility information of the octree. | |
PLMATH_API void | CheckSphere (const Vector3 &vPos, float fRadius) |
Check whether a sphere intersects with this octree. | |
PLMATH_API void | CheckBox (const BoundingBox &cBox) |
Check whether a box intersects with this octree. | |
Protected Attributes | |
PLCore::uint32 | m_nIDOffset |
PLCore::uint32 | m_nID |
Octree * | m_pTopmost |
Octree * | m_pParent |
PLCore::uint32 | m_nLevel |
PLCore::uint32 | m_nNumOfChildren |
Octree ** | m_ppChild |
BoundingBox | m_cBoundingBox |
Vector3 | m_vPos |
Vector3 | m_vBBCenter |
bool | m_bVisible |
bool | m_bBuild |
int | m_nSubdivide |
PLCore::uint32 | m_nMinGeometries |
Base octree class.
top _\ back y ____________\__________________| | |\ 0 \ 1 \ | | | \----\----\ | | \_3__\_2__\_____| |________ x ____________| | 3 | 2 | | \ bottom _\ |____|____| front \ \ | | | \ \|_7__|_6__| z || || || || left | | right | | Sector position description: x y z 0. left top back 1. right top back 2. right top front 3. left top front 4. left bottom back 5. right bottom back 6. right bottom front 7. left bottom front -x = left +x = right -y = bottom +y = top -z = back +z = front
PLMATH_API PLMath::Octree::Octree | ( | ) |
Constructor.
virtual PLMATH_API PLMath::Octree::~Octree | ( | ) | [virtual] |
Destructor.
PLMATH_API bool PLMath::Octree::IsBuild | ( | ) | const |
Returns whether the octree is build or not.
PLMATH_API void PLMath::Octree::Init | ( | Octree * | pParent = nullptr , |
int | nSubdivide = -1 , |
||
PLCore::uint32 | nMinGeometries = 0 , |
||
PLCore::uint32 | nIDOffset = 0 |
||
) |
Initializes the octree.
[in] | pParent | Parent octree, can be a null pointer |
[in] | nSubdivide | Subdivide |
[in] | nMinGeometries | Minimum geometries per octree |
[in] | nIDOffset | ID offset |
PLMATH_API void PLMath::Octree::Destroy | ( | ) |
Destroys the octree.
PLMATH_API PLCore::uint32 PLMath::Octree::GetLevel | ( | ) | const |
Returns the subdivision level.
PLMATH_API bool PLMath::Octree::IsVisible | ( | ) | const |
Returns whether the octree is currently visible or not.
PLMATH_API void PLMath::Octree::SetVisible | ( | bool | bVisible = true | ) |
Sets whether the octree is currently visible or not.
[in] | bVisible | Should the octree be visible? |
PLMATH_API const BoundingBox& PLMath::Octree::GetBoundingBox | ( | ) | const |
Returns the octrees bounding box.
PLMATH_API int PLMath::Octree::GetSubdivide | ( | ) | const |
Returns the subdivide.
PLMATH_API PLCore::uint32 PLMath::Octree::GetMinGeometries | ( | ) | const |
Returns the minimum number of geometries per octree.
PLMATH_API const Vector3& PLMath::Octree::GetPos | ( | ) | const |
Returns the current position.
PLMATH_API void PLMath::Octree::SetPos | ( | const Vector3 & | vPos | ) |
Set the current position.
[in] | vPos | New position |
PLMATH_API const Vector3& PLMath::Octree::GetScale | ( | ) | const |
Returns the current scale.
PLMATH_API void PLMath::Octree::SetScale | ( | const Vector3 & | vScale | ) |
Set the current scale.
[in] | vScale | New scale |
PLMATH_API const Matrix3x3& PLMath::Octree::GetRot | ( | ) | const |
Returns the current rotation matrix.
PLMATH_API void PLMath::Octree::SetRot | ( | const Matrix3x3 & | mRot | ) |
Set the current rotation matrix.
[in] | mRot | New rotation matrix |
PLMATH_API void PLMath::Octree::UpdateVisibility | ( | const PlaneSet & | cPlaneSet, |
PLCore::Bitset * | pBitset = nullptr |
||
) |
Updates the visibility information of the octree.
[in] | cPlaneSet | Plane set to check |
[out] | pBitset | Optional (can be a null pointer) bit set which can for instance be filled in CustomVisible() and CustomInvisible() with current visibility information |
PLMATH_API void PLMath::Octree::CheckSphere | ( | const Vector3 & | vPos, |
float | fRadius | ||
) |
Check whether a sphere intersects with this octree.
[in] | vPos | Center of the sphere |
[in] | fRadius | Radius of the sphere |
PLMATH_API void PLMath::Octree::CheckBox | ( | const BoundingBox & | cBox | ) |
Check whether a box intersects with this octree.
[in] | cBox | Box to test |
PLCore::uint32 PLMath::Octree::m_nIDOffset [protected] |
ID offset from parent (0-7)
PLCore::uint32 PLMath::Octree::m_nID [protected] |
Octree ID
Octree* PLMath::Octree::m_pTopmost [protected] |
Topmost octree (always valid!)
Octree* PLMath::Octree::m_pParent [protected] |
Octree parent, can be a null pointer
PLCore::uint32 PLMath::Octree::m_nLevel [protected] |
Node level (0 = topmost)
PLCore::uint32 PLMath::Octree::m_nNumOfChildren [protected] |
Number of children
Octree** PLMath::Octree::m_ppChild [protected] |
The children, can be a null pointer
BoundingBox PLMath::Octree::m_cBoundingBox [protected] |
Octree bounding box
Vector3 PLMath::Octree::m_vPos [protected] |
World position (m_vPos+m_vBBCenter = real world position)
Vector3 PLMath::Octree::m_vBBCenter [protected] |
Original bounding box center
bool PLMath::Octree::m_bVisible [protected] |
Is the octree visible?
bool PLMath::Octree::m_bBuild [protected] |
is the octree build?
int PLMath::Octree::m_nSubdivide [protected] |
Subdivide
PLCore::uint32 PLMath::Octree::m_nMinGeometries [protected] |
Minimum number of geometries per octree
|