From df61a28d708c30e3e77d1f739dfb4561c042c89c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 6 Mar 2008 22:59:40 +0000 Subject: moved render::Model to core::Model --- src/core/model.h | 51 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 16 deletions(-) (limited to 'src/core/model.h') 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 #include #include +#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 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 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 model_face; + + /// list of Engines + std::list model_engine; 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