interreality.org [VOS]
[Home] [About]
[Screenshots]
[Download]
[News]
[Community]
[Documentation] [Manual]
[Bugs & Requests] [Wiki]

/home/tetron/hack/vos/libs/vos/metaobjects/a3dl/sector.hh

Go to the documentation of this file.
00001 /*
00002     This file is part of the Virtual Object System of
00003     the Interreality project (http://interreality.org).
00004 
00005     Copyright (C) 2001, 2002 Peter Amstutz
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 
00021     Peter Amstutz <http://www.interreality.org>
00022 */
00023 
00024 #ifndef _SECTOR_HH_
00025 #define _SECTOR_HH_
00026 
00027 #include "a3dldefs.hh"
00028 #include <vos/vos/vos.hh>
00029 
00030 #ifndef A3DL_EXPORTS
00031 IMPORT_METAOBJECT_FACTORIES(A3DL_Sector)
00032 #endif
00033 
00034 
00035 namespace A3DL
00036 {
00037     /** @class Sector sector.hh vos/metaobjects/a3dl/sector.hh
00038      *  @ingroup libmetaobject_a3dl
00039      *  A sector is a grouping of 3D objects that can be considered a seperate,
00040      *  mostly self-contained entity from other sectors. Sectors may be linked
00041      *  through Portal objects, though.  Child objects are considered to be "in"
00042      *  this sector. (Sectors have not fixed bounds)
00043      */
00044     class A3DL_API Sector : public VOS::MetaObject
00045     {
00046     public:
00047         Sector(VOS::VobjectBase* superobject);
00048         ~Sector();
00049 
00050         virtual const std::string getVOSType();
00051         static VOS::MetaObject* new_Sector(VOS::VobjectBase* superobject, const std::string& type);
00052 
00053         /// A general "fog" or "haze" that fills the whole sector obscuring distant objects.
00054         //@{
00055         void setFogColor(float r, float g, float b);
00056         void getFogColor(float& r, float& g, float& b) ;
00057         void setFogDensity(double d) ;
00058         double getFogDensity() ;
00059         VUtil::vRef<VOS::Property> getFogColorObj() ;
00060         VUtil::vRef<VOS::Property> getFogDensityObj() ;
00061         //@}
00062 
00063         /// Gravity acceleration
00064         //@{
00065         virtual void setGravity(double unitsPerSecond);
00066         virtual double getGravity();
00067         virtual VUtil::vRef<VOS::Property> getGravityObj() ;
00068         //@}
00069 
00070         /// Whether clients ought to perform collision detection for objects within this sector.
00071         //@{
00072         virtual void setCollisionDetection(bool enabled);
00073         virtual bool getCollisionDetection();
00074         virtual VUtil::vRef<VOS::Property> getCollisionDetectionObj() ;
00075         //@}
00076 
00077         /// A general ambient light to apply to all objects in the sector.
00078         //@{
00079         void setAmbientLightColor(float r, float g, float b);
00080         void getAmbientLightColor(float& r, float& g, float& b);
00081         VUtil::vRef<VOS::Property> getAmbientLightColorObj() ;
00082         //@}
00083 
00084         /// A message for clients to display upon initially joining the sector.
00085         //@{
00086         void setWelcomeMessage(const std::string& msg, const std::string& type = "text/plain");
00087         std::string getWelcomeMessage();
00088         std::string getWelcomeMessageDataType();
00089         VUtil::vRef<VOS::Property> getWelcomeMessageObj();
00090         //@}
00091     };
00092 }
00093 
00094 #endif