X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Ftgdb%2Fpt_lights.hxx;h=863328dc60bffafcd90500e4aca615bcc8e854e7;hb=3b5665fe92802d3d36d6304cb2c184dc03e91de4;hp=9e95674ed199b6f19856648ee47288a5902f9a80;hpb=733e6fa14ff507a1022ecab8d55cc9bf587bee40;p=simgear.git diff --git a/simgear/scene/tgdb/pt_lights.hxx b/simgear/scene/tgdb/pt_lights.hxx index 9e95674e..863328dc 100644 --- a/simgear/scene/tgdb/pt_lights.hxx +++ b/simgear/scene/tgdb/pt_lights.hxx @@ -40,13 +40,16 @@ #include #include +#include #include #include "SGLightBin.hxx" #include "SGDirectionalLightBin.hxx" -SG_USING_STD(string); -SG_USING_STD(vector); +namespace simgear +{ +class Effect; +} // Specify the way we want to draw directional point lights (assuming the // appropriate extensions are available.) @@ -59,28 +62,19 @@ inline void SGConfigureDirectionalLights( bool use_point_sprites, sceneFeatures->setEnableDistanceAttenuationLights(distance_attenuation); } -class SGPointSpriteLightCullCallback : public osg::NodeCallback { -public: - SGPointSpriteLightCullCallback(const osg::Vec3& da = osg::Vec3(1, 0.001, 0.0002), - float sz = 4); - SGPointSpriteLightCullCallback(osg::Point* point); - - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); - -private: - osg::ref_ptr _pointSpriteStateSet; - osg::ref_ptr _distanceAttenuationStateSet; -}; - class SGLightFactory { public: - static osg::Node* - getLight(const SGLightBin::Light& light); + static osg::Drawable* + getLightDrawable(const SGLightBin::Light& light); - static osg::Node* - getLight(const SGDirectionalLightBin::Light& light); + static osg::Drawable* + getLightDrawable(const SGDirectionalLightBin::Light& light); + /** + * Return a drawable for a very simple point light that isn't + * distance scaled. + */ static osg::Drawable* getLights(const SGLightBin& lights, unsigned inc = 1, float alphaOff = 0); @@ -92,10 +86,19 @@ public: const SGVec4f& red, const SGVec4f& white); static osg::Node* - getSequenced(const SGDirectionalLightBin& lights); + getSequenced(const SGDirectionalLightBin& lights, const simgear::SGReaderWriterOptions* options); + + static osg::Node* + getOdal(const SGLightBin& lights, const simgear::SGReaderWriterOptions* options); + + static osg::Node* + getHoldShort(const SGDirectionalLightBin& lights, const simgear::SGReaderWriterOptions* options); static osg::Node* - getOdal(const SGLightBin& lights); + getGuard(const SGDirectionalLightBin& lights, const simgear::SGReaderWriterOptions* options); }; +simgear::Effect* getLightEffect(float size, const osg::Vec3& attenuation, + float minSize, float maxSize, bool directional, + const simgear::SGReaderWriterOptions* options); #endif // _SG_PT_LIGHTS_HXX