Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/entity.cc3
-rw-r--r--src/core/entity.h2
-rw-r--r--src/core/model.cc25
3 files changed, 24 insertions, 6 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 891c758..36868af 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -98,6 +98,9 @@ Entity::Entity(unsigned int flags) :
entity_destroyed = false;
entity_dirty = false;
+ entity_modelname.clear();
+ entity_name.clear();
+
add(this);
}
diff --git a/src/core/entity.h b/src/core/entity.h
index d887bc1..0eda501 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -33,7 +33,7 @@ public:
enum Type {Default=0, Dynamic=1, Controlable=2};
/// Entity shape constants
- enum Shape {Diamond=0, Sphere=1, Cube=2};
+ enum Shape {Diamond=0, Sphere=1, Cube=2, Axis=3};
/// create a new entity and add it to the registry
Entity(unsigned int flags = 0);
diff --git a/src/core/model.cc b/src/core/model.cc
index 1e571c3..52f0dde 100644
--- a/src/core/model.cc
+++ b/src/core/model.cc
@@ -453,16 +453,31 @@ void Model::make_face(math::Plane3f *face, std::vector<math::Plane3f *> & planes
color = 0;
} else
color = new math::Color(1.0f, 0.0, 1.0f);
-
+
+ /*
+ // split face into triangles
+ while (vl.size() >2 ) {
+ std::vector<Vector3f *>::iterator v0 = vl.begin();
+ std::vector<Vector3f *>::reverse_iterator vn = vl.rbegin();
+ std::vector<Vector3f *>::reverse_iterator vn1 = vl.rbegin();
+ ++vn1;
+ */
Face *mf = new Face(face->normal()*-1, color);
- if (color) delete color;
-
for (std::vector<Vector3f *>::iterator it = vl.begin(); it != vl.end(); it++) {
mf->add_vertex(*(*it) * model_scale);
}
-
- //con_debug << "adding face\n";
add_face(mf);
+ /*
+ mf->add_vertex(*(*vn) * model_scale);
+ mf->add_vertex(*(*v0) * model_scale);
+ mf->add_vertex(*(*vn1) * model_scale);
+ add_face(mf);
+
+ vl.pop_back();
+ }
+ */
+
+ if (color) delete color;
} else {
con_debug << "Unresolved face!\n";
}