Cafu Engine
CaLightWorld.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_CALIGHTWORLD_HPP_INCLUDED
8 #define CAFU_CALIGHTWORLD_HPP_INCLUDED
9 
10 #include "../Common/World.hpp"
11 #include "GameSys/Entity.hpp"
12 
13 
15 {
16  public:
17 
18  CaLightWorldT(const char* FileName, ModelManagerT& ModelMan, cf::GuiSys::GuiResourcesT& GuiRes);
19 
20  const cf::SceneGraph::BspTreeNodeT& GetBspTree() const { return *m_BspTree; }
21 
22  double TraceRay(const Vector3dT& Start, const Vector3dT& Ray) const;
23 
24  /// Creates (fake) lightmaps for (brush or bezier patch based) entities.
25  /// The generated lightmaps are only "fakes", i.e. they are not a result of the true Radiosity computations of CaLight.
26  /// Instead, they are obtained by sampling the environment (the world entity) and interpolating the obtained values.
27  /// This of course is only possible after the world has been lit by the true Radiosity process.
28  /// While the disadvantages are clear (objects that have not participated in the original Radiosity computations can
29  /// obviously not blend into the environment visually as smoothly as if they had been there right from the start),
30  /// the advantages are a reasonably quick completion of the computations and independency of the internal data of the
31  /// original Radiosity computations.
32  /// For example, this function can be implemented without reference to the "bins" of the tone-mapping operator of the
33  /// world, which in turn makes the implementation of the "-onlyEnts" command-line option primally possible.
35 
36  // Forwarded functions.
37  void SaveToDisk(const char* FileName) const;
38 
39 
40  private:
41 
42  WorldT m_World;
43  const cf::SceneGraph::BspTreeNodeT* m_BspTree;
45 };
46 
47 #endif
Definition: CaLightWorld.hpp:14
Definition: World.hpp:85
The class represents a BSP Tree node, implementing the Composite design pattern.
Definition: BspTreeNode.hpp:30
This class represents a static collision model.
Definition: CollisionModel_static.hpp:25
void CreateLightMapsForEnts(const ArrayT< IntrusivePtrT< cf::GameSys::EntityT > > &AllEnts)
Creates (fake) lightmaps for (brush or bezier patch based) entities.
Definition: CaLightWorld.cpp:45
This class is used for managing model instances.
Definition: ModelManager.hpp:31
Definition: Renderer.hpp:16
This class manages and provides resources (fonts and models) for GuiImplT instances.
Definition: GuiResources.hpp:26