|
| ofVboMesh () |
|
| ofVboMesh (const ofMesh &mom) |
|
void | operator= (const ofMesh &mom) |
|
virtual | ~ofVboMesh () |
|
void | setUsage (int usage) |
|
void | enableColors () |
| Enable mesh colors. Use disableColors() to turn colors off. Colors are enabled by default when they are added to the mesh.
|
|
void | enableTextures () |
| Enable mesh textures. Use disableTextures() to turn textures off. Textures are enabled by default when they are added to the mesh.
|
|
void | enableNormals () |
| Enable mesh normals. Use disableNormals() to turn normals off. Normals are enabled by default when they are added to the mesh.
|
|
void | enableIndices () |
| Enable mesh indices. Use disableIndices() to turn indices off. Indices are enabled by default when they are added to the mesh.
|
|
void | disableColors () |
| Disable mesh colors. Use enableColors() to turn colors back on.
|
|
void | disableTextures () |
| Disable mesh textures. Use enableTextures() to turn textures back on.
|
|
void | disableNormals () |
| Disable mesh normals. Use enableNormals() to turn normals back on.
|
|
void | disableIndices () |
| Disable mesh indices. Use enableIndices() to turn indices back on.
|
|
virtual bool | usingColors () const |
|
virtual bool | usingTextures () const |
|
virtual bool | usingNormals () const |
|
virtual bool | usingIndices () const |
|
void | draw (ofPolyRenderMode drawMode) const |
| This draws the mesh using a defined renderType, overriding the renderType defined with setMode().
|
|
void | drawInstanced (ofPolyRenderMode drawMode, int primCount) const |
|
ofVbo & | getVbo () |
|
const ofVbo & | getVbo () const |
|
| ofMesh_ () |
| This creates the mesh, using OF_PRIMITIVE_TRIANGLES without any initial vertices.
|
|
| ofMesh_ (ofPrimitiveMode mode, const std::vector< ofDefaultVertexType > &verts) |
| This allows to you to use one of the other ofPrimitiveModes: OF_PRIMITIVE_TRIANGLES, OF_PRIMITIVE_TRIANGLE_STRIP, OF_PRIMITIVE_TRIANGLE_FAN, OF_PRIMITIVE_LINES, OF_PRIMITIVE_LINE_STRIP, OF_PRIMITIVE_LINE_LOOP, OF_PRIMITIVE_POINTS. See ofGLUtils for more information on these types.
|
|
virtual | ~ofMesh_ () |
|
void | setFromTriangles (const std::vector< ofMeshFace_< ofDefaultVertexType, ofDefaultNormalType, ofDefaultColorType, ofDefaultTexCoordType > > &tris, bool bUseFaceNormal=false) |
|
void | setMode (ofPrimitiveMode mode) |
| Allows you to set the ofPrimitiveMode. The available modes are OF_PRIMITIVE_TRIANGLES, OF_PRIMITIVE_TRIANGLE_STRIP, OF_PRIMITIVE_TRIANGLE_FAN, OF_PRIMITIVE_LINES, OF_PRIMITIVE_LINE_STRIP, OF_PRIMITIVE_LINE_LOOP, OF_PRIMITIVE_POINTS.
|
|
ofPrimitiveMode | getMode () const |
| \returns the primitive mode that the mesh is using.
|
|
void | addVertex (const ofDefaultVertexType &v) |
| Add a new vertex at the end of the current list of vertices. It is important to remember that the order the vertices are added to the list determines how they link they form the polygons and strips (assuming you do not change their indeces). See the ofMesh class description for details.
|
|
void | addVertices (const std::vector< ofDefaultVertexType > &verts) |
| Add a vector of vertices to a mesh, allowing you to push out many at once rather than adding one at a time. The vector of vertices is added after the end of the current vertices list.
|
|
void | addVertices (const ofDefaultVertexType *verts, std::size_t amt) |
| Add an array of vertices to the mesh. Because you are using a pointer to the array you also have to define the length of the array as an int (amt). The vertices are added at the end of the current vertices list.
|
|
void | removeVertex (ofIndexType index) |
| Removes the vertex at the index in the vector.
|
|
void | removeVertices (ofIndexType startIndex, ofIndexType endIndex) |
| Removes the vertices at the startIndex in the vector and the endindex specified.
|
|
void | setVertex (ofIndexType index, const ofDefaultVertexType &v) |
|
void | clearVertices () |
| Removes all the vertices.
|
|
void | clear () |
| Removes all the vertices, colors, and indices from the mesh.
|
|
std::size_t | getNumVertices () const |
|
ofDefaultVertexType * | getVerticesPointer () |
|
const ofDefaultVertexType * | getVerticesPointer () const |
|
ofDefaultVertexType | getVertex (ofIndexType i) const |
|
std::vector< ofDefaultVertexType > & | getVertices () |
|
const std::vector< ofDefaultVertexType > & | getVertices () const |
|
bool | hasVertices () const |
|
void | append (const ofMesh_ &mesh) |
| Add the vertices, normals, texture coordinates and indices of one mesh onto another mesh. Everything from the referenced mesh is simply added at the end of the current mesh's lists.
|
|
void | mergeDuplicateVertices () |
|
ofDefaultVertexType | getCentroid () const |
|
ofDefaultNormalType | getNormal (ofIndexType i) const |
| \returns the normal at the index in the normals vector.
|
|
void | addNormal (const ofDefaultNormalType &n) |
| Add a normal to the mesh as a 3D vector, typically perpendicular to the plane of the face. A normal is a vector that defines how a surface responds to lighting, i.e. how it is lit. The amount of light reflected by a surface is proportional to the angle between the light's direction and the normal. The smaller the angle the brighter the surface will look. See the normalsExample for advice on computing the normals. addNormal adds the 3D vector to the end of the list, so you need to make sure you add normals at the same index of the matching vertex.
|
|
void | addNormals (const std::vector< ofDefaultNormalType > &norms) |
| Add a vector of normals to a mesh, allowing you to push out many normals at once rather than adding one at a time. The vector of normals is added after the end of the current normals list.
|
|
void | addNormals (const ofDefaultNormalType *norms, std::size_t amt) |
| Add an array of normals to the mesh. Because you are using a pointer to the array you also have to define the length of the array as an std::size_t (amt). The normals are added at the end of the current normals list.
|
|
void | removeNormal (ofIndexType index) |
| Remove a normal.
|
|
void | removeNormals (ofIndexType startIndex, ofIndexType endIndex) |
| Remove normal's from index to end index from normals vector.
|
|
void | setNormal (ofIndexType index, const ofDefaultNormalType &n) |
|
void | clearNormals () |
| Remove all the normals.
|
|
std::size_t | getNumNormals () const |
| This will tell you how many normals are contained in the mesh.
|
|
ofDefaultNormalType * | getNormalsPointer () |
|
const ofDefaultNormalType * | getNormalsPointer () const |
|
std::vector< ofDefaultNormalType > & | getNormals () |
|
const std::vector< ofDefaultNormalType > & | getNormals () const |
|
bool | hasNormals () const |
| /returnsWhether the mesh has any normals.
|
|
void | smoothNormals (float angle) |
|
void | flatNormals () |
| Duplicates vertices and updates normals to get a low-poly look.
|
|
ofMeshFace_< ofDefaultVertexType, ofDefaultNormalType, ofDefaultColorType, ofDefaultTexCoordType > | getFace (ofIndexType faceId) const |
|
std::vector< ofDefaultNormalType > | getFaceNormals (bool perVetex=false) const |
| Get normals for each face As a default it only calculates the normal for the face as a whole but by setting (perVertex = true) it will return the same normal value for each of the three vertices making up a face.
|
|
const std::vector< ofMeshFace_< ofDefaultVertexType, ofDefaultNormalType, ofDefaultColorType, ofDefaultTexCoordType > > & | getUniqueFaces () const |
|
ofDefaultColorType | getColor (ofIndexType i) const |
| Get the color at the index in the colors vector.
|
|
void | addColor (const ofDefaultColorType &c) |
| This adds a color to the mesh, the color will be associated with the vertex in the same position.
|
|
void | addColors (const std::vector< ofDefaultColorType > &cols) |
| This adds colors using a reference to a vector of ofColors. For each color in the vector, this will put the colors at the corresponding vertex.
|
|
void | addColors (const ofDefaultColorType *cols, std::size_t amt) |
| This adds a pointer of colors to the ofMesh instance with the amount passed as the second parameter.
|
|
void | removeColor (ofIndexType index) |
| Remove a color at the index in the colors vector.
|
|
void | removeColors (ofIndexType startIndex, ofIndexType endIndex) |
| Remove colors at the index to the end index of the colors vector.
|
|
void | setColor (ofIndexType index, const ofDefaultColorType &c) |
| Set the color at the index in the colors vector.
|
|
void | clearColors () |
| Clear all the colors.
|
|
std::size_t | getNumColors () const |
|
ofDefaultColorType * | getColorsPointer () |
|
const ofDefaultColorType * | getColorsPointer () const |
|
std::vector< ofDefaultColorType > & | getColors () |
|
const std::vector< ofDefaultColorType > & | getColors () const |
|
bool | hasColors () const |
| /returns Whether the mesh has any colors.
|
|
ofDefaultTexCoordType | getTexCoord (ofIndexType i) const |
|
void | addTexCoord (const ofDefaultTexCoordType &t) |
| Add a Vec2f representing the texture coordinate. Because OF uses ARB textures these are in pixels rather than 0-1 normalized coordinates.
|
|
void | addTexCoords (const std::vector< ofDefaultTexCoordType > &tCoords) |
| Add a vector of texture coordinates to a mesh, allowing you to push out many at once rather than adding one at a time. The vector of texture coordinates is added after the end of the current texture coordinates list.
|
|
void | addTexCoords (const ofDefaultTexCoordType *tCoords, std::size_t amt) |
| Add an array of texture coordinates to the mesh. Because you are using a pointer to the array you also have to define the length of the array as an std::size_t (amt). The texture coordinates are added at the end of the current texture coordinates list.
|
|
void | removeTexCoord (ofIndexType index) |
| Remove a Vec2f representing the texture coordinate.
|
|
void | removeTexCoords (ofIndexType startIndex, ofIndexType endIndex) |
|
void | setTexCoord (ofIndexType index, const ofDefaultTexCoordType &t) |
|
void | clearTexCoords () |
| Clear all the texture coordinates.
|
|
std::size_t | getNumTexCoords () const |
| This will tell you how many texture coordinates are contained in the mesh.
|
|
ofDefaultTexCoordType * | getTexCoordsPointer () |
|
const ofDefaultTexCoordType * | getTexCoordsPointer () const |
| Get a pointer to the glm::vec2 texture coordinates that the mesh contains.
|
|
std::vector< ofDefaultTexCoordType > & | getTexCoords () |
| Get a vector representing the texture coordinates of the mesh Because OF uses ARB textures these are in pixels rather than 0-1 normalized coordinates. Use this if you plan to change the texture coordinates as part of this call as it will force a reset of the cache.
|
|
const std::vector< ofDefaultTexCoordType > & | getTexCoords () const |
|
bool | hasTexCoords () const |
| /returns Whether the mesh has any textures assigned to it.
|
|
void | setupIndicesAuto () |
| Allow you to set up the indices automatically when you add a vertex.
|
|
std::vector< ofIndexType > & | getIndices () |
| Use this if you plan to change the indices as part of this call as it will force a reset of the cache.
|
|
const std::vector< ofIndexType > & | getIndices () const |
|
ofIndexType | getIndex (ofIndexType i) const |
|
void | addIndex (ofIndexType i) |
|
void | addIndices (const std::vector< ofIndexType > &inds) |
| This adds a vector of indices.
|
|
void | addIndices (const ofIndexType *inds, std::size_t amt) |
| This adds indices to the ofMesh by pointing to an array of indices. The "amt" defines the length of the array.
|
|
void | removeIndex (ofIndexType index) |
| Removes an index.
|
|
void | removeIndices (ofIndexType startIndex, ofIndexType endIndex) |
|
void | setIndex (ofIndexType index, ofIndexType val) |
| This sets the index at i.
|
|
void | clearIndices () |
| Remove all the indices of the mesh. This means that your mesh will be a point cloud.
|
|
std::size_t | getNumIndices () const |
| This will tell you how many indices are contained in the mesh.
|
|
ofIndexType * | getIndexPointer () |
|
const ofIndexType * | getIndexPointer () const |
|
bool | hasIndices () const |
| /returns Whether the mesh has any indices assigned to it.
|
|
void | addTriangle (ofIndexType index1, ofIndexType index2, ofIndexType index3) |
| Adding a triangle means using three of the vertices that have already been added to create a triangle. This is an easy way to create triangles in the mesh. The indices refer to the index of the vertex in the vector of vertices.
|
|
void | setColorForIndices (ofIndexType startIndex, ofIndexType endIndex, ofDefaultColorType color) |
|
ofMesh_< ofDefaultVertexType, ofDefaultNormalType, ofDefaultColorType, ofDefaultTexCoordType > | getMeshForIndices (ofIndexType startIndex, ofIndexType endIndex) const |
|
ofMesh_< ofDefaultVertexType, ofDefaultNormalType, ofDefaultColorType, ofDefaultTexCoordType > | getMeshForIndices (ofIndexType startIndex, ofIndexType endIndex, ofIndexType startVertIndex, ofIndexType endVertIndex) const |
|
void | drawVertices () const |
| This allows you draw just the vertices, meaning that you'll have a point cloud.
|
|
void | drawWireframe () const |
| This draws the mesh as GL_LINES, meaning that you'll have a wireframe.
|
|
void | drawFaces () const |
| This draws the mesh as faces, meaning that you'll have a collection of faces.
|
|
void | draw () const |
| This draws the mesh using its primitive type, meaning that if you set them up to be triangles, this will draw the triangles.
|
|
void | load (const of::filesystem::path &path) |
| Loads a mesh from a file located at the provided path into the mesh. This will replace any existing data within the mesh.
|
|
void | save (const of::filesystem::path &path, bool useBinary=false) const |
| Saves the mesh at the passed path in the PLY Format.
|
|