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 _OSGPOINTLIGHT_H_
40 #define _OSGPOINTLIGHT_H_
45 #include "OSGConfig.h"
46 #include "OSGPointLightBase.h"
47 #include "OSGStatIntElem.h"
48 #include "OSGStatElemDesc.h"
52 /*! \brief Point Light
53 \ingroup GrpGroupLightObj
54 \ingroup GrpLibOSGGroup
58 class OSG_GROUP_DLLMAPPING PointLight
: public PointLightBase
60 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
65 /*! \name static stat elem */
68 static StatElemDesc
<StatIntElem
> statNPointLights
;
71 /*---------------------------------------------------------------------*/
72 /*! \name Access Fields */
75 void setPosition ( Real32 rX
,
78 void setPosition (const Pnt3f
&pos
);
80 void setAttenuation( Real32 rConstant
,
85 /*---------------------------------------------------------------------*/
89 virtual void makeChunk(void);
92 /*---------------------------------------------------------------------*/
96 virtual void changed(ConstFieldMaskArg whichField
,
101 /*---------------------------------------------------------------------*/
102 /*! \name LightEngine */
105 virtual void callLightEngineEnter(RenderAction
*ract
);
106 virtual void callLightEngineLeave(RenderAction
*ract
);
109 /*---------------------------------------------------------------------*/
113 virtual void dump( UInt32 uiIndent
= 0,
114 const BitVector bvFlags
= 0) const;
117 /*========================= PROTECTED ===============================*/
121 typedef PointLightBase Inherited
;
123 /*---------------------------------------------------------------------*/
124 /*! \name Constructors */
128 PointLight(const PointLight
&source
);
131 /*---------------------------------------------------------------------*/
132 /*! \name Destructors */
135 virtual ~PointLight(void);
138 /*---------------------------------------------------------------------*/
142 static void initMethod(InitPhase ePhase
);
145 /*---------------------------------------------------------------------*/
149 Action::ResultE
renderEnter(Action
*action
);
150 Action::ResultE
renderLeave(Action
*action
);
153 /*========================== PRIVATE ================================*/
157 friend class FieldContainer
;
158 friend class PointLightBase
;
160 /*! \brief prohibit default function (move to 'public' if needed) */
161 void operator =(const PointLight
&source
);
164 typedef PointLight
*PointLightP
;
168 #include "OSGPointLightBase.inl"
169 #include "OSGPointLight.inl"
171 #endif /* _OSGPOINTLIGHT_H_ */