7 #ifndef CAFU_SCENEGRAPH_BSPTREENODE_HPP_INCLUDED
8 #define CAFU_SCENEGRAPH_BSPTREENODE_HPP_INCLUDED
11 #include "Math3D/Brush.hpp"
12 #include "Math3D/Polygon.hpp"
14 #if defined(_WIN32) && _MSC_VER<1600
37 unsigned long FrontChild;
38 unsigned long BackChild;
59 BspTreeNodeT(
float LightMapPatchSize,
float SHLMapPatchSize);
68 float GetLightMapPatchSize()
const {
return m_LightMapPatchSize; }
69 float GetSHLMapPatchSize()
const {
return m_SHLMapPatchSize; }
80 double ClipLine(
const VectorT& P,
const VectorT& U,
double Min,
double Max,
unsigned long NodeNr=0,
bool NodeIsLeaf=
false)
const;
83 void WriteTo(std::ostream& OutFile, aux::PoolT& Pool)
const;
89 void DrawStencilShadowVolumes(
const Vector3dT& LightPos,
const float LightRadius)
const;
90 void DrawLightSourceContrib(
const Vector3dT& ViewerPos,
const Vector3dT& LightPos)
const;
91 void DrawTranslucentContrib(
const Vector3dT& ViewerPos)
const;
97 friend class Ca3DEWorld_EntityServiceInterfaceT;
118 bool IsInPVS(
const unsigned long QueryLeafNr,
unsigned long LeafNr)
const;
121 bool IsInPVS(
const VectorT& Position,
unsigned long LeafNr)
const;
145 void GetLeavesOrderedBackToFrontHelper(
unsigned long NodeNr)
const;
146 void InitForNextLight()
const;
148 float m_LightMapPatchSize;
149 float m_SHLMapPatchSize;
162 mutable bool NextLightNeedsInit;
This class manages lightmaps, e.g. by "allocating" rectangular areas in larger bitmaps.
Definition: LightMapMan.hpp:25
ArrayT< cf::SceneGraph::FaceNodeT * > FaceChildren
The list of all the face children of the BSP tree.
Definition: BspTreeNode.hpp:137
void operator=(const BspTreeNodeT &)
Use of the Assignment Operator is not allowed.
unsigned long WhatLeaf(const VectorT &Position) const
In what leaf is 'Position' located? This function MUST NOT BE CALLED ON AN EMPTY MAP! ...
Definition: BspTreeNode.cpp:499
~BspTreeNodeT()
The destructor.
Definition: BspTreeNode.cpp:138
Definition: BspTreeNode.hpp:34
BspTreeNodeT(float LightMapPatchSize, float SHLMapPatchSize)
The constructor.
Definition: BspTreeNode.cpp:22
This class manages SHL maps, e.g. by "allocating" rectangular areas in larger coefficient maps...
Definition: SHLMapMan.hpp:25
The plant description manager holds and manages all plant descriptions so they can be shared with mul...
Definition: PlantDescrMan.hpp:19
ArrayT< cf::SceneGraph::GenericNodeT * > OtherChildren
The list of all the other children of the BSP tree.
Definition: BspTreeNode.hpp:138
double ClipLine(const VectorT &P, const VectorT &U, double Min, double Max, unsigned long NodeNr=0, bool NodeIsLeaf=false) const
Clips the line segment defined by P+U*Min and P+U*Max against the map and returns a value Hit such th...
Definition: BspTreeNode.cpp:165
bool IsOpaque() const
TODO / FIXME: This method is a hot-fix for getting the render order with translucent Bezier Patches r...
Definition: BspTreeNode.cpp:277
Definition: BspTreeBuilder.hpp:27
void GetLeavesOrderedBackToFront(ArrayT< unsigned long > &OrderedFaces, const VectorT &Origin) const
This function traverses the BSP tree back-to-front, and stores the index numbers of the leaves it enc...
Definition: BspTreeNode.cpp:783
The class represents a BSP Tree node, implementing the Composite design pattern.
Definition: BspTreeNode.hpp:30
Definition: BspTreeNode.hpp:44
ArrayT< unsigned long > OtherChildrenSet
The contents of this leaf (bezier patches, terrains, etc. ... everything but faces).
Definition: BspTreeNode.hpp:50
This class is used for managing model instances.
Definition: ModelManager.hpp:31
static BspTreeNodeT * CreateFromFile_cw(std::istream &InFile, aux::PoolT &Pool, LightMapManT &LMM, SHLMapManT &SMM, PlantDescrManT &PDM, const ArrayT< const TerrainT * > &ShTe, ModelManagerT &ModelMan)
Named constructor.
Definition: BspTreeNode.cpp:30
void DrawAmbientContrib(const Vector3dT &ViewerPos) const
Draws the contents of this scene node.
Definition: BspTreeNode.cpp:283
bool IsInPVS(const unsigned long QueryLeafNr, unsigned long LeafNr) const
Returns 'true' if leaf 'QueryLeafNr' is in the PVS of leaf 'LeafNr', and false otherwise. Do not call on empty map.
Definition: BspTreeNode.cpp:793
void WhatLeaves(ArrayT< unsigned long > &ResultLeaves, const BoundingBox3T< double > &BoundingBox, unsigned long NodeNr=0) const
In what leaves is 'BoundingBox' located? This function MUST NOT BE CALLED ON AN EMPTY MAP! The result...
Definition: BspTreeNode.cpp:532
const BoundingBox3T< double > & GetBoundingBox() const
Returns the bounding box of the contents of this scene node.
Definition: BspTreeNode.cpp:271