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];
145 entry_list_.push_back(
Entry(vert,norm,col,texc));
146 entry_list_.back().c[3] = opacity_;
147 return entry_list_.size()-1;
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);
Three dimensional vector class, using Real precision.
IndexedVertexArray(const IndexedVertexArray &va)
void SetColorMaterial(bool f)
geom::Vec2 GetTexCoord(VertexID id) const
void SetOutlineWidth(float f)
void SetLineHalo(float lh)
void CalcNormals(float smoothf)
void UseTex(bool b)
experimental
void SetNormal(VertexID id, const geom::Vec3 &n)
static unsigned int GetFormat()
TriID AddTri(VertexID id0, VertexID id1, VertexID id2)
float GetOutlineExpandFactor() const
void SetOutlineExpandFactor(float f)
void AddIcoSphere(const SpherePrim &prim, unsigned int detail)
void SetTexCoord(VertexID id, const geom::Vec2 &t)
VertexID Add(const geom::Vec3 &vert, const geom::Vec3 &norm, const Color &col, const geom::Vec2 &texc=geom::Vec2())
void SetPointSize(float ps)
std::vector< NormalizerTriEntry > NTEntryList
const IndexList & GetQuadIndices() const
void SetColor(VertexID id, const Color &c)
uint & TexID()
experimental
void RenderPov(PovState &pov, const std::string &name)
std::vector< NormalizerVertexEntry > NVEntryList
void Export(Exporter *ex) const
IndexedVertexArray & operator=(const IndexedVertexArray &va)
QuadID AddQuad(VertexID id0, VertexID id1, VertexID id2, VertexID id3)
float GetClipOffset() const
Color GetSolidcolor() const
void SmoothVertices(float smoothf)
const IndexList & GetTriIndices() const
Color GetOutlineExpandColor() const
void SetLineWidth(float lw)
std::vector< VertexID > IndexList
const EntryList & GetEntries() const
void DumpVertices() const
void SetVert(VertexID id, const geom::Vec3 &v)
std::vector< Entry > EntryList
float GetOutlineWidth() const
void SetSolidColor(const Color &c)
unsigned int GetVertexCount() const
geom::Vec3 GetNormal(VertexID id) const
const IndexList & GetLineIndices() const
void SetClipOffset(float f)
void SetOutlineMaterial(const Material &m)
void AddCylinder(const CylinderPrim &prim, unsigned int detail, bool cap=false)
geom::Vec3 GetVert(VertexID id) const
void AddSphere(const SpherePrim &prim, unsigned int detail)
void SmoothNormals(float smoothf)
int GetOutlineMode() const
geom::AlignedCuboid GetBoundingBox() const
return min/max of vertex entries - this call is not cached!
void SetOutlineExpandColor(const Color &c)
Color GetColor(VertexID id) const
void SetOutlineMode(int m)
LineID AddLine(VertexID id0, VertexID id1)
TriID AddTriN(VertexID id0, VertexID id1, VertexID id2)
#define DLLEXPORT_OST_GFX
Entry(const geom::Vec3 &vv, const geom::Vec3 &nn, const Color &cc, const geom::Vec2 &tt)