#include <eng_bsp.hh>
Public Types | |
| enum | ePolicy { ePolicy_FORCE, ePolicy_THROW_EXCEPTION } |
| What to do if an Object doesn't fit in the BSP's volume. More... | |
Public Member Functions | |
| void | ForEachObject (ForEachObjectFunctor &functor) |
| BSP (const BoxVolume &boxVolume) | |
| ~BSP () | |
| CLASS_METHOD void | SetPolicy (const ePolicy policy) |
| bool | IfInside (const Volume &volume) |
| bool | IfInside (const BoxVolume &boxVolume) |
| const BoxVolume & | GetBoxVolume (void) |
| eAttached | Attach (SharedPtr< Object > object) |
| eAttached | Detach (SharedPtr< Object > object) |
| void | Draw (void) |
Public Attributes | |
| CLASS_VAR uint | msDebugRecursionLevel |
| CLASS_VAR bool | msDebugDrawBox |
Private Member Functions | |
| BSP::Node::Ptr | FindFit (SharedPtr< Object > object) |
| BSP::Node::Ptr | FindFit (const BoxVolume &objectVolume) |
| bool | IfContinueRecursion (const uint level) |
Private Attributes | |
| CLASS_VAR uint | msRecursionLimit = eng::defs::DEFAULT_BSP_RECURSION_LIMIT |
| use IfStopRecursion() | |
| CLASS_VAR int | msNodeLimit = eng::defs::DEFAULT_BSP_NODE_LIMIT |
| limit amount of partitions | |
| CLASS_VAR ePolicy | msPolicy = BSP::ePolicy_THROW_EXCEPTION |
| Node::Ptr | mRoot |
| outer-level partition | |
| int | mNodeCnt |
Friends | |
| class | Quadrant |
| class | World |
Classes | |
| class | ForEachObjectFunctor |
| For each Object in BSP. More... | |
| class | Node |
| BSP node. More... | |
| class | Viewpoint |
| Viewpoint for recursing a BSP tree. More... | |
| enum eng::BSP::ePolicy |
What to do if an Object doesn't fit in the BSP's volume.
| ePolicy_FORCE | force Object into BSP::mRoot despite it not fitting |
| ePolicy_THROW_EXCEPTION |
| eng::BSP::BSP | ( | const BoxVolume & | boxVolume | ) |
Construct as interior node.
| eng::BSP::~BSP | ( | ) |
| void eng::BSP::ForEachObject | ( | ForEachObjectFunctor & | functor | ) |
| void eng::BSP::SetPolicy | ( | const ePolicy | policy | ) |
| bool eng::BSP::IfInside | ( | const Volume & | volume | ) | [inline] |
| bool eng::BSP::IfInside | ( | const BoxVolume & | boxVolume | ) | [inline] |
| const BoxVolume& eng::BSP::GetBoxVolume | ( | void | ) | [inline] |
| void eng::BSP::Draw | ( | void | ) |
Draw all visible Objects in BSP. See Engine::Draw(). Traverses the BSP tree in back-to-front order relative to a viewpoint. The first Object visited will be the most distant from the viewpoint.
| BSP::Node::Ptr eng::BSP::FindFit | ( | SharedPtr< Object > | object | ) | [private] |
| BSP::Node::Ptr eng::BSP::FindFit | ( | const BoxVolume & | objectVolume | ) | [private] |
Recursively traverse BSP nodes to find the smallest BSP that contains a volume.
-- Might throw a C++ exception depending on policy --
At this point, the Object is entirely inside this node. The goal is to find the smallest node that will entirely contain the Object. Split this node's volume into two half-spaces (left and right). If either fully contains the Object, recurse left or right. Otherwise, the goal was reached.
What about Objects that straddle a partition? An assertion will fail!!
| bool eng::BSP::IfContinueRecursion | ( | const uint | level | ) | [inline, private] |
friend class Quadrant [friend] |
friend class World [friend] |
use IfStopRecursion()
int eng::BSP::msNodeLimit = eng::defs::DEFAULT_BSP_NODE_LIMIT [private] |
limit amount of partitions
BSP::ePolicy eng::BSP::msPolicy = BSP::ePolicy_THROW_EXCEPTION [private] |
Node::Ptr eng::BSP::mRoot [private] |
outer-level partition
int eng::BSP::mNodeCnt [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:21 2007