From e379b1bfeb231716e07f0e4ae9ef024be9bfd08f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 2 Mar 2008 22:55:30 +0000 Subject: added target_engine support --- src/render/model.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/render/model.h') 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 #include -#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 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 & planes); + void add_engine(Engine *engine); + void add_face(Face *face); std::list model_face; + std::list model_engine; std::string model_name; float model_scale; -- cgit v1.2.3