00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SG_PT_LIGHTS_HXX
00025 #define _SG_PT_LIGHTS_HXX
00026
00027
00028 #ifndef __cplusplus
00029 # error This library requires C++
00030 #endif
00031
00032 #include <simgear/compiler.h>
00033
00034 #include <string>
00035 #include <vector>
00036
00037 #include <osg/Drawable>
00038 #include <osg/Node>
00039 #include <osg/Point>
00040
00041 #include <simgear/math/sg_types.hxx>
00042 #include <simgear/scene/material/matlib.hxx>
00043 #include <simgear/scene/util/SGSceneFeatures.hxx>
00044
00045 #include "SGLightBin.hxx"
00046 #include "SGDirectionalLightBin.hxx"
00047
00048 namespace simgear
00049 {
00050 class Effect;
00051 }
00052
00053
00054
00055
00056 inline void SGConfigureDirectionalLights( bool use_point_sprites,
00057 bool enhanced_lighting,
00058 bool distance_attenuation ) {
00059 static SGSceneFeatures* sceneFeatures = SGSceneFeatures::instance();
00060 sceneFeatures->setEnablePointSpriteLights(use_point_sprites);
00061 sceneFeatures->setEnableDistanceAttenuationLights(distance_attenuation);
00062 }
00063
00064 class SGLightFactory {
00065 public:
00066
00067 static osg::Drawable*
00068 getLightDrawable(const SGLightBin::Light& light);
00069
00070 static osg::Drawable*
00071 getLightDrawable(const SGDirectionalLightBin::Light& light);
00072
00077 static osg::Drawable*
00078 getLights(const SGLightBin& lights, unsigned inc = 1, float alphaOff = 0);
00079
00080 static osg::Drawable*
00081 getLights(const SGDirectionalLightBin& lights);
00082
00083 static osg::Drawable*
00084 getVasi(const SGVec3f& up, const SGDirectionalLightBin& lights,
00085 const SGVec4f& red, const SGVec4f& white);
00086
00087 static osg::Node*
00088 getSequenced(const SGDirectionalLightBin& lights);
00089
00090 static osg::Node*
00091 getOdal(const SGLightBin& lights);
00092 };
00093
00094 simgear::Effect* getLightEffect(float size, const osg::Vec3& attenuation,
00095 float minSize, float maxSize, bool directional);
00096 #endif // _SG_PT_LIGHTS_HXX