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

Public Member Functions

 BezierPatchNodeT (LightMapManT &LMM, float MaxError)
 The constructor for creating an "empty" bezier patch. More...
 
 BezierPatchNodeT (LightMapManT &LMM, unsigned long SizeX_, unsigned long SizeY_, const ArrayT< float > &ControlPoints_, int SubdivsHorz_, int SubdivsVert_, MaterialT *Material_, float MaxError)
 Constructor for creating a BezierPatchNodeT from components. More...
 
 BezierPatchNodeT (LightMapManT &LMM, unsigned long SizeX_, unsigned long SizeY_, const ArrayT< Vector3fT > &ControlPointsXYZ_, const ArrayT< Vector3fT > &ControlPointsUV_, int SubdivsHorz_, int SubdivsVert_, MaterialT *Material_, float MaxError)
 Constructor for creating a BezierPatchNodeT from components. More...
 
 ~BezierPatchNodeT ()
 The destructor. More...
 
void UpdateMeshColor (const float red, const float green, const float blue, const float alpha)
 Sets color for all meshes of this bezier patch. 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 BezierPatchNodeTCreateFromFile_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...
 

Friends

class ::MapBezierPatchT
 

Constructor & Destructor Documentation

BezierPatchNodeT::BezierPatchNodeT ( LightMapManT LMM,
float  MaxError 
)

The constructor for creating an "empty" bezier patch.

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

BezierPatchNodeT::BezierPatchNodeT ( LightMapManT LMM,
unsigned long  SizeX_,
unsigned long  SizeY_,
const ArrayT< float > &  ControlPoints_,
int  SubdivsHorz_,
int  SubdivsVert_,
MaterialT Material_,
float  MaxError 
)

Constructor for creating a BezierPatchNodeT from components.

This is currently only needed by the LoadWorld.cpp file of the CaBSP tool.

BezierPatchNodeT::BezierPatchNodeT ( LightMapManT LMM,
unsigned long  SizeX_,
unsigned long  SizeY_,
const ArrayT< Vector3fT > &  ControlPointsXYZ_,
const ArrayT< Vector3fT > &  ControlPointsUV_,
int  SubdivsHorz_,
int  SubdivsVert_,
MaterialT Material_,
float  MaxError 
)

Constructor for creating a BezierPatchNodeT from components.

This is currently only needed by the MapBezierPatch.cpp file for patch rendering in CaWE.

BezierPatchNodeT::~BezierPatchNodeT ( )

The destructor.

Member Function Documentation

void BezierPatchNodeT::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.

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

Named constructor.

void BezierPatchNodeT::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 BezierPatchNodeT::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 > & BezierPatchNodeT::GetBoundingBox ( ) const
virtual

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

Reimplemented from cf::SceneGraph::GenericNodeT.

void BezierPatchNodeT::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 BezierPatchNodeT::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.

void BezierPatchNodeT::UpdateMeshColor ( const float  red,
const float  green,
const float  blue,
const float  alpha 
)

Sets color for all meshes of this bezier patch.


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