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.
7 /****************************/
8 /*** CaSHL World (Header) ***/
9 /****************************/
11 #ifndef CAFU_CASHLWORLD_HPP_INCLUDED
12 #define CAFU_CASHLWORLD_HPP_INCLUDED
14 #include "../Common/World.hpp"
17 // This switch controls the usage of normal-maps for SHL patches.
18 // Using normal-maps with SHL patches may or may not help, as explained in the appropriate code comments.
19 #define USE_NORMALMAPS 1
24 ArrayT
<double> SHCoeffs_UnradiatedTransfer
; // SH coefficients of the transfer function that is not yet "radiated" / "shot" into the environment.
25 ArrayT
<double> SHCoeffs_TotalTransfer
; // SH coefficients of the (total) transfer function (that is, direct and bounce transfer).
27 VectorT Coord
; // Position (+safety) in world space of the center of the patch. Valid only if InsideFace==true.
29 VectorT Normal
; // Normal of the patch. Derived from the normal map normals that are covered by this patch.
31 bool InsideFace
; // InsideFace==true <==> this patch is not completely outside its face
35 /// This class provides the interface that is needed to compute and store the SH lighting.
40 CaSHLWorldT(const char* FileName
, ModelManagerT
& ModelMan
, cf::GuiSys::GuiResourcesT
& GuiRes
);
42 const cf::SceneGraph::BspTreeNodeT
& GetBspTree() const { return *m_BspTree
; }
44 double TraceRay(const Vector3dT
& Start
, const Vector3dT
& Ray
) const;
46 void PatchesToSHLMaps(const ArrayT
< ArrayT
<PatchT
> >& Patches
);
48 // Forwarded functions.
49 void SaveToDisk(const char* FileName
) const;
55 const cf::SceneGraph::BspTreeNodeT
* m_BspTree
;
56 cf::ClipSys::CollisionModelStaticT
* m_CollModel
;