source: osgVisual/include/sky_Silverlining/skySilverLining_skyDrawable.h @ 32

Last change on this file since 32 was 32, checked in by Torben Dannhauer, 14 years ago

Adding first version of osgVisual!!

File size: 2.4 KB
Line 
1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer
3 *
4 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
10 * You have to aquire licenses for all used proprietary modules.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * OpenSceneGraph Public License for more details.
16 *
17 * This file is based on the OSG example of the Silverlining SDK:
18 * Copyright (c) 2008 Sundog Software, LLC. All rights reserved worldwide.
19*/
20
21
22
23#include <osg/Drawable>
24#include <osgViewer/Viewer>
25#include <OpenThreads/ScopedLock>
26#include <OpenThreads/Mutex>
27
28#include <skySilverLining_cloudLayerSlot.h>
29
30#include <SilverLining.h>
31#include <iostream>
32
33namespace osgVisual
34{
35
36class skySilverLining_atmosphereReference;
37
38class skySilverLining_skyDrawable : public osg::Drawable
39{
40public:
41        skySilverLining_skyDrawable();
42        skySilverLining_skyDrawable(osgViewer::Viewer* view);
43
44    virtual bool isSameKindAs(const Object* obj) const {
45        return dynamic_cast<const skySilverLining_skyDrawable*>(obj)!=NULL;
46    }
47    virtual Object* cloneType() const {
48        return new skySilverLining_skyDrawable();
49    }
50    virtual Object* clone(const osg::CopyOp& copyop) const {
51        return new skySilverLining_skyDrawable();
52    }
53
54        void setSkyboxSize(double size) {_skyboxSize = size;}
55
56    virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
57
58        void addCloudLayer(cloudLayerSlot *cloudLayerSlot_);
59
60protected:
61        void setLighting(SilverLining::Atmosphere *atm) const;
62        void setSceneFog(SilverLining::Atmosphere *atmosphere) const;
63        static void initializeSilverLining(skySilverLining_atmosphereReference *ar);
64        void seedAndAddCloudLayers(SilverLining::Atmosphere *atmosphere);
65
66    osgViewer::Viewer* _view;
67        double _skyboxSize;
68
69private:
70        OpenThreads::Mutex cloudLayersToAddMutex;
71        mutable std::vector<cloudLayerSlot*> cloudLayerSlots;
72        bool newCloudLayersToAdd;
73};
74
75}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.