Fix issue in Rocket.lua script.
[Cafu-Engine.git] / CaLight / CaLightWorld.hpp
blobe310f2ca64559390c686ef1dcf650f02ec4e416e
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 */
7 #ifndef CAFU_CALIGHTWORLD_HPP_INCLUDED
8 #define CAFU_CALIGHTWORLD_HPP_INCLUDED
10 #include "../Common/World.hpp"
11 #include "GameSys/Entity.hpp"
14 class CaLightWorldT
16 public:
18 CaLightWorldT(const char* FileName, ModelManagerT& ModelMan, cf::GuiSys::GuiResourcesT& GuiRes);
20 const cf::SceneGraph::BspTreeNodeT& GetBspTree() const { return *m_BspTree; }
22 double TraceRay(const Vector3dT& Start, const Vector3dT& Ray) const;
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.
34 void CreateLightMapsForEnts(const ArrayT< IntrusivePtrT<cf::GameSys::EntityT> >& AllEnts);
36 // Forwarded functions.
37 void SaveToDisk(const char* FileName) const;
40 private:
42 WorldT m_World;
43 const cf::SceneGraph::BspTreeNodeT* m_BspTree;
44 cf::ClipSys::CollisionModelStaticT* m_CollModel;
47 #endif