Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The Geometry class is a Renderable that implements a polygonal mesh made of polygons, lines and points. More...
#include <Geometry.hpp>
Classes | |
| class | TextureArray |
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| Geometry () | |
| Constructor. | |
| virtual | ~Geometry () |
| Destructor. | |
| ref< Geometry > | shallowCopy () |
| Performs a shallow copy (as opposed to a deep copy) of the specified Geometry. | |
| void | shallowCopy (Geometry *) |
| Performs a shallow copy (as opposed to a deep copy) of the specified Geometry. | |
| ref< Geometry > | deepCopy () const |
| Performs a deep copy (as opposed to a shallow copy) of the specified Geometry. | |
| void | deepCopy (Geometry *) const |
| Performs a deep copy (as opposed to a shallow copy) of the specified Geometry. | |
| Geometry & | operator= (const Geometry &other) |
| Performs a shallowCopy() of the Geometry. | |
| Collection< DrawCall > * | drawCalls () |
| Returns the list of DrawCall objects bound to a Geometry. | |
| const Collection< DrawCall > * | drawCalls () const |
| Returns the list of DrawCall objects bound to a Geometry. | |
| void | setNormal (const fvec3 &normal) |
| Geometry normal used when no normal array is defined. | |
| const fvec3 & | normal () |
| Geometry normal used when no normal array is defined. | |
| void | setColor (const fvec4 &color) |
| Geometry color used when no color array is defined. | |
| const fvec4 & | color () |
| Geometry color used when no color array is defined. | |
| void | setSecondaryColor (const fvec4 &color) |
| Geometry color used when no color array is defined. | |
| const fvec4 & | secondaryColor () |
| Geometry color used when no color array is defined. | |
| void | toGenericVertexAttribs () |
| Converts the fixed function pipeline arrays (vertex array, normal arrays) into the generic ones. | |
| void | computeNormals (bool verbose=false) |
| Computes the normals in a "smooth" way, i.e. | |
| bool | flipNormals () |
| Inverts the orientation of the normals. | |
| void | transform (const mat4 &matr, bool normalize=true) |
| Transforms vertices and normals belonging to this geometry. | |
| virtual void | clearArrays (bool clear_draw_calls=true) |
| Removes all the previously installed arrays. | |
| void | updateVBOs (bool discard_local_data=false, bool force_update=false) |
| Updates all the vertex buffer objects of both vertex arrays and draw calls. | |
| void | deleteVBOs () |
| Deletes all the vertex buffer objects of both vertex arrays and draw calls. | |
| void | mergeTriangleStrips () |
| Merges all the PT_TRIANGLE_STRIP DrawElementsUInt objects into one single PT_TRIANGLE_STRIP DrawElementsUInt. | |
| void | convertDrawCallToDrawArrays () |
| Converts all the DrawCall objects bound to a Geometry into DrawArrays. | |
| bool | sortVertices () |
| Sorts the vertices of the geometry to maximize vertex-cache coherency. | |
| void | colorizePrimitives () |
| Assigns a random color to each vertex of each DrawCall object. If a vertex is shared among more than one DrawCall object its color is undefined. | |
| void | regenerateVertices (const std::vector< size_t > &map_new_to_old) |
| void | setVertexArray (ArrayAbstract *data) |
| Conventional vertex array. | |
| const ArrayAbstract * | vertexArray () const |
| Conventional vertex array. | |
| ArrayAbstract * | vertexArray () |
| Conventional vertex array. | |
| void | setNormalArray (ArrayAbstract *data) |
| Conventional normal array. | |
| const ArrayAbstract * | normalArray () const |
| Conventional normal array. | |
| ArrayAbstract * | normalArray () |
| Conventional normal array. | |
| void | setColorArray (ArrayAbstract *data) |
| Conventional color array. | |
| const ArrayAbstract * | colorArray () const |
| Conventional color array. | |
| ArrayAbstract * | colorArray () |
| Conventional color array. | |
| void | setSecondaryColorArray (ArrayAbstract *data) |
| Conventional secondary color array. | |
| const ArrayAbstract * | secondaryColorArray () const |
| Conventional secondary color array. | |
| ArrayAbstract * | secondaryColorArray () |
| Conventional secondary color array. | |
| void | setFogCoordArray (ArrayAbstract *data) |
| Conventional fog array. | |
| const ArrayAbstract * | fogCoordArray () const |
| Conventional fog array. | |
| ArrayAbstract * | fogCoordArray () |
| Conventional fog array. | |
| void | setTexCoordArray (int tex_unit, ArrayAbstract *data) |
| Conventional texture coords arrays. | |
| const ArrayAbstract * | texCoordArray (int tex_unit) const |
| Conventional texture coords arrays. | |
| ArrayAbstract * | texCoordArray (int tex_unit) |
| Conventional texture coords arrays. | |
| int | texCoordArrayCount () const |
| void | getTexCoordArrayAt (int i, int &out_tex_unit, const ArrayAbstract *&tex_array) const |
| void | setVertexAttribArray (unsigned int attrib_idx, ArrayAbstract *data, bool normalize=true, EVertexAttribBehavior data_behav=VAB_NORMAL) |
| void | setVertexAttribArray (const VertexAttribInfo &info) |
| Binds a generic vertex attribute. | |
| const ArrayAbstract * | vertexAttrib (unsigned int attrib_idx) const |
| Returns a generic vertex attribute. | |
| ArrayAbstract * | vertexAttrib (unsigned int attrib_idx) |
| Returns a generic vertex attribute. | |
| const VertexAttribInfo * | vertexAttribInfo (unsigned int attrib_idx) const |
| Returns a generic vertex attribute's info. | |
| VertexAttribInfo * | vertexAttribInfo (unsigned int attrib_idx) |
| Returns a generic vertex attribute's info. | |
| ref< VertexAttribInfo > | eraseVertexAttrib (unsigned int attrib_idx) |
| int | vertexAttribInfoCount () const |
| Returns the number of generic vertex attribute arrays bound. | |
| const VertexAttribInfo * | getVertexAttribInfoAt (int i) const |
Returns i-th VertexAttribInfo, where i is not out_attrib_info.attribIndex(). | |
| Collection< VertexAttribInfo > * | vertexAttribArrays () |
| The list of VertexAttribInfo objects bound to a Geometry. | |
| const Collection < VertexAttribInfo > * | vertexAttribArrays () const |
| The list of VertexAttribInfo objects bound to a Geometry. | |
Static Public Member Functions | |
| static void | computeTangentSpace (size_t 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 bumpmapping. | |
Protected Member Functions | |
| virtual void | computeBounds_Implementation () |
| virtual void | render_Implementation (const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) const |
Protected Attributes | |
| Collection< DrawCall > | mDrawCalls |
| fvec4 | mColor |
| fvec4 | mSecondaryColor |
| fvec3 | mNormal |
| ref< ArrayAbstract > | mVertexArray |
| ref< ArrayAbstract > | mNormalArray |
| ref< ArrayAbstract > | mColorArray |
| ref< ArrayAbstract > | mSecondaryColorArray |
| ref< ArrayAbstract > | mFogCoordArray |
| Collection< TextureArray > | mTexCoordArrays |
| Collection< VertexAttribInfo > | mVertexAttribArrays |
The Geometry class is a Renderable that implements a polygonal mesh made of polygons, lines and points.
Definition at line 67 of file Geometry.hpp.
| Geometry::Geometry | ( | ) |
Constructor.
Definition at line 42 of file Geometry.cpp.
References mColor, mDrawCalls, mNormal, mSecondaryColor, mTexCoordArrays, mVertexAttribArrays, vl::Object::setAutomaticDelete(), and VL_DEBUG_SET_OBJECT_NAME.
Referenced by deepCopy(), and shallowCopy().
| Geometry::~Geometry | ( | ) | [virtual] |
Destructor.
Definition at line 53 of file Geometry.cpp.
| virtual const char* vl::Geometry::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Renderable.
Reimplemented in vl::BezierSurface.
Definition at line 81 of file Geometry.hpp.
Performs a shallow copy (as opposed to a deep copy) of the specified Geometry.
Definition at line 146 of file Geometry.cpp.
References Geometry().
Referenced by vl::MorphingCallback::init().
| void Geometry::shallowCopy | ( | Geometry * | geom ) |
Performs a shallow copy (as opposed to a deep copy) of the specified Geometry.
Definition at line 153 of file Geometry.cpp.
Performs a deep copy (as opposed to a shallow copy) of the specified Geometry.
Definition at line 89 of file Geometry.cpp.
References Geometry(), and vl::ref< T >::get().
| void Geometry::deepCopy | ( | Geometry * | geom ) | const |
Performs a deep copy (as opposed to a shallow copy) of the specified Geometry.
Definition at line 96 of file Geometry.cpp.
References vl::ref< T >::get(), mColor, mColorArray, mDrawCalls, mFogCoordArray, mNormal, mNormalArray, mSecondaryColor, mSecondaryColorArray, mTexCoordArrays, mVertexArray, mVertexAttribArrays, vl::normalize(), vl::Collection< T >::push_back(), vl::Collection< T >::resize(), and vl::Collection< T >::size().
Performs a shallowCopy() of the Geometry.
Definition at line 127 of file Geometry.cpp.
References mColor, mColorArray, mDrawCalls, mFogCoordArray, mNormal, mNormalArray, mSecondaryColor, mSecondaryColorArray, mTexCoordArrays, mVertexArray, and mVertexAttribArrays.
| Collection<DrawCall>* vl::Geometry::drawCalls | ( | ) | [inline] |
Returns the list of DrawCall objects bound to a Geometry.
Definition at line 113 of file Geometry.hpp.
Referenced by colorizePrimitives(), computeBounds_Implementation(), computeNormals(), convertDrawCallToDrawArrays(), deleteVBOs(), vl::EdgeExtractor::extractEdges(), vl::RayIntersector::intersectGeometry(), vl::STLLoader::loadAscii(), mergeTriangleStrips(), vl::DoubleVertexRemover::removeDoubles(), render_Implementation(), vl::PolygonSimplifier::simplify(), sortVertices(), vl::TriangleStripGenerator::stripfy(), vl::BezierSurface::updateBezierSurface(), and updateVBOs().
| const Collection<DrawCall>* vl::Geometry::drawCalls | ( | ) | const [inline] |
Returns the list of DrawCall objects bound to a Geometry.
Definition at line 116 of file Geometry.hpp.
| void vl::Geometry::setNormal | ( | const fvec3 & | normal ) | [inline] |
Geometry normal used when no normal array is defined.
Definition at line 119 of file Geometry.hpp.
| const fvec3& vl::Geometry::normal | ( | ) | [inline] |
Geometry normal used when no normal array is defined.
Definition at line 122 of file Geometry.hpp.
| void vl::Geometry::setColor | ( | const fvec4 & | color ) | [inline] |
Geometry color used when no color array is defined.
Definition at line 125 of file Geometry.hpp.
| const fvec4& vl::Geometry::color | ( | ) | [inline] |
Geometry color used when no color array is defined.
Definition at line 128 of file Geometry.hpp.
| void vl::Geometry::setSecondaryColor | ( | const fvec4 & | color ) | [inline] |
Geometry color used when no color array is defined.
Definition at line 131 of file Geometry.hpp.
| const fvec4& vl::Geometry::secondaryColor | ( | ) | [inline] |
Geometry color used when no color array is defined.
Definition at line 134 of file Geometry.hpp.
| void Geometry::toGenericVertexAttribs | ( | ) |
Converts the fixed function pipeline arrays (vertex array, normal arrays) into the generic ones.
The generic attribute indices are allocated in the following order:
Definition at line 282 of file Geometry.cpp.
References vl::Collection< T >::clear(), colorArray(), fogCoordArray(), mTexCoordArrays, normalArray(), secondaryColorArray(), setColorArray(), setFogCoordArray(), setNormalArray(), setSecondaryColorArray(), setVertexArray(), setVertexAttribArray(), vl::Collection< T >::size(), vertexArray(), and vertexAttribArrays().
| void Geometry::computeNormals | ( | bool | verbose = false ) |
Computes the normals in a "smooth" way, i.e.
averaging the normals of those polygons that share one or more vertices.
This function computes smoothed normals for triangle primitives and leaves unchanged the normals of line and point primitives when possible, i.e. when they don't share vertices with the polygonal primitives.
Definition at line 322 of file Geometry.cpp.
References vl::cross(), drawCalls(), vl::ref< T >::get(), vl::Vector3< T_Scalar >::length(), mDrawCalls, vl::Vector3< T_Scalar >::normalize(), setNormalArray(), vl::Collection< T >::size(), vl::ArrayAbstract::size(), vl::ArrayAbstract::vectorAsVec4(), vertexArray(), vertexAttrib(), VL_CHECK, vl::Log::warning(), and vl::Vector4< T_Scalar >::xyz().
| bool Geometry::flipNormals | ( | ) |
Inverts the orientation of the normals.
Returns true if the normals could be flipped. The function fails if the normals are defined in a format other than ArrayFloat3.
Definition at line 265 of file Geometry.cpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), normalArray(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| void Geometry::transform | ( | const mat4 & | matr, |
| bool | normalize = true |
||
| ) |
Transforms vertices and normals belonging to this geometry.
If 'normalize' == true the normals are normalized after being transformed
Definition at line 495 of file Geometry.cpp.
References vl::Matrix4< T_Scalar >::as3x3(), vl::Matrix4< T_Scalar >::getInverse(), normalArray(), vl::ArrayAbstract::normalize(), vl::ArrayAbstract::transform(), vertexArray(), and vertexAttrib().
| void Geometry::clearArrays | ( | bool | clear_draw_calls = true ) |
[virtual] |
Removes all the previously installed arrays.
Definition at line 252 of file Geometry.cpp.
References vl::Collection< T >::clear(), mColorArray, mDrawCalls, mFogCoordArray, mNormalArray, mSecondaryColorArray, mTexCoordArrays, mVertexArray, and mVertexAttribArrays.
| void Geometry::updateVBOs | ( | bool | discard_local_data = false, |
| bool | force_update = false |
||
| ) | [virtual] |
Updates all the vertex buffer objects of both vertex arrays and draw calls.
Implements vl::Renderable.
Definition at line 427 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::VertexAttribInfo::data(), drawCalls(), mColorArray, mFogCoordArray, mNormalArray, mSecondaryColorArray, mTexCoordArrays, mVertexArray, vl::Renderable::setVBODirty(), vl::Collection< T >::size(), vl::ArrayAbstract::updateVBO(), vl::DrawCall::updateVBOs(), and vertexAttribArrays().
| void Geometry::deleteVBOs | ( | ) | [virtual] |
Deletes all the vertex buffer objects of both vertex arrays and draw calls.
Reimplemented from vl::Renderable.
Definition at line 396 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::VertexAttribInfo::data(), vl::GLBufferObject::deleteGLBufferObject(), vl::DrawCall::deleteVBOs(), drawCalls(), vl::ArrayAbstract::gpuBuffer(), mColorArray, mFogCoordArray, mNormalArray, mSecondaryColorArray, mTexCoordArrays, mVertexArray, vl::Collection< T >::size(), and vertexAttribArrays().
| void Geometry::mergeTriangleStrips | ( | ) |
Merges all the PT_TRIANGLE_STRIP DrawElementsUInt objects into one single PT_TRIANGLE_STRIP DrawElementsUInt.
Definition at line 573 of file Geometry.cpp.
References vl::Collection< T >::at(), drawCalls(), vl::Collection< T >::erase(), vl::ref< T >::get(), vl::PT_TRIANGLE_STRIP, vl::Collection< T >::push_back(), and vertexArray().
Referenced by vl::TriangleStripGenerator::stripfy().
| void Geometry::convertDrawCallToDrawArrays | ( | ) |
Converts all the DrawCall objects bound to a Geometry into DrawArrays.
Definition at line 646 of file Geometry.cpp.
References drawCalls(), vl::Collection< T >::erase(), vl::ref< T >::get(), vl::Collection< T >::push_back(), regenerateVertices(), and vertexArray().
| bool Geometry::sortVertices | ( | ) |
Sorts the vertices of the geometry to maximize vertex-cache coherency.
This function will work only if all the DrawCall are DrawElements.
Definition at line 668 of file Geometry.cpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Collection< T >::at(), vl::Collection< T >::clear(), drawCalls(), vl::DrawElements< Tgltype, arr_type >::indices(), vl::DrawElementsBase::instances(), vl::DrawCall::primitiveType(), vl::Collection< T >::push_back(), regenerateVertices(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), vl::Collection< T >::size(), and vertexArray().
| void Geometry::colorizePrimitives | ( | ) |
Assigns a random color to each vertex of each DrawCall object. If a vertex is shared among more than one DrawCall object its color is undefined.
Definition at line 746 of file Geometry.cpp.
References vl::Vector4< T_Scalar >::a(), vl::Vector4< T_Scalar >::b(), drawCalls(), vl::Vector4< T_Scalar >::g(), vl::ref< T >::get(), vl::Vector4< T_Scalar >::r(), setColorArray(), vl::Collection< T >::size(), and vertexArray().
| void Geometry::regenerateVertices | ( | const std::vector< size_t > & | map_new_to_old ) |
Definition at line 619 of file Geometry.cpp.
References vl::Collection< T >::at(), colorArray(), fogCoordArray(), vl::ref< T >::get(), normalArray(), vl::VertexMapper::regenerate(), secondaryColorArray(), setColorArray(), vl::VertexAttribInfo::setData(), setFogCoordArray(), setNormalArray(), setSecondaryColorArray(), setTexCoordArray(), setVertexArray(), vl::Collection< T >::size(), texCoordArray(), vertexArray(), vertexAttribArrays(), and VL_MAX_TEXTURE_UNITS.
Referenced by convertDrawCallToDrawArrays(), vl::DoubleVertexRemover::removeDoubles(), and sortVertices().
| void Geometry::computeTangentSpace | ( | size_t | vert_count, |
| const vl::fvec3 * | vertex, | ||
| const vl::fvec3 * | normal, | ||
| const vl::fvec2 * | texcoord, | ||
| const vl::DrawCall * | primitives, | ||
| vl::fvec3 * | tangent, | ||
| vl::fvec3 * | bitangent | ||
| ) | [static] |
Computes the tangent (and optionally bitangent) vectors used to form a TBN matrix to be used for bumpmapping.
| vert_count | The number of elements stored in vertex, normal, texcoord, tangent and bitangent. |
| vertex | Array containing the vertex positions. |
| normal | Array containing the normals of the vertices. |
| texcoord | Array containing the 2d texture coordinates of the bumpmap. |
| primitives | The triangles, quads etc. defining the geometry of the object. |
| tangent | [out] Returns the tangent vector of the vertices. This parameter is mandatory. |
| bitangent | [out] Returns the bitangent vector of the vertics. This parameter can be NULL. |
Definition at line 765 of file Geometry.cpp.
References vl::cross(), vl::dot(), vl::TriangleIterator::isEnd(), vl::normalize(), vl::DrawCall::triangleIterator(), VL_CHECK, vl::Vector2< T_Scalar >::x(), vl::Vector3< T_Scalar >::x(), vl::Vector2< T_Scalar >::y(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
| void Geometry::setVertexArray | ( | ArrayAbstract * | data ) | [virtual] |
Conventional vertex array.
Implements vl::IVertexAttribSet.
Definition at line 158 of file Geometry.cpp.
References vl::ArrayAbstract::glSize(), mVertexArray, and VL_CHECK.
Referenced by regenerateVertices(), toGenericVertexAttribs(), and vl::BezierSurface::updateBezierSurface().
| const ArrayAbstract* vl::Geometry::vertexArray | ( | ) | const [inline, virtual] |
Conventional vertex array.
Implements vl::IVertexAttribSet.
Definition at line 241 of file Geometry.hpp.
Referenced by colorizePrimitives(), computeBounds_Implementation(), computeNormals(), convertDrawCallToDrawArrays(), vl::EdgeExtractor::extractEdges(), vl::RayIntersector::intersectGeometry(), mergeTriangleStrips(), regenerateVertices(), vl::DoubleVertexRemover::removeDoubles(), vl::PolygonSimplifier::simplify(), sortVertices(), toGenericVertexAttribs(), transform(), and vl::BezierSurface::updateBezierSurface().
| ArrayAbstract* vl::Geometry::vertexArray | ( | ) | [inline, virtual] |
Conventional vertex array.
Implements vl::IVertexAttribSet.
Definition at line 243 of file Geometry.hpp.
| void Geometry::setNormalArray | ( | ArrayAbstract * | data ) | [virtual] |
Conventional normal array.
Implements vl::IVertexAttribSet.
Definition at line 167 of file Geometry.cpp.
References vl::ArrayAbstract::glSize(), vl::ArrayAbstract::glType(), mNormalArray, and VL_CHECK.
Referenced by computeNormals(), regenerateVertices(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| const ArrayAbstract* vl::Geometry::normalArray | ( | ) | const [inline, virtual] |
Conventional normal array.
Implements vl::IVertexAttribSet.
Definition at line 247 of file Geometry.hpp.
Referenced by flipNormals(), regenerateVertices(), render_Implementation(), vl::PolygonSimplifier::simplify(), toGenericVertexAttribs(), and transform().
| ArrayAbstract* vl::Geometry::normalArray | ( | ) | [inline, virtual] |
Conventional normal array.
Implements vl::IVertexAttribSet.
Definition at line 249 of file Geometry.hpp.
| void Geometry::setColorArray | ( | ArrayAbstract * | data ) | [virtual] |
Conventional color array.
Implements vl::IVertexAttribSet.
Definition at line 181 of file Geometry.cpp.
References vl::ArrayAbstract::glSize(), vl::ArrayAbstract::glType(), mColorArray, and VL_CHECK.
Referenced by colorizePrimitives(), regenerateVertices(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| const ArrayAbstract* vl::Geometry::colorArray | ( | ) | const [inline, virtual] |
Conventional color array.
Implements vl::IVertexAttribSet.
Definition at line 253 of file Geometry.hpp.
Referenced by regenerateVertices(), render_Implementation(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| ArrayAbstract* vl::Geometry::colorArray | ( | ) | [inline, virtual] |
Conventional color array.
Implements vl::IVertexAttribSet.
Definition at line 255 of file Geometry.hpp.
| void Geometry::setSecondaryColorArray | ( | ArrayAbstract * | data ) | [virtual] |
Conventional secondary color array.
Implements vl::IVertexAttribSet.
Definition at line 198 of file Geometry.cpp.
References vl::ArrayAbstract::glSize(), vl::ArrayAbstract::glType(), mSecondaryColorArray, and VL_CHECK.
Referenced by regenerateVertices(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| const ArrayAbstract* vl::Geometry::secondaryColorArray | ( | ) | const [inline, virtual] |
Conventional secondary color array.
Implements vl::IVertexAttribSet.
Definition at line 259 of file Geometry.hpp.
Referenced by regenerateVertices(), render_Implementation(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| ArrayAbstract* vl::Geometry::secondaryColorArray | ( | ) | [inline, virtual] |
Conventional secondary color array.
Implements vl::IVertexAttribSet.
Definition at line 261 of file Geometry.hpp.
| void Geometry::setFogCoordArray | ( | ArrayAbstract * | data ) | [virtual] |
Conventional fog array.
Implements vl::IVertexAttribSet.
Definition at line 215 of file Geometry.cpp.
References vl::ArrayAbstract::glSize(), vl::ArrayAbstract::glType(), mFogCoordArray, and VL_CHECK.
Referenced by regenerateVertices(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| const ArrayAbstract* vl::Geometry::fogCoordArray | ( | ) | const [inline, virtual] |
Conventional fog array.
Implements vl::IVertexAttribSet.
Definition at line 265 of file Geometry.hpp.
Referenced by regenerateVertices(), vl::PolygonSimplifier::simplify(), and toGenericVertexAttribs().
| ArrayAbstract* vl::Geometry::fogCoordArray | ( | ) | [inline, virtual] |
Conventional fog array.
Implements vl::IVertexAttribSet.
Definition at line 267 of file Geometry.hpp.
| void Geometry::setTexCoordArray | ( | int | tex_unit, |
| ArrayAbstract * | data | ||
| ) | [virtual] |
Conventional texture coords arrays.
Implements vl::IVertexAttribSet.
Definition at line 225 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::Collection< T >::erase(), vl::ArrayAbstract::glSize(), vl::ArrayAbstract::glType(), mTexCoordArrays, vl::Collection< T >::push_back(), vl::Collection< T >::size(), VL_CHECK, and VL_MAX_TEXTURE_UNITS.
Referenced by regenerateVertices(), vl::PolygonSimplifier::simplify(), and vl::BezierSurface::updateBezierSurface().
| const ArrayAbstract* vl::Geometry::texCoordArray | ( | int | tex_unit ) | const [inline, virtual] |
Conventional texture coords arrays.
Implements vl::IVertexAttribSet.
Definition at line 271 of file Geometry.hpp.
Referenced by regenerateVertices(), vl::PolygonSimplifier::simplify(), and vl::BezierSurface::updateBezierSurface().
| ArrayAbstract* vl::Geometry::texCoordArray | ( | int | tex_unit ) | [inline, virtual] |
Conventional texture coords arrays.
Implements vl::IVertexAttribSet.
Definition at line 279 of file Geometry.hpp.
| int vl::Geometry::texCoordArrayCount | ( | ) | const [inline, virtual] |
Implements vl::IVertexAttribSet.
Definition at line 287 of file Geometry.hpp.
| void vl::Geometry::getTexCoordArrayAt | ( | int | i, |
| int & | out_tex_unit, | ||
| const ArrayAbstract *& | tex_array | ||
| ) | const [inline, virtual] |
| void vl::Geometry::setVertexAttribArray | ( | unsigned int | attrib_idx, |
| ArrayAbstract * | data, | ||
| bool | normalize = true, |
||
| EVertexAttribBehavior | data_behav = VAB_NORMAL |
||
| ) | [inline] |
Definition at line 296 of file Geometry.hpp.
References vl::normalize(), and setVertexAttribArray().
Referenced by setVertexAttribArray(), and toGenericVertexAttribs().
| void Geometry::setVertexAttribArray | ( | const VertexAttribInfo & | info ) | [virtual] |
Binds a generic vertex attribute.
Implements vl::IVertexAttribSet.
Definition at line 510 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::VertexAttribInfo::attribIndex(), mVertexAttribArrays, vl::Collection< T >::push_back(), vl::Collection< T >::size(), vertexAttribArrays(), and VL_CHECK.
| const ArrayAbstract * Geometry::vertexAttrib | ( | unsigned int | attrib_idx ) | const [virtual] |
Returns a generic vertex attribute.
Implements vl::IVertexAttribSet.
Definition at line 524 of file Geometry.cpp.
References vl::VertexAttribInfo::data(), and vertexAttribInfo().
Referenced by computeNormals(), and transform().
| ArrayAbstract * Geometry::vertexAttrib | ( | unsigned int | attrib_idx ) | [virtual] |
Returns a generic vertex attribute.
Implements vl::IVertexAttribSet.
Definition at line 533 of file Geometry.cpp.
References vl::VertexAttribInfo::data(), and vertexAttribInfo().
| const VertexAttribInfo * Geometry::vertexAttribInfo | ( | unsigned int | attrib_idx ) | const [virtual] |
Returns a generic vertex attribute's info.
Implements vl::IVertexAttribSet.
Definition at line 542 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::VertexAttribInfo::attribIndex(), vl::Collection< T >::size(), and vertexAttribArrays().
Referenced by computeBounds_Implementation(), and vertexAttrib().
| VertexAttribInfo * Geometry::vertexAttribInfo | ( | unsigned int | attrib_idx ) | [virtual] |
Returns a generic vertex attribute's info.
Implements vl::IVertexAttribSet.
Definition at line 550 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::VertexAttribInfo::attribIndex(), vl::Collection< T >::size(), and vertexAttribArrays().
| ref< VertexAttribInfo > Geometry::eraseVertexAttrib | ( | unsigned int | attrib_idx ) | [virtual] |
Implements vl::IVertexAttribSet.
Definition at line 558 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::VertexAttribInfo::attribIndex(), vl::Collection< T >::eraseAt(), vl::Collection< T >::size(), and vertexAttribArrays().
| int vl::Geometry::vertexAttribInfoCount | ( | ) | const [inline, virtual] |
Returns the number of generic vertex attribute arrays bound.
Implements vl::IVertexAttribSet.
Definition at line 310 of file Geometry.hpp.
| const VertexAttribInfo* vl::Geometry::getVertexAttribInfoAt | ( | int | i ) | const [inline, virtual] |
Returns i-th VertexAttribInfo, where i is not out_attrib_info.attribIndex().
Implements vl::IVertexAttribSet.
Definition at line 312 of file Geometry.hpp.
| Collection<VertexAttribInfo>* vl::Geometry::vertexAttribArrays | ( | ) | [inline] |
The list of VertexAttribInfo objects bound to a Geometry.
Definition at line 315 of file Geometry.hpp.
Referenced by deleteVBOs(), eraseVertexAttrib(), regenerateVertices(), setVertexAttribArray(), vl::PolygonSimplifier::simplify(), toGenericVertexAttribs(), updateVBOs(), and vertexAttribInfo().
| const Collection<VertexAttribInfo>* vl::Geometry::vertexAttribArrays | ( | ) | const [inline] |
The list of VertexAttribInfo objects bound to a Geometry.
Definition at line 318 of file Geometry.hpp.
| void Geometry::computeBounds_Implementation | ( | ) | [protected, virtual] |
Implements vl::Renderable.
Definition at line 57 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::AABB::center(), vl::VertexAttribInfo::data(), drawCalls(), vl::DrawCall::indexIterator(), vl::IndexIterator::isEnd(), vl::Vector3< T_Scalar >::lengthSquared(), vl::Renderable::setBoundingBox(), vl::Renderable::setBoundingSphere(), vl::Collection< T >::size(), vl::ArrayAbstract::vectorAsVec3(), vertexArray(), and vertexAttribInfo().
| void Geometry::render_Implementation | ( | const Actor * | actor, |
| const Shader * | shader, | ||
| const Camera * | camera, | ||
| OpenGLContext * | gl_context | ||
| ) | const [protected, virtual] |
Implements vl::Renderable.
Definition at line 463 of file Geometry.cpp.
References vl::Collection< T >::at(), vl::OpenGLContext::bindVAS(), colorArray(), drawCalls(), vl::OpenGLContext::isCompatible(), vl::Renderable::isDisplayListEnabled(), vl::DrawCall::isEnabled(), mColor, mNormal, mSecondaryColor, normalArray(), vl::Vector4< T_Scalar >::ptr(), vl::Vector3< T_Scalar >::ptr(), vl::DrawCall::render(), secondaryColorArray(), vl::Collection< T >::size(), vl::Renderable::vboEnabled(), and VL_CHECK_OGL.
Collection<DrawCall> vl::Geometry::mDrawCalls [protected] |
Definition at line 326 of file Geometry.hpp.
Referenced by clearArrays(), computeNormals(), deepCopy(), Geometry(), and operator=().
fvec4 vl::Geometry::mColor [protected] |
Definition at line 329 of file Geometry.hpp.
Referenced by deepCopy(), Geometry(), operator=(), and render_Implementation().
fvec4 vl::Geometry::mSecondaryColor [protected] |
Definition at line 332 of file Geometry.hpp.
Referenced by deepCopy(), Geometry(), operator=(), and render_Implementation().
fvec3 vl::Geometry::mNormal [protected] |
Definition at line 335 of file Geometry.hpp.
Referenced by deepCopy(), Geometry(), operator=(), and render_Implementation().
ref<ArrayAbstract> vl::Geometry::mVertexArray [protected] |
Definition at line 340 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), deleteVBOs(), operator=(), setVertexArray(), and updateVBOs().
ref<ArrayAbstract> vl::Geometry::mNormalArray [protected] |
Definition at line 341 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), deleteVBOs(), operator=(), setNormalArray(), and updateVBOs().
ref<ArrayAbstract> vl::Geometry::mColorArray [protected] |
Definition at line 342 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), deleteVBOs(), operator=(), setColorArray(), and updateVBOs().
ref<ArrayAbstract> vl::Geometry::mSecondaryColorArray [protected] |
Definition at line 343 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), deleteVBOs(), operator=(), setSecondaryColorArray(), and updateVBOs().
ref<ArrayAbstract> vl::Geometry::mFogCoordArray [protected] |
Definition at line 344 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), deleteVBOs(), operator=(), setFogCoordArray(), and updateVBOs().
Collection<TextureArray> vl::Geometry::mTexCoordArrays [protected] |
Definition at line 345 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), deleteVBOs(), Geometry(), operator=(), setTexCoordArray(), toGenericVertexAttribs(), and updateVBOs().
Collection<VertexAttribInfo> vl::Geometry::mVertexAttribArrays [protected] |
Definition at line 347 of file Geometry.hpp.
Referenced by clearArrays(), deepCopy(), Geometry(), operator=(), and setVertexAttribArray().