00001 #ifndef PERIAPSIS_SPACE_SPACECRAFT_H 00002 #define PERIAPSIS_SPACE_SPACECRAFT_H 00003 00004 // 00005 // $Id: spacecraft.hpp 2 2008-03-01 20:58:50Z kulibali $ 00006 // 00007 // Copyright (c) 2008, The Periapsis Project. All rights reserved. 00008 // 00009 // Redistribution and use in source and binary forms, with or without 00010 // modification, are permitted provided that the following conditions are 00011 // met: 00012 // 00013 // * Redistributions of source code must retain the above copyright notice, 00014 // this list of conditions and the following disclaimer. 00015 // 00016 // * Redistributions in binary form must reproduce the above copyright 00017 // notice, this list of conditions and the following disclaimer in the 00018 // documentation and/or other materials provided with the distribution. 00019 // 00020 // * Neither the name of the The Periapsis Project nor the names of its 00021 // contributors may be used to endorse or promote products derived from 00022 // this software without specific prior written permission. 00023 // 00024 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 00025 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00026 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00027 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 00028 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00029 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00030 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00031 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00032 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00033 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00034 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 // 00036 00037 #include "space/space.hpp" 00038 #include "data/broker.hpp" 00039 #include "physics/vehicle.hpp" 00040 #include "physics/vehicle_module.hpp" 00041 00042 namespace periapsis 00043 { 00044 00045 namespace space 00046 { 00047 00048 class SPACE_API spacecraft_module 00049 : public gsgl::physics::vehicle_module 00050 { 00051 public: 00052 spacecraft_module(const gsgl::data::config_record & obj_config); 00053 virtual ~spacecraft_module(); 00054 }; // class spacecraft_module 00055 00056 00057 class SPACE_API spacecraft 00058 : public gsgl::physics::vehicle 00059 { 00060 public: 00061 spacecraft(const gsgl::data::config_record & obj_config); 00062 virtual ~spacecraft(); 00063 00064 /// \name node implementation 00065 /// @{ 00066 virtual void init(gsgl::scenegraph::context *c); 00067 virtual void draw(gsgl::scenegraph::context *c); 00068 virtual void update(gsgl::scenegraph::context *c); 00069 virtual void cleanup(gsgl::scenegraph::context *c); 00070 /// @} 00071 00072 /// \name rigid_body implementation 00073 /// @{ 00074 virtual void calculate_force_and_torque(const double & t, gsgl::math::vector & force, gsgl::math::vector & torque); 00075 /// @} 00076 00077 BROKER_DECLARE_CREATOR(periapsis::space::spacecraft); 00078 }; // class spacecraft 00079 00080 00081 } // namespace space 00082 00083 } // namespace periapsis 00084 00085 #endif