diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-02 22:55:30 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-02 22:55:30 +0000 |
commit | e379b1bfeb231716e07f0e4ae9ef024be9bfd08f (patch) | |
tree | 6258754959e820a9a94726a4b1a119c301581111 /src/render/model.h | |
parent | 6e08b92bd4f3e32fdf550f0a3e950e3101a1b06f (diff) |
added target_engine support
Diffstat (limited to 'src/render/model.h')
-rw-r--r-- | src/render/model.h | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/render/model.h b/src/render/model.h index ab6207e..dfde809 100644 --- a/src/render/model.h +++ b/src/render/model.h @@ -10,11 +10,25 @@ #include <map> #include <list> -#include "render/face.h" #include "math/plane3f.h" +#include "core/entity.h" +#include "render/face.h" namespace render { +/// a spacecraft engine +class Engine +{ +public: + Engine(math::Vector3f const & location); + ~Engine(); + + inline math::Vector3f const & location() const { return engine_location; } + +private: + math::Vector3f engine_location; +}; + /// a 3D model contains a list of faces class Model { @@ -26,13 +40,18 @@ public: /// the name of the model inline std::string const & name() const { return model_name; } - void add_face(Face *face); - /// the Model registry static std::map<std::string, Model*> registry; - /// draw the model - void draw(); + /// draw the model for an entity + /** This will not draw attached engines, turrents and cannons + */ + void draw(core::Entity const * entity); + + /// draw the model for a controlable enity + /** This will draw all attached engines, turrents and cannons + */ + void draw(core::EntityControlable const * entity); /* ---- static functions for the Model registry -------------------- */ @@ -47,8 +66,11 @@ public: private: void make_face(math::Plane3f *face, std::vector<math::Plane3f *> & planes); + void add_engine(Engine *engine); + void add_face(Face *face); std::list<Face *> model_face; + std::list<Engine *> model_engine; std::string model_name; float model_scale; |