47 VL_DEBUG_SET_OBJECT_NAME()
61 Log::debug(
"Geometry::computeBounds_Implementation() failed! No vertex buffer present!\n");
65 if (coords->
size() == 0)
67 Log::debug(
"Geometry::computeBounds_Implementation() failed! No vertices present in the local buffer! Did you forget to call setBoundingBox() and setBoundingSphere()?\n");
72 for(
size_t i=0; i<
drawCalls().size(); ++i)
80 real radius = 0, r = 0;
82 for(
size_t i=0; i<
drawCalls().size(); ++i)
106 super::operator=(other);
120 for(
size_t i=0; i<other.
mDrawCalls.size(); ++i) {
137 super::operator=(other);
170 data->
glType() == GL_SHORT ||
171 data->
glType() == GL_INT ||
172 data->
glType() == GL_FLOAT ||
173 data->
glType() == GL_DOUBLE) );
184 data->
glType() == GL_SHORT ||
185 data->
glType() == GL_INT ||
186 data->
glType() == GL_UNSIGNED_BYTE ||
187 data->
glType() == GL_UNSIGNED_SHORT ||
188 data->
glType() == GL_UNSIGNED_INT ||
189 data->
glType() == GL_FLOAT ||
190 data->
glType() == GL_DOUBLE) );
201 data->
glType() == GL_SHORT ||
202 data->
glType() == GL_INT ||
203 data->
glType() == GL_UNSIGNED_BYTE ||
204 data->
glType() == GL_UNSIGNED_SHORT ||
205 data->
glType() == GL_UNSIGNED_INT ||
206 data->
glType() == GL_FLOAT ||
207 data->
glType() == GL_DOUBLE) );
228 data->
glType() == GL_DOUBLE ||
229 data->
glType() == GL_SHORT ||
230 data->
glType() == GL_INT) );
241 if (clear_draw_calls) {
259 for(
u32 i=0; i<norm3f->
size(); ++i)
261 norm3f->
at(i) = -norm3f->
at(i);
273 if (!posarr || posarr->
size() == 0)
275 Log::warning(
"Geometry::computeNormals() failed: no vertices found!\n");
286 for(
u32 i=0; i<norm3f->
size(); ++i)
290 for(
int prim=0; prim<(int)
drawCalls().size(); prim++)
300 if (a == b || b == c || c == a)
302 Log::warning(
Say(
"Geometry::computeNormals(): skipping degenerate triangle %n %n %n\n") << a << b << c );
317 if (v0 == v1 || v1 == v2 || v2 == v0)
319 Log::warning(
"Geometry::computeNormals(): skipping degenerate triangle (same vertex coodinate).\n");
329 if ( fabs(1.0f - n.
length()) > 0.1f )
331 Log::warning(
"Geometry::computeNormals(): skipping degenerate triangle (normalization failed).\n");
335 (*norm3f)[a] += (
fvec3)n;
336 (*norm3f)[b] += (
fvec3)n;
337 (*norm3f)[c] += (
fvec3)n;
342 for(
int i=0; i<(int)norm3f->
size(); ++i)
351 for(
int i=0; i<(int)
drawCalls().size(); ++i) {
375 for(
size_t i=0; i<
drawCalls().size(); ++i)
376 drawCalls().at(i)->updateDirtyBufferObject(mode);
386 gl_ctx->
bindVAS(
this, vbo_on,
false);
390 for(
int i = 0; i < (int)
drawCalls().size(); i++ ) {
437 std::vector< ref<DrawElementsBase> > de_vector;
438 std::vector<u32> indices;
447 de_vector.push_back( deb );
452 std::reverse(de_vector.begin(), de_vector.end());
455 indices.reserve( posarr->
size()*2 );
456 for(
u32 i=0; i<de_vector.size(); ++i)
459 for(
IndexIterator it=de_vector[i]->indexIterator(); it.hasNext(); it.next(), ++index_count)
460 indices.push_back(it.index());
462 if (index_count == 0)
466 if ( index_count % 2 )
467 indices.push_back( indices.back() );
470 if ( i != de_vector.size()-1 )
478 if (A == -1 || B == -1)
481 indices.push_back( indices.back() );
482 indices.push_back(A);
483 indices.push_back(A);
484 indices.push_back(B);
492 memcpy(draw_elems->
indexBuffer()->
ptr(), &indices[0],
sizeof(indices[0])*indices.size());
494 return draw_elems.
get();
502 u32 total_index_count = 0;
503 std::vector< ref<DrawCall> > mergendo_calls;
506 if (
drawCalls().at(i)->primitiveType() == primitive_type)
508 int index_count =
drawCalls().at(i)->countIndices();
510 total_index_count += index_count;
512 mergendo_calls.push_back(
drawCalls().at(i) );
517 std::reverse(mergendo_calls.begin(), mergendo_calls.end());
519 Log::debug(
Say(
"%n draw calls will be merged using primitive restart.\n") << mergendo_calls.size() );
521 if (mergendo_calls.empty())
530 de_prim_restart->
indexBuffer()->
resize(total_index_count + mergendo_calls.size()-1);
533 for(
u32 i=0; i<mergendo_calls.size(); ++i )
535 for(
IndexIterator it = mergendo_calls[i]->indexIterator(); it.hasNext(); it.next(), ++index )
540 if ( i != mergendo_calls.size() -1 )
556 u32 total_index_count = 0;
557 std::vector< ref<DrawCall> > mergendo_calls;
558 std::vector<GLsizei> count_vector;
561 if (
drawCalls().at(i)->primitiveType() == primitive_type)
563 int index_count =
drawCalls().at(i)->countIndices();
565 total_index_count += index_count;
566 count_vector.push_back( index_count );
567 mergendo_calls.push_back(
drawCalls().at(i) );
572 std::reverse(mergendo_calls.begin(), mergendo_calls.end());
573 std::reverse(count_vector.begin(), count_vector.end());
575 Log::debug(
Say(
"%n draw calls will be merged using MultiDrawElements.\n") << mergendo_calls.size() );
577 if (mergendo_calls.empty())
589 for(
u32 i=0; i<mergendo_calls.size(); ++i )
591 for(
IndexIterator it = mergendo_calls[i]->indexIterator(); it.hasNext(); it.next(), ++index )
607 u32 triangle_count = 0;
608 std::vector< ref<DrawCall> > mergendo_calls;
631 mergendo_calls.insert( mergendo_calls.begin(),
drawCalls().at(i) );
636 std::reverse(mergendo_calls.begin(), mergendo_calls.end());
638 if (mergendo_calls.empty())
642 if ( mergendo_calls.size() == 1 && mergendo_calls[0]->primitiveType() ==
PT_TRIANGLES )
644 drawCalls().push_back( mergendo_calls[0].
get() );
654 index_buffer.
resize( triangle_count * 3 );
656 for(
u32 i=0; i<mergendo_calls.size(); ++i)
658 for(
TriangleIterator it = mergendo_calls[i]->triangleIterator(); it.hasNext(); it.next(), idx+=3)
662 index_buffer[idx+0] = it.a();
663 index_buffer[idx+1] = it.b();
664 index_buffer[idx+2] = it.c();
668 VL_CHECK( it.a() >= 0 && it.b() >= 0 && it.c() >= 0 );
682 if ( normarr ==
NULL || posarr ==
NULL )
685 u32 triangle_count = 0;
686 std::vector< ref<DrawCall> > mergendo_calls;
707 mergendo_calls.insert( mergendo_calls.begin(),
drawCalls().at(i) );
711 std::reverse(mergendo_calls.begin(), mergendo_calls.end());
714 ArrayUInt1& index_buffer = *de->indexBuffer();
715 index_buffer.
resize( triangle_count * 3 );
717 for(
u32 i=0; i<mergendo_calls.size(); ++i)
719 for(
TriangleIterator it = mergendo_calls[i]->triangleIterator(); it.hasNext(); it.next(), idx+=3)
737 index_buffer[idx+0] = it.a();
738 index_buffer[idx+1] = it.b();
739 index_buffer[idx+2] = it.c();
743 index_buffer[idx+0] = it.a();
744 index_buffer[idx+1] = it.c();
745 index_buffer[idx+2] = it.b();
749 VL_CHECK( it.a() < (int)posarr->
size() && it.b() < (int)posarr->
size() && it.c() < (int)posarr->
size() );
750 VL_CHECK( it.a() >= 0 && it.b() >= 0 && it.c() >= 0 );
771 std::vector<u32> map_new_to_old;
772 map_new_to_old.reserve( posarr ? (posarr->
size() * 3) : (1024 * 64) );
776 int start = (int)map_new_to_old.size();
778 map_new_to_old.push_back(it.index());
779 int count = (int)map_new_to_old.size() - start;
793 for(
int idraw=this->
drawCalls().size(); idraw--; )
830 for(
int idraw=this->
drawCalls().size(); idraw--; )
843 if (restart_on && it.index() == (int)restart_idx)
846 max_idx = it.index() > max_idx ? it.index() : max_idx;
850 if ( max_idx < 0xFF || (max_idx == 0xFF && !restart_on) )
852 if (dc->isOfType(DrawElementsBase::Type()))
865 if (restart_on && it.index() == (int)restart_idx)
878 if (dc->isOfType(DrawRangeElementsBase::Type()))
894 if (restart_on && it.index() == (int)restart_idx)
904 if (dc->isOfType(MultiDrawElementsBase::Type()))
913 if (restart_on && it.index() == (int)restart_idx)
931 if ( max_idx < 0xFFFF || (max_idx == 0xFFFF && !restart_on) )
933 if (dc->isOfType(DrawElementsBase::Type()))
946 if (restart_on && it.index() == (int)restart_idx)
959 if (dc->isOfType(DrawRangeElementsBase::Type()))
975 if (restart_on && it.index() == (int)restart_idx)
985 if (dc->isOfType(MultiDrawElementsBase::Type()))
994 if (restart_on && it.index() == (int)restart_idx)
1023 for(
size_t i=0; i<
drawCalls().size(); ++i)
1033 case GL_TRIANGLE_STRIP:
1034 case GL_TRIANGLE_FAN:
1047 Log::error(
"Geometry::makeGLESFriendly(): primitive type illegal under GLES, draw call disabled.\n");
1063 Log::warning(
"Geometry::sortVertices() failed. No vertices found.\n");
1069 std::vector< ref<DrawElementsUInt> > de_u32_set;
1072 for(
size_t i=0; i<
drawCalls().size(); ++i)
1077 Log::error(
"Geometry::sortVertices() does not support DrawCalls with primitive restart enabled.\n");
1087 de_u32_set.push_back(de);
1096 de_u32_set.push_back(de);
1098 for(
unsigned int j=0; j<de_u16->indexBuffer()->size(); ++j)
1099 de->
indexBuffer()->
at(j) = de_u16->indexBuffer()->at(j) + de_u16->baseVertex();
1105 de_u32_set.push_back(de);
1107 for(
unsigned int j=0; j<de_u8->indexBuffer()->size(); ++j)
1108 de->
indexBuffer()->
at(j) = de_u8->indexBuffer()->at(j) + de_u8->baseVertex();
1112 Log::error(
"Geometry::sortVertices() supports only DrawElements* draw calls.\n");
1121 std::vector<u32> map_new_to_old;
1122 map_new_to_old.resize( posarr->
size() );
1123 memset(&map_new_to_old[0], 0xFF, map_new_to_old.size()*
sizeof(map_new_to_old[0]));
1125 std::vector<u32> map_old_to_new;
1126 map_old_to_new.resize( posarr->
size() );
1127 memset(&map_old_to_new[0], 0xFF, map_old_to_new.size()*
sizeof(map_old_to_new[0]));
1129 std::vector<u32> used;
1130 used.resize( posarr->
size() );
1131 memset(&used[0], 0, used.size()*
sizeof(used[0]));
1135 for(
u32 i=0; i<de_u32_set.size(); ++i)
1137 ArrayUInt1* index_buffer = de_u32_set[i]->indexBuffer();
1138 for(
u32 idx=0; idx<index_buffer->
size(); ++idx)
1140 if (!used[index_buffer->
at(idx)])
1143 map_new_to_old[new_idx] = old_idx;
1144 map_old_to_new[old_idx] = new_idx;
1155 for(
u32 i=0; i<de_u32_set.size(); ++i)
1157 drawCalls().push_back(de_u32_set[i].
get());
1158 ArrayUInt1* index_buffer = de_u32_set[i]->indexBuffer();
1159 for(
u32 j=0; j<index_buffer->
size(); ++j)
1161 index_buffer->
at(j) = map_old_to_new[index_buffer->
at(j)];
1180 for(
size_t i=0; i<
drawCalls().size(); ++i)
1183 c.
r() = rand()%100 / 99.0f;
1184 c.
g() = rand()%100 / 99.0f;
1185 c.
b() = rand()%100 / 99.0f;
1189 col->
at( it.index() ) = c;
1195 const fvec3 *vertex,
1196 const fvec3* normal,
1197 const fvec2 *texcoord,
1202 std::vector<fvec3> tan1;
1203 std::vector<fvec3> tan2;
1204 tan1.resize(vert_count);
1205 tan2.resize(vert_count);
1209 int tri[] = { trit.a(), trit.b(), trit.c() };
1211 VL_CHECK(tri[0] < (
int)vert_count );
1212 VL_CHECK(tri[1] < (
int)vert_count );
1213 VL_CHECK(tri[2] < (
int)vert_count );
1215 const fvec3& v1 = vertex[tri[0]];
1216 const fvec3& v2 = vertex[tri[1]];
1217 const fvec3& v3 = vertex[tri[2]];
1219 const fvec2& w1 = texcoord[tri[0]];
1220 const fvec2& w2 = texcoord[tri[1]];
1221 const fvec2& w3 = texcoord[tri[2]];
1223 float x1 = v2.
x() - v1.
x();
1224 float x2 = v3.
x() - v1.
x();
1225 float y1 = v2.
y() - v1.
y();
1226 float y2 = v3.
y() - v1.
y();
1227 float z1 = v2.
z() - v1.
z();
1228 float z2 = v3.
z() - v1.
z();
1230 float s1 = w2.
x() - w1.
x();
1231 float s2 = w3.
x() - w1.
x();
1232 float t1 = w2.
y() - w1.
y();
1233 float t2 = w3.
y() - w1.
y();
1235 float r = 1.0F / (s1 * t2 - s2 * t1);
1236 fvec3 sdir((t2 * x1 - t1 * x2) * r, (t2 * y1 - t1 * y2) * r, (t2 * z1 - t1 * z2) * r);
1237 fvec3 tdir((s1 * x2 - s2 * x1) * r, (s1 * y2 - s2 * y1) * r, (s1 * z2 - s2 * z1) * r);
1239 tan1[tri[0]] += sdir;
1240 tan1[tri[1]] += sdir;
1241 tan1[tri[2]] += sdir;
1243 tan2[tri[0]] += tdir;
1244 tan2[tri[1]] += tdir;
1245 tan2[tri[2]] += tdir;
1248 for (
u32 a = 0; a < vert_count; a++)
1250 const fvec3& n = normal[a];
1251 const fvec3& t = tan1[a];
1259 float w = (
dot(
cross(n, t), tan2[a]) < 0.0F) ? -1.0F : 1.0F;
1260 bitangent[a] =
cross( n, tangent[a] ) * w;
static void debug(const String &message)
Use this function to provide extra information useful to investigate and solve problems.
The ArrayAbstract class defines an abstract interface to conveniently manipulate data stored in a Buf...
Generates a set of new vertices from the old one.
Associates a Renderable object to an Effect and Transform.
int baseVertex() const
Returns the currently used base vertex.
bool hasNext()
Returns false if the iterator has reached the end of the triangle list.
void setBaseVertex(int base_vertex)
If base_vertx is != 0 glDrawElementsBaseVertex/glDrawElementsInstancedBaseVertex will be used instead...
ref< Geometry > shallowCopy() const
Performs a shallow copy of a Geometry.
virtual bool primitiveRestartEnabled() const
Returns whether the primitive-restart functionality is enabled or not.
void setBaseVertex(int base_vertex)
If base_vertx is != 0 glDrawRangeElementsBaseVertex/glDrawRangeElementsInstancedBaseVertex will be us...
const Vector3 & normalize(T_Scalar *len=NULL)
void mergeDrawCallsWithMultiDrawElements(EPrimitiveType primitive_type)
Merges all the draw calls that use the given primitive type into one single MultiDrawElements draw ca...
Vector3< float > fvec3
A 3 components vector with float precision.
ref< ArrayAbstract > mVertexAttribArrays[VA_MaxAttribCount]
const T_VectorType * end() const
Geometry & shallowCopyFrom(const Geometry &)
Performs a shallow copy of the specified Geometry.
virtual void updateDirtyBufferObject(EBufferObjectUpdateMode mode)
Updates all the vertex buffer objects of both vertex arrays and draw calls that are marked as dirty...
A simple String formatting class.
void setBufferObjectDirty(bool dirty=true)
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering...
const std::vector< GLint > & baseVertices() const
Returns the list of base vertices, one for each primitive.
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
virtual void deleteBufferObject()
Deletes all the vertex buffer objects of both vertex arrays and draw calls.
u32 countTriangles() const
Counts the number of virtual triangles of a DrawCall., i.e.
const T_Scalar & z() const
const std::vector< GLsizei > & countVector() const
The count vector used as 'count' parameter of glMultiDrawElements.
const T_Scalar & r() const
const ArrayAbstract * vertexArray() const
Conventional vertex array.
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
Base interface for all MultiDrawElements* sub classes.
static const index_type primitive_restart_index
The special index which identifies a primitive restart. By default it is set to ~0 that is 0xFF...
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
void setVertexArray(ArrayAbstract *data)
Conventional vertex array.
bool sortVertices()
Sorts the vertices of the geometry (position, normals, textures, colors etc.) to maximize vertex-cach...
vec3 center() const
Returns the center of the AABB.
virtual size_t glSize() const =0
Returns the number of scalar components for the array, ie 3 for ArrayFloat3, 1 for ArrayUInt1 etc...
bool isBufferObjectEnabled() const
Returns true if BufferObject (vertex buffer object) are enabled for a Renderable (enabled by default)...
void setBoundingSphere(const Sphere &sphere)
Sets the bounding sphere of a Renderable.
void setNormalArray(ArrayAbstract *data)
Conventional normal array.
void setSecondaryColorArray(ArrayAbstract *data)
Conventional secondary color array.
Matrix4 & invert(T_Scalar *determinant=NULL)
void setColorArray(const fvec4 &color)
Fills the color array with the given color.
fvec3 cross(const fvec3 &v1, const fvec3 &v2)
ref< ArrayAbstract > regenerate(ArrayAbstract *data, const std::vector< u32 > &map_new_to_old) const
Regenerates a new Array based on the given mapping.
static const index_type primitive_restart_index
The special index which identifies a primitive restart. By default it is set to ~0 that is 0xFF...
Geometry & deepCopyFrom(const Geometry &)
Performs a deep copy of the specified Geometry.
static void computeTangentSpace(u32 vert_count, const vl::fvec3 *vertex, const vl::fvec3 *normal, const vl::fvec2 *texcoord, const vl::DrawCall *primitives, vl::fvec3 *tangent, vl::fvec3 *bitangent)
Computes the tangent (and optionally bitangent) vectors used to form a TBN matrix to be used for bump...
virtual vec3 getAsVec3(size_t vector_index) const =0
Returns a vector from the buffer as a vec3 value.
const T_VectorType * begin() const
void setRangeStart(int rstart)
Sets the range start.
void setBoundingBox(const AABB &aabb)
Sets the bounding box of a Renderable.
bool isDisplayListEnabled() const
Returns true if display lists are enabled for a Renderable (disabled by default). ...
int rangeEnd() const
Returns the range end.
size_t size() const
Returns the number of elements of an array.
The Geometry class is a Renderable that implements a polygonal mesh made of polygons, lines and points.
Visualization Library main namespace.
DrawRangeElements *MultiDrawElements *to the best fitting of *UInt UShort UByte *taking into instancing and base vertex *note Primitive type can be any *void shrinkDrawCalls()
void fixTriangleWinding()
Converts all draw calls to triangles and fixes their winding according to the Geometry's normals...
float dot(float a, float b)
bool flipNormals()
Inverts the orientation of the normals.
Base interface for all DrawElements* sub classes.
virtual void normalize()=0
Normalizes the vectors contained in the buffer.
const unsigned char * ptr() const
Returns the pointer to the first element of the local buffer. Equivalent to bufferObject()->ptr() ...
const T_Scalar & g() const
T_Scalar lengthSquared() const
ArrayUByte1 ::scalar_type index_type
The AABB class implements an axis-aligned bounding box using vl::real precision.
virtual TriangleIterator triangleIterator() const =0
Returns a TriangleIterator used to iterate through the triangles of a DrawCall.
unsigned int u32
32 bits unsigned integer
ArrayUByte1 ::scalar_type index_type
void colorizePrimitives()
Assigns a random color to each vertex of each DrawCall object. If a vertex is shared among more than ...
arr_type * indexBuffer()
The BufferObject containing the indices used to render.
const T_Scalar & y() const
void convertDrawCallToDrawArrays()
Converts all the DrawCall objects bound to a Geometry into DrawArrays.
void setCountVector(const std::vector< GLsizei > &vcount)
Sets the vector defining the length of each primitive and automatically computes the pointer vectors ...
Iterator used to extract the indices of every single triangle of a DrawCall regardless of the primiti...
void computeNormals(bool verbose=false)
Computes the normals in a "smooth" way, i.e.
void setTexCoordArray(int tex_unit, ArrayAbstract *data)
Conventional texture coords arrays.
void transform(const mat4 &matr, bool normalize=true)
Transforms vertices and normals belonging to this geometry.
T * as()
Casts an Object to the specified class.
virtual int instances() const
Returns the number of instances for this set of primitives.
virtual ~Geometry()
Destructor.
const T_Scalar & b() const
const ArrayAbstract * vertexAttribArray(int attrib_location) const
Returns a generic vertex attribute's info.
DrawCall * mergeTriangleStrips()
Merges all the PT_TRIANGLE_STRIP DrawElementsUInt objects into one single PT_TRIANGLE_STRIP DrawEleme...
Manages most of the OpenGL rendering states responsible of the final aspect of the rendered objects...
The Sphere class defines a sphere using a center and a radius using vl::real precision.
virtual void clearArrays(bool clear_draw_calls=true)
Removes all the previously installed arrays.
void setPrimitiveRestartEnabled(bool enabled)
Enables the primitive-restart functionality.
arr_type * indexBuffer()
The BufferObject containing the indices used to render.
Base interface for all DrawRangeElements* sub classes.
void setRangeEnd(int rend)
Sets the range end.
ref< Geometry > deepCopy() const
Performs a deep copy of a Geometry.
T_VectorType & at(size_t i)
void bindVAS(const IVertexAttribSet *vas, bool use_vbo, bool force)
Activates the specified vertex attribute set - For internal use only.
int rangeStart() const
Returns the range start.
virtual GLenum glType() const =0
Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 et...
int instances() const
Returns the number of instances for this set of primitives.
void mergeDrawCallsWithTriangles(EPrimitiveType primitive_type)
Merges all the draw calls that use the given primitive type or PT_TRIANGLES into one single PT_TRIANG...
The base class of DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements.
virtual size_t size() const =0
Returns the number of elements of an array.
virtual IndexIterator indexIterator() const =0
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.
void regenerateVertices(const std::vector< u32 > &map_new_to_old)
Regenerates the vertex position and attributes using the given new-to-old map.
const T_Scalar & x() const
void triangulateDrawCalls()
Converts PT_QUADS, PT_QUADS_STRIP and PT_POLYGON into PT_TRIANGLE primitives.
void setEnabled(bool enable)
Enables/disables the draw call.
The ref<> class is used to reference-count an Object.
virtual unsigned int primitiveRestartIndex()
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported...
const T_Scalar & x() const
void setFogCoordArray(ArrayAbstract *data)
Conventional fog array.
virtual void transform(const mat4 &m)=0
Transforms the vectors contained in the buffer.
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
Wraps a IndexIteratorAbstract to iterate over the indices of a DrawCall.
void setPrimitiveRestartEnabled(bool enabled)
Enables the primitive-restart functionality.
virtual void computeBounds_Implementation()
void setBaseVertices(const std::vector< GLint > &base_verts)
Returns the list of base vertices, one for each primitive.
virtual void render_Implementation(const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) const
EPrimitiveType primitiveType() const
Returns the draw call's primitive type.
ArrayUByte1 ::scalar_type index_type
void makeGLESFriendly()
Calls triangulateDrawCalls() and shrinkDrawCalls().
Wraps the OpenGL function glDrawArrays().
const T_Scalar & y() const
int baseVertex() const
Returns the currently used base vertex.
Collection< DrawCall > mDrawCalls
void mergeDrawCallsWithPrimitiveRestart(EPrimitiveType primitive_type)
Merges all the draw calls that use the given primitive type into one single draw call using primitive...
const ArrayAbstract * normalArray() const
Conventional normal array.
Collection< DrawCall > & drawCalls()
Returns the list of DrawCall objects bound to a Geometry.
void setVertexAttribArray(int attrib_location, const ArrayAbstract *info)
Binds a generic vertex attribute.
const T_Scalar & a() const
void setPrimitiveRestartEnabled(bool enabled)
Enables the primitive-restart functionality (requires OpenGL 3.1).