19 #ifndef OST_VERTEX_ARRAY_HH
20 #define OST_VERTEX_ARRAY_HH
44 namespace ost {
namespace gfx {
55 v[0]=0.0; v[1]=0.0; v[2]=0.0;
56 n[0]=0.0; n[1]=0.0; n[2]=1.0;
57 c[0]=0.0; c[1]=0.0; c[2]=0.0; c[3]=0.0;
64 v[0]=vv[0]; v[1]=vv[1]; v[2]=vv[2];
65 n[0]=nn[0]; n[1]=nn[1]; n[2]=nn[2];
66 c[0]=cc[0]; c[1]=cc[1]; c[2]=cc[2]; c[3]=cc[3];
67 t[0]=tt[0]; t[1]=tt[1];
100 static unsigned int GetFormat();
113 void SetPolyMode(
int m);
115 void SetLighting(
bool f);
116 void SetTwoSided(
bool f);
117 void SetCullFace(
bool f);
118 void SetColorMaterial(
bool f);
119 void SetLineWidth(
float lw);
120 void SetAALines(
bool f);
121 void SetPointSize(
float ps);
122 void SetLineHalo(
float lh);
124 void SetOutlineMode(
int m);
126 void SetOutlineWidth(
float f);
128 void SetOutlineMaterial(
const Material& m);
129 void SetOutlineExpandFactor(
float f);
131 void SetOutlineExpandColor(
const Color& c);
145 entry_list_.push_back(
Entry(vert,norm,col,texc));
146 entry_list_.back().c[3] = opacity_;
147 return entry_list_.size()-1;
150 unsigned int GetVertexCount()
const;
151 void DumpVertices()
const;
166 void AddSphere(
const SpherePrim& prim,
unsigned int detail);
169 void AddIcoSphere(
const SpherePrim& prim,
unsigned int detail);
171 void AddCylinder(
const CylinderPrim& prim,
unsigned int detail,
bool cap=
false);
173 void SetOpacity(
float o);
179 void RenderPov(
PovState& pov,
const std::string& name);
192 void DrawNormals(
bool f);
198 void CalcNormals(
float smoothf);
200 void CalcFullNormals();
202 void SmoothNormals(
float smoothf);
206 void SmoothVertices(
float smoothf);
224 if(
id>=entry_list_.size())
return nrvo;
231 if(
id>=entry_list_.size())
return;
232 entry_list_[id].v[0]=v[0];
233 entry_list_[id].v[1]=v[1];
234 entry_list_[id].v[2]=v[2];
240 if(
id>=entry_list_.size())
return nrvo;
247 if(
id>=entry_list_.size())
return;
248 entry_list_[id].n[0]=n[0];
249 entry_list_[id].n[1]=n[1];
250 entry_list_[id].n[2]=n[2];
256 if(
id>=entry_list_.size())
return nrvo;
257 nrvo =
Color(entry_list_[
id].c[0],
258 entry_list_[
id].c[1],
259 entry_list_[
id].c[2],
260 entry_list_[
id].c[3]);
266 if(
id>=entry_list_.size())
return;
267 entry_list_[id].c[0]=c[0];
268 entry_list_[id].c[1]=c[1];
269 entry_list_[id].c[2]=c[2];
270 entry_list_[id].c[3]=opacity_;
276 if(
id>=entry_list_.size())
return nrvo;
283 if(
id>=entry_list_.size())
return;
284 entry_list_[id].t[0]=t[0];
285 entry_list_[id].t[1]=t[1];
290 EntryList entry_list_;
291 IndexList quad_index_list_;
292 IndexList tri_index_list_;
293 IndexList line_index_list_;
294 NTEntryList ntentry_list_;
311 float outline_width_;
313 bool outline_mat_update_;
314 unsigned int outline_mat_dlist_;
315 float outline_exp_factor_;
316 Color outline_exp_color_;
325 unsigned int buffer_id_[7];
329 void draw_ltq(
bool use_buff);
330 void draw_p(
bool use_buff);
332 void draw_line_halo(
bool use_buff);
333 void set_clip_offset(
float);
void SetColor(VertexID id, const Color &c)
const EntryList & GetEntries() const
std::vector< NormalizerVertexEntry > NVEntryList
std::vector< NormalizerTriEntry > NTEntryList
void SetClipOffset(float f)
VertexID Add(const geom::Vec3 &vert, const geom::Vec3 &norm, const Color &col, const geom::Vec2 &texc=geom::Vec2())
Color GetColor(VertexID id) const
float GetOutlineWidth() const
float GetClipOffset() const
geom::Vec3 GetVert(VertexID id) const
void SetVert(VertexID id, const geom::Vec3 &v)
const IndexList & GetLineIndices() const
#define DLLEXPORT_OST_GFX
const IndexList & GetTriIndices() const
void SetSolidColor(const Color &c)
void UseTex(bool b)
experimental
geom::Vec3 GetNormal(VertexID id) const
Three dimensional vector class, using Real precision.
std::vector< VertexID > IndexList
ImageStateConstModIPAlgorithm< ClearFnc > Clear
std::vector< Entry > EntryList
Entry(const geom::Vec3 &vv, const geom::Vec3 &nn, const Color &cc, const geom::Vec2 &tt)
uint & TexID()
experimental
float GetOutlineExpandFactor() const
geom::Vec2 GetTexCoord(VertexID id) const
Color GetSolidcolor() const
const IndexList & GetQuadIndices() const
void SetTexCoord(VertexID id, const geom::Vec2 &t)
int GetOutlineMode() const
void SetNormal(VertexID id, const geom::Vec3 &n)
Color GetOutlineExpandColor() const