1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSIMPLESHADOWMAPENGINE_H_
40 #define _OSGSIMPLESHADOWMAPENGINE_H_
45 #include "OSGConfig.h"
46 #include "OSGSimpleShadowMapEngineBase.h"
48 #include "OSGSimpleShadowMapEngineData.h"
50 #include "OSGDirectionalLight.h"
51 #include "OSGPointLight.h"
55 /*! \brief ShadowEngine is the basic NodeCore for inner nodes in the tree.
56 \ingroup GrpGroupLightShadowEnginesObj
57 \ingroup GrpLibOSGGroup
61 class OSG_GROUP_DLLMAPPING SimpleShadowMapEngine
:
62 public SimpleShadowMapEngineBase
64 /*========================== PUBLIC =================================*/
68 typedef SimpleShadowMapEngineData EngineData
;
69 typedef SimpleShadowMapEngineData
*EngineDataPtr
;
70 typedef SimpleShadowMapEngineDataUnrecPtr EngineDataUnrecPtr
;
72 /*---------------------------------------------------------------------*/
76 virtual void changed(ConstFieldMaskArg whichField
,
81 /*---------------------------------------------------------------------*/
85 virtual Action::ResultE
runOnEnter(Light
*pLight
,
87 RenderAction
*pAction
);
88 virtual Action::ResultE
runOnLeave(Light
*pLight
,
90 RenderAction
*pAction
);
93 /*---------------------------------------------------------------------*/
98 /*---------------------------------------------------------------------*/
102 virtual void dump( UInt32 uiIndent
= 0,
103 const BitVector bvFlags
= 0) const;
106 /*========================= PROTECTED ===============================*/
110 typedef SimpleShadowMapEngineBase Inherited
;
112 /*---------------------------------------------------------------------*/
113 /*! \name Constructors */
116 SimpleShadowMapEngine(void);
117 SimpleShadowMapEngine(const SimpleShadowMapEngine
&source
);
120 /*---------------------------------------------------------------------*/
121 /*! \name Destructors */
124 virtual ~SimpleShadowMapEngine(void);
127 /*---------------------------------------------------------------------*/
131 static void initMethod(InitPhase ePhase
);
134 /*---------------------------------------------------------------------*/
135 /*! \name Action Callbacks */
138 void lightRenderEnter(Light
*pLight
,
139 RenderAction
*pAction
);
141 void setupCamera (Light
*pLight
,
143 RenderAction
*pAction
,
144 EngineDataPtr pEngineData
);
145 void setupLightChunk (Light
*pLight
,
147 RenderAction
*pAction
,
148 EngineDataPtr pEngineData
);
150 void doLightPass (Light
*pLight
,
151 RenderAction
*pAction
,
152 EngineDataPtr pEngineData
);
153 void doAmbientPass (Light
*pLight
,
154 RenderAction
*pAction
,
155 EngineDataPtr pEngineData
);
156 void doFinalPass (Light
*pLight
,
157 RenderAction
*pAction
,
158 EngineDataPtr pEngineData
);
161 /*========================== PRIVATE ================================*/
165 friend class FieldContainer
;
166 friend class SimpleShadowMapEngineBase
;
168 /*---------------------------------------------------------------------*/
170 /*!\brief prohibit default function (move to 'public' if needed) */
171 void operator =(const SimpleShadowMapEngine
&source
);
174 typedef SimpleShadowMapEngine
*SimpleShadowMapEngineP
;
178 #include "OSGSimpleShadowMapEngineBase.inl"
179 #include "OSGSimpleShadowMapEngine.inl"
181 #endif /* _OSGSIMPLESHADOWMAPENGINE_H_ */