Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/model.h')
-rw-r--r--src/render/model.h32
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;