Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-01-21 14:41:35 +0000
committerStijn Buys <ingar@osirion.org>2011-01-21 14:41:35 +0000
commit035653e94a3d74b8f18c993034199d7cd08a895a (patch)
tree6acc56c14a86b499657b6e7faaf50f9e6f7ff57d /src/model/vertexarray.h
parent4af61dca099d2b7010d4fa83833ceeeef01b0b0f (diff)
Support structures for complex entity collision,
renamed sv_arrysize cvar to mem_vertex.
Diffstat (limited to 'src/model/vertexarray.h')
-rw-r--r--src/model/vertexarray.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/model/vertexarray.h b/src/model/vertexarray.h
index 9a71811..1474c67 100644
--- a/src/model/vertexarray.h
+++ b/src/model/vertexarray.h
@@ -15,7 +15,7 @@ namespace model
// number of segments in a sphere circle, must be uneven
const int SPHERESEGMENTS = 65;
-/// global vertex array
+/// global geometry vertex array
/** a VertexArray acts like a stack of model vertices, it has no knowledge of what it is holding
*/
class VertexArray
@@ -35,51 +35,50 @@ public:
/// true when the array is full
inline bool overflow() const {
- return vertex_overflow;
+ return vertexarray_overflow;
}
/// return true if the vertex data has changed and needs to uploaded to video memory
inline bool dirty() const {
- return vertex_dirty;
+ return vertexarray_dirty;
}
/// pointer to model vertices, sequential in GL_T2F_N3F_V3F format
inline const float *ptr() const {
- return vertex_data;
+ return vertexarray_data;
}
/// size of the vertex array in number of floats (for a single array)
inline size_t size() const {
- return vertex_size;
+ return vertexarray_size;
}
/// number of allocated floats
inline size_t index() const {
- return vertex_index;
+ return vertexarray_index;
}
inline void set_dirty(const bool dirty = true) {
- vertex_dirty = dirty;
+ vertexarray_dirty = dirty;
}
static inline VertexArray *instance() {
- return vertex_instance;
+ return vertexarray_instance;
}
private:
- /// model vertices, sequential in GL_T2F_N3F_V3F format
- float *vertex_data;
-
- size_t vertex_index;
- size_t vertex_size;
-
void add_sphere();
+
+ size_t vertexarray_index;
+ size_t vertexarray_size;
+
+ /// model vertices, sequential in GL_T2F_N3F_V3F format
+ float *vertexarray_data;
- static VertexArray *vertex_instance;
-
- bool vertex_overflow;
+ bool vertexarray_overflow;
+ bool vertexarray_dirty;
- bool vertex_dirty;
+ static VertexArray *vertexarray_instance;
};
}