Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model.h')
-rw-r--r--src/core/model.h51
1 files changed, 35 insertions, 16 deletions
diff --git a/src/core/model.h b/src/core/model.h
index eca896b..e22d87a 100644
--- a/src/core/model.h
+++ b/src/core/model.h
@@ -4,19 +4,44 @@
the terms of the GNU General Public License version 2
*/
-#ifndef __INCLUDED_RENDER_MODEL_H__
-#define __INCLUDED_RENDER_MODEL_H__
+#ifndef __INCLUDED_CORE_MODEL_H__
+#define __INCLUDED_CORE_MODEL_H__
+#include <vector>
#include <map>
#include <list>
+#include "math/mathlib.h"
#include "math/plane3f.h"
#include "core/entity.h"
-#include "render/face.h"
-namespace render
+namespace core
{
+/// one face (polygon) of a model
+class Face {
+public:
+ Face(math::Vector3f const & normal, math::Color const *color=0);
+ ~Face();
+
+ /// the normal of this face
+ inline math::Vector3f const & normal() const { return face_normal; };
+
+ /// the color of this face
+ inline math::Color const *color() const { return face_color; };
+
+ /// add a vertex to the face
+ void add_vertex(math::Vector3f const &vertex);
+
+ /// face vertexes
+ std::vector<math::Vector3f *> face_vertex;
+
+private:
+ math::Vector3f face_normal;
+ math::Color *face_color;
+
+};
+
/// a spacecraft engine
class Engine
{
@@ -50,16 +75,6 @@ public:
/// the Model registry
static std::map<std::string, Model*> registry;
- /// draw the model for an entity
- /** This will not draw attached engines, turrents and cannons
- */
- void draw(core::Entity const * entity, math::Vector3f const & eye);
-
- /// draw the model for a controlable enity
- /** This will draw all attached engines, turrents and cannons
- */
- void draw(core::EntityControlable const * entity, math::Vector3f const & eye);
-
/* ---- static functions for the Model registry -------------------- */
/// get name model, returns 0 if not found
@@ -73,14 +88,18 @@ public:
/// list the content of the model registry
static void list();
+
+ /// list of Faces
+ std::list<Face *> model_face;
+
+ /// list of Engines
+ std::list<Engine *> model_engine;
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;