00001 /* -*- C++ -*- */ 00002 00003 /* COPYRIGHT 00004 * 00005 * This file is part of the Simple Object Loader and Renderer - SOLAR 00006 * 00007 * Read the file "SOLAR-LICENSE" for the license. 00008 * 00009 * Authors & Copyright: 00010 * 00011 * Tommi Ilmonen, 2001-2003, except LWO-code by RJ, 2001-2003 00012 * 00013 * Tommi's email: firstname.lastname@hut.fi 00014 * 00015 */ 00016 00017 #ifndef SOLAR_OBJECT_HPP 00018 #define SOLAR_OBJECT_HPP 00019 00020 #include <Fluid/Matrix3.hpp> 00021 #include <Fluid/Vector3.hpp> 00022 00023 namespace Solar { 00024 00025 class Model; 00026 class Renderer; 00027 00032 class Object 00033 { 00034 public: 00035 Object(); 00036 Object(Model *model); 00037 00038 virtual ~Object() {} 00039 00040 virtual void update(float dt); 00041 00042 void render(Renderer *r); 00043 00044 void setModel(Model *m) { m_model = m; } 00045 Model *getModel() { return m_model; } 00046 00047 Fluid::Matrix3 & getRotation() { return m_rotation; } 00048 const Fluid::Matrix3 & getRotation() const { return m_rotation; } 00049 void setRotation(const Fluid::Matrix3 &v) { m_rotation = v; } 00050 00051 Fluid::Vector3 & getLocation() { return m_location; } 00052 const Fluid::Vector3 & getLocation() const { return m_location; } 00053 void setLocation(const Fluid::Vector3 &v) { m_location = v; } 00054 00055 bool isVisible() const { return m_visible; } 00056 void setVisible(bool v) { m_visible = v; } 00057 00058 float getScale() const { return m_scale; } 00059 void setScale(float s) { m_scale = s; } 00060 00061 protected: 00062 bool m_visible; 00063 Model *m_model; 00064 00065 Fluid::Matrix3 m_rotation; 00066 Fluid::Vector3 m_location; 00067 float m_scale; 00068 }; 00069 00070 } // namespace Solar 00071 00072 #endif