00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00035 #include "SO3SkyAstronomicalModel.h" 00036 #include "SO3Sky.h" 00037 #include "SO3Environment.h" 00038 #include "SO3Sun.h" 00039 #include "SO3Moon.h" 00040 00041 namespace SO3 00042 { 00043 00044 SSkyAstronomicalModel::SSkyAstronomicalModel(SSky* parentSky) 00045 { 00046 assert(parentSky != 0); 00047 sun = parentSky->GetEnvironment()->GetSun(); 00048 moon = parentSky->GetEnvironment()->GetMoon(); 00049 } 00050 00051 SSkyAstronomicalModel::SSkyAstronomicalModel() 00052 { 00053 // Forbiden (private) 00054 } 00055 00056 SSkyAstronomicalModel::~SSkyAstronomicalModel() 00057 { 00058 } 00059 00060 const Ogre::Vector3 SSkyAstronomicalModel::getSunDirection() 00061 { 00062 return sun->GetLightDirection(); 00063 } 00064 00065 const Ogre::Vector3 SSkyAstronomicalModel::getMoonDirection() 00066 { 00067 return moon->GetLightDirection(); 00068 } 00069 00070 const Ogre::Real SSkyAstronomicalModel::getMoonPhase() 00071 { 00072 return moon->GetPhase(); 00073 } 00074 00075 void SSkyAstronomicalModel::update(const Ogre::Real& advanceTime) 00076 { 00077 // Nothing to do in this implementation, simulation advance is managed elsewhere. 00078 } 00079 00080 }
1.6.3