Cafu Engine
cf::SceneGraph::GenericNodeT Class Reference
Inheritance diagram for cf::SceneGraph::GenericNodeT:

Public Member Functions

virtual ~GenericNodeT ()
 The virtual destructor, so that derived classes can safely be deleted via a GenericNodeT (base class) pointer. More...
 
virtual void WriteTo (std::ostream &OutFile, aux::PoolT &Pool) const
 
virtual const BoundingBox3T
< double > & 
GetBoundingBox () const
 Returns the bounding box of the contents of this scene node. More...
 
virtual bool IsOpaque () const
 TODO / FIXME: This method is a hot-fix for getting the render order with translucent Bezier Patches right. More...
 
virtual void DrawAmbientContrib (const Vector3dT &ViewerPos) const
 Draws the contents of this scene node. More...
 
virtual void DrawStencilShadowVolumes (const Vector3dT &LightPos, const float LightRadius) const
 
virtual void DrawLightSourceContrib (const Vector3dT &ViewerPos, const Vector3dT &LightPos) const
 
virtual void DrawTranslucentContrib (const Vector3dT &ViewerPos) const
 
virtual void InitDefaultLightMaps (const float LightMapPatchSize)
 If this NodeT uses lightmaps, this methods initializes default (full-bright) lightmaps for it at the proper size. More...
 
virtual void CreatePatchMeshes (ArrayT< PatchMeshT > &PatchMeshes, ArrayT< ArrayT< ArrayT< Vector3dT > > > &SampleCoords, const float LightMapPatchSize) const
 Creates the patch meshes for this NodeT for the purpose of radiosity computations (CaLight). More...
 
virtual void BackToLightMap (const PatchMeshT &PatchMesh, const float LightMapPatchSize)
 Takes the patches of the given patch mesh back into the lightmap of this node. More...
 

Static Public Member Functions

static GenericNodeTCreateFromFile_cw (std::istream &InFile, aux::PoolT &Pool, LightMapManT &LMM, SHLMapManT &SMM, PlantDescrManT &PDM, const ArrayT< const TerrainT * > &ShTe, ModelManagerT &ModelMan)
 Reads a GenericNodeT from InFile. More...
 

Constructor & Destructor Documentation

virtual cf::SceneGraph::GenericNodeT::~GenericNodeT ( )
inlinevirtual

The virtual destructor, so that derived classes can safely be deleted via a GenericNodeT (base class) pointer.

Member Function Documentation

virtual void cf::SceneGraph::GenericNodeT::BackToLightMap ( const PatchMeshT PatchMesh,
const float  LightMapPatchSize 
)
inlinevirtual

Takes the patches of the given patch mesh back into the lightmap of this node.

Reimplemented in cf::SceneGraph::FaceNodeT, and cf::SceneGraph::BezierPatchNodeT.

GenericNodeT * GenericNodeT::CreateFromFile_cw ( std::istream &  InFile,
aux::PoolT Pool,
LightMapManT LMM,
SHLMapManT SMM,
PlantDescrManT PDM,
const ArrayT< const TerrainT * > &  ShTe,
ModelManagerT ModelMan 
)
static

Reads a GenericNodeT from InFile.

virtual void cf::SceneGraph::GenericNodeT::CreatePatchMeshes ( ArrayT< PatchMeshT > &  PatchMeshes,
ArrayT< ArrayT< ArrayT< Vector3dT > > > &  SampleCoords,
const float  LightMapPatchSize 
) const
inlinevirtual

Creates the patch meshes for this NodeT for the purpose of radiosity computations (CaLight).

The created patch meshes are just appended to the PatchMeshes array, i.e. the PatchMeshes array is not cleared by this function. The origins of the patches are chosen so that self-intersections due to rounding errors are impossible or at least unlikely.

Parameters
PatchMeshesThe array the created patch meshes are appended to. The array is not initially cleared by this function.
SampleCoordsFor each patch of each appended patch mesh, an array of sample coordinates is appended by this function. The minimum number of samples returned per patch is normally one, namely the one identical to the patches coordinate. NOTE: There may be NO SAMPLES AT ALL for a patch if InsideFace==false for that patch, so the caller must not make any assumptions. The calling code may use that for example for computing initial sunlight information. The array is not initially cleared by this function.
LightMapPatchSizeThe size of the lightmap patches.

Reimplemented in cf::SceneGraph::FaceNodeT, and cf::SceneGraph::BezierPatchNodeT.

virtual void cf::SceneGraph::GenericNodeT::DrawAmbientContrib ( const Vector3dT ViewerPos) const
inlinevirtual

Draws the contents of this scene node.

Parameters
ViewerPosPosition of the viewer.

Reimplemented in cf::SceneGraph::FaceNodeT, cf::SceneGraph::BspTreeNodeT, cf::SceneGraph::BezierPatchNodeT, cf::SceneGraph::TerrainNodeT, cf::SceneGraph::PlantNodeT, and cf::SceneGraph::ModelNodeT.

virtual const BoundingBox3T<double>& cf::SceneGraph::GenericNodeT::GetBoundingBox ( ) const
inlinevirtual
virtual void cf::SceneGraph::GenericNodeT::InitDefaultLightMaps ( const float  LightMapPatchSize)
inlinevirtual

If this NodeT uses lightmaps, this methods initializes default (full-bright) lightmaps for it at the proper size.

This method is intended to be called by CaBSP, after it is completely done with changing the geometry of the node (the implementation would be part of the nodes constructor otherwise). The method may or may not use the LightMapManT for its purposes, the caller should not care.

Reimplemented in cf::SceneGraph::FaceNodeT, and cf::SceneGraph::BezierPatchNodeT.

virtual bool cf::SceneGraph::GenericNodeT::IsOpaque ( ) const
inlinevirtual

TODO / FIXME: This method is a hot-fix for getting the render order with translucent Bezier Patches right.

It should be removed again and the whole system should be replaced with something as in the Q3 renderer!

Reimplemented in cf::SceneGraph::FaceNodeT, cf::SceneGraph::BspTreeNodeT, cf::SceneGraph::BezierPatchNodeT, cf::SceneGraph::TerrainNodeT, cf::SceneGraph::PlantNodeT, and cf::SceneGraph::ModelNodeT.


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