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

Classes

struct  LightMapInfoT
 
struct  SHLMapInfoT
 
struct  TexInfoT
 

Public Member Functions

 FaceNodeT (LightMapManT &LMM, SHLMapManT &SMM)
 The constructor for creating an "empty" face. More...
 
 FaceNodeT (LightMapManT &LMM, SHLMapManT &SMM, const Polygon3T< double > &Poly_, MaterialT *Material_, const TexInfoT &TI_)
 Constructor for creating a FaceNodeT from components. More...
 
 FaceNodeT (const FaceNodeT &Other)
 The copy constructor. More...
 
 ~FaceNodeT ()
 The destructor. More...
 
void InitRenderMeshesAndMats (const ArrayT< Vector3dT > &SharedVertices, const float LightMapPatchSize)
 
ArrayT< unsigned long > & GetDrawIndices ()
 Returns the DrawIndices. For CaBSP. More...
 
LightMapManTGetLightMapMan () const
 Returns the LightMapMan. For CaBSP. More...
 
SHLMapManTGetSHLMapMan () const
 Returns the SHLMapMan. For CaBSP. More...
 
bool GetLightmapColorNearPosition (const Vector3dT &Pos, Vector3fT &LightMapColor, const float LightMapPatchSize) const
 Determines the lightmap color of this face near position Pos. More...
 
void WriteTo (std::ostream &OutFile, aux::PoolT &Pool) const
 
const BoundingBox3T< double > & GetBoundingBox () const
 Returns the bounding box of the contents of this scene node. More...
 
bool IsOpaque () const
 TODO / FIXME: This method is a hot-fix for getting the render order with translucent Bezier Patches right. More...
 
void DrawAmbientContrib (const Vector3dT &ViewerPos) const
 Draws the contents of this scene node. More...
 
void DrawStencilShadowVolumes (const Vector3dT &LightPos, const float LightRadius) const
 
void DrawLightSourceContrib (const Vector3dT &ViewerPos, const Vector3dT &LightPos) const
 
void DrawTranslucentContrib (const Vector3dT &ViewerPos) const
 
void InitDefaultLightMaps (const float LightMapPatchSize)
 If this NodeT uses lightmaps, this methods initializes default (full-bright) lightmaps for it at the proper size. More...
 
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...
 
void BackToLightMap (const PatchMeshT &PatchMesh, const float LightMapPatchSize)
 Takes the patches of the given patch mesh back into the lightmap of this node. More...
 
- Public Member Functions inherited from cf::SceneGraph::GenericNodeT
virtual ~GenericNodeT ()
 The virtual destructor, so that derived classes can safely be deleted via a GenericNodeT (base class) pointer. More...
 

Static Public Member Functions

static FaceNodeTCreateFromFile_cw (std::istream &InFile, aux::PoolT &Pool, LightMapManT &LMM, SHLMapManT &SMM)
 Named constructor. More...
 
- Static Public Member Functions inherited from cf::SceneGraph::GenericNodeT
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...
 

Public Attributes

Polygon3T< double > Polygon
 
MaterialTMaterial
 The material that is assigned to this face. The pointer points into the MaterialManager-maintained list. More...
 
TexInfoT TI
 
LightMapInfoT LightMapInfo
 
SHLMapInfoT SHLMapInfo
 

Static Public Attributes

static const double ROUND_EPSILON = 0.08
 The maximum amount that is allowed for geometry-related rounding errors. More...
 

Constructor & Destructor Documentation

FaceNodeT::FaceNodeT ( LightMapManT LMM,
SHLMapManT SMM 
)

The constructor for creating an "empty" face.

Needed e.g. by the named constructor CreateFromFile_cw() below.

FaceNodeT::FaceNodeT ( LightMapManT LMM,
SHLMapManT SMM,
const Polygon3T< double > &  Poly_,
MaterialT Material_,
const TexInfoT TI_ 
)

Constructor for creating a FaceNodeT from components.

This is currently only needed by the LoadWorld.cpp and LeakDetection.cpp files of the CaBSP tool.

FaceNodeT::FaceNodeT ( const FaceNodeT Other)

The copy constructor.

FaceNodeT::~FaceNodeT ( )

The destructor.

Member Function Documentation

void FaceNodeT::BackToLightMap ( const PatchMeshT PatchMesh,
const float  LightMapPatchSize 
)
virtual

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

Reimplemented from cf::SceneGraph::GenericNodeT.

FaceNodeT * FaceNodeT::CreateFromFile_cw ( std::istream &  InFile,
aux::PoolT Pool,
LightMapManT LMM,
SHLMapManT SMM 
)
static

Named constructor.

void FaceNodeT::CreatePatchMeshes ( ArrayT< PatchMeshT > &  PatchMeshes,
ArrayT< ArrayT< ArrayT< Vector3dT > > > &  SampleCoords,
const float  LightMapPatchSize 
) const
virtual

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 from cf::SceneGraph::GenericNodeT.

void FaceNodeT::DrawAmbientContrib ( const Vector3dT ViewerPos) const
virtual

Draws the contents of this scene node.

Parameters
ViewerPosPosition of the viewer.

Reimplemented from cf::SceneGraph::GenericNodeT.

const BoundingBox3T< double > & FaceNodeT::GetBoundingBox ( ) const
virtual

Returns the bounding box of the contents of this scene node.

Reimplemented from cf::SceneGraph::GenericNodeT.

ArrayT<unsigned long>& cf::SceneGraph::FaceNodeT::GetDrawIndices ( )
inline

Returns the DrawIndices. For CaBSP.

bool FaceNodeT::GetLightmapColorNearPosition ( const Vector3dT Pos,
Vector3fT LightMapColor,
const float  LightMapPatchSize 
) const

Determines the lightmap color of this face near position Pos.

Returns
true if the lightmap color could be determined and written into the Red, Green and Blue parameters.
LightMapManT& cf::SceneGraph::FaceNodeT::GetLightMapMan ( ) const
inline

Returns the LightMapMan. For CaBSP.

SHLMapManT& cf::SceneGraph::FaceNodeT::GetSHLMapMan ( ) const
inline

Returns the SHLMapMan. For CaBSP.

void FaceNodeT::InitDefaultLightMaps ( const float  LightMapPatchSize)
virtual

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 from cf::SceneGraph::GenericNodeT.

bool FaceNodeT::IsOpaque ( ) const
virtual

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 from cf::SceneGraph::GenericNodeT.

Member Data Documentation

MaterialT* cf::SceneGraph::FaceNodeT::Material

The material that is assigned to this face. The pointer points into the MaterialManager-maintained list.

const double FaceNodeT::ROUND_EPSILON = 0.08
static

The maximum amount that is allowed for geometry-related rounding errors.


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