ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/entity.h
(Generate patch)

Comparing libgender/entity.h (file contents):
Revision 1.30 by root, Tue Nov 2 23:26:46 2004 UTC vs.
Revision 1.35 by root, Tue Aug 9 23:58:43 2005 UTC

1#ifndef ENTITY_H 1#ifndef ENTITY_H
2#define ENTITY_H 2#define ENTITY_H
3 3
4#include <vector> 4#include <vector>
5 5
6#include <iostream>
6#include "opengl.h" 7#include "opengl.h"
7 8
8#include "util.h" 9#include "util.h"
9#include "oct.h" 10#include "oct.h"
10#include "view.h" 11#include "view.h"
77 void set (); 78 void set ();
78}; 79};
79 80
80struct geometry_sphere : geometry 81struct geometry_sphere : geometry
81{ 82{
83 material *m;
82 GLfloat radius; 84 GLfloat radius;
83 85
84 void update (); 86 void update ();
85 void draw (view &ctx); 87 void draw (view &ctx);
86 geometry_sphere (GLfloat radius) : radius(radius) { update (); }; 88 geometry_sphere (material *m, GLfloat radius) : m(m), radius(radius) { update (); };
89};
90
91struct geometry_indexed_2d : geometry
92{
93 material *m;
94
95 GLenum type;
96
97 vertex_buffer vb;
98 index_buffer ib;
99
100 void draw (view &ctx);
101
102 template <typename vertex, typename index>
103 geometry_indexed_2d (material *m, GLenum type, const vector<vertex> &v, const vector<index> &i)
104 : m(m), type(type)
105 {
106 vb.set (v);
107 ib.set (i);
108
109 bbox.reset ();
110 for (typename vector<vertex>::const_iterator i = v.begin () ; i != v.end (); ++i)
111 bbox.add (i->v);
112 }
113
87}; 114};
88 115
89///////////////////////////////////////////////////////////////////////////// 116/////////////////////////////////////////////////////////////////////////////
90 117
91struct geometry_filter : geometry 118struct geometry_filter : geometry
156 183
157 entity (geometry *g = 0); 184 entity (geometry *g = 0);
158 ~entity (); 185 ~entity ();
159}; 186};
160 187
188struct entity_moveable : entity
189{
190 vec3 v;
191 entity_moveable (geometry *g = 0) : entity (g) { }
192
193 void perform_step (double t);
194};
195
161struct entity_light : entity 196struct entity_light : entity
162{ 197{
163 light *lview; 198 light *lview;
199};
200
201/////////////////////////////////////////////////////////////////////////////
202// not the final API(!)
203
204struct skybox
205{
206 texture *tex[6];
207
208 skybox (
209 const char *left,
210 const char *front,
211 const char *right,
212 const char *back,
213 const char *top,
214 const char *bottom
215 );
216
217 ~skybox ();
218
219 void draw (view &ctx);
164}; 220};
165 221
166///////////////////////////////////////////////////////////////////////////// 222/////////////////////////////////////////////////////////////////////////////
167// 223//
168// VERY EXPERIMENTAL HEIGHTMAP 224// VERY EXPERIMENTAL HEIGHTMAP

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines