Vuo
2.0.0
|
Vertices representing a 3D object.
Classes | |
struct | VuoMesh |
A 3D mesh, consisting of CPU and/or GPU data describing a list of elements (positions, normals, texture coordinates, colors) which represent points or are assembled into lines or triangles. More... | |
Macros | |
#define | VuoMesh_REQUIRES_INTERPROCESS_JSON |
This type has a _getInterprocessJson() function. More... | |
Enumerations | |
enum | VuoMesh_ElementAssemblyMethod { VuoMesh_IndividualTriangles, VuoMesh_TriangleStrip, VuoMesh_TriangleFan, VuoMesh_IndividualLines, VuoMesh_LineStrip, VuoMesh_Points } |
The way in which an elements array should be interpreted during rasterization. More... | |
enum | VuoMesh_FaceCulling { VuoMesh_CullNone, VuoMesh_CullBackfaces, VuoMesh_CullFrontfaces } |
Which triangles to render. More... | |
Functions | |
VuoMesh_ElementAssemblyMethod | VuoMesh_elementAssemblyMethodFromCString (const char *elementAssemblyMethodString) |
VuoMesh | VuoMesh_makeFromJson (json_object *js) |
json_object * | VuoMesh_getJson (const VuoMesh value) |
json_object * | VuoMesh_getInterprocessJson (const VuoMesh value) |
char * | VuoMesh_getSummary (const VuoMesh mesh) |
VuoMesh | VuoMesh_makeQuad (void) |
Returns a quad with dimensions 1x1, on the XY plane, centered at the origin. More... | |
VuoMesh | VuoMesh_makeQuadWithoutNormals (void) |
Returns a quad with dimensions 1x1, on the XY plane, centered at the origin. More... | |
VuoMesh | VuoMesh_makeEquilateralTriangle (void) |
Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin. More... | |
VuoMesh | VuoMesh_makeCube (void) |
Returns a cube of size 1x1. More... | |
VuoMesh | VuoMesh_makePlane (VuoInteger columns, VuoInteger rows) |
Creates a flat mesh subdivided into rows and columns. More... | |
VuoMesh | VuoMesh_make_VuoPoint2d (VuoList_VuoPoint2d positions, VuoList_VuoColor colors, VuoMesh_ElementAssemblyMethod elementAssemblyMethod, VuoReal primitiveSize) |
Returns a VuoMesh consisting of the given positions and element assembly method. More... | |
VuoMesh | VuoMesh_make_VuoPoint3d (VuoList_VuoPoint3d positions, VuoList_VuoColor colors, VuoMesh_ElementAssemblyMethod elementAssemblyMethod, VuoReal primitiveSize) |
Returns a VuoMesh consisting of the given positions and element assembly method. More... | |
void | VuoMesh_allocateCPUBuffers (unsigned int vertexCount, float **positions, float **normals, float **textureCoordinates, float **colors, unsigned int elementCount, unsigned int **elements) |
Allocates: More... | |
VuoMesh | VuoMesh_makeFromCPUBuffers (unsigned int vertexCount, float *positions, float *normals, float *textureCoordinates, float *colors, unsigned int elementCount, unsigned int *elements, VuoMesh_ElementAssemblyMethod elementAssemblyMethod) |
Creates a mesh consisting of data that already exists in CPU RAM, and uploads it to the GPU. More... | |
VuoMesh | VuoMesh_makeFromGPUBuffers (unsigned int vertexCount, unsigned int combinedBuffer, unsigned int combinedBufferSize, void *normalOffset, void *textureCoordinateOffset, void *colorOffset, unsigned int elementCount, unsigned int elementBuffer, unsigned int elementBufferSize, VuoMesh_ElementAssemblyMethod elementAssemblyMethod) |
Creates a VuoSubmesh consisting of data that's already been uploaded to the GPU. More... | |
VuoMesh | VuoMesh_copy (const VuoMesh mesh) |
Duplicates the mesh's CPU data, and retains the mesh's GPU data. More... | |
VuoMesh | VuoMesh_copyShallow (const VuoMesh mesh) |
Makes a shallow copy of the mesh and its submeshes. More... | |
void | VuoMesh_removeTextureCoordinates (VuoMesh mesh) |
Deallocates and clears the texture coordinate arrays associated with this mesh. More... | |
void | VuoMesh_getCPUBuffers (const VuoMesh mesh, unsigned int *vertexCount, float **positions, float **normals, float **textureCoordinates, float **colors, unsigned int *elementCount, unsigned int **elements) |
Outputs vertex and element information, downloading the data from the GPU if needed. More... | |
void | VuoMesh_getGPUBuffers (const VuoMesh mesh, unsigned int *vertexCount, unsigned int *combinedBuffer, void **normalOffset, void **textureCoordinateOffset, void **colorOffset, unsigned int *elementCount, unsigned int *elementBuffer) |
Outputs OpenGL vertex and element buffer information, uploading the data to the GPU if needed. More... | |
VuoMesh_ElementAssemblyMethod | VuoMesh_getElementAssemblyMethod (const VuoMesh mesh) |
Returns the mesh's element assembly method. More... | |
VuoMesh_FaceCulling | VuoMesh_getFaceCulling (const VuoMesh mesh) |
Returns the mesh's face culling mode. More... | |
unsigned int | VuoMesh_getFaceCullingGL (const VuoMesh mesh) |
Returns the OpenGL enum value for the mesh's face culling mode. More... | |
VuoReal | VuoMesh_getPrimitiveSize (const VuoMesh mesh) |
Returns the size, in Vuo Coordinates, at which lines and points should be rendered. More... | |
unsigned long | VuoMesh_getGlMode (const VuoMesh mesh) |
Returns the GL mode (e.g., GL_TRIANGLES ) that the mesh should be interpreted as. More... | |
unsigned long | VuoMesh_getSplitPrimitiveCount (const VuoMesh mesh) |
Returns the number of split primitives in the mesh. More... | |
unsigned long | VuoMesh_getSplitVertexCount (const VuoMesh mesh) |
Returns the number of split vertices in the mesh. More... | |
unsigned long | VuoMesh_getCompleteElementCount (const VuoMesh mesh) |
Returns the number of complete elements in the mesh. More... | |
unsigned int | VuoMesh_getElementBufferSize (const VuoMesh mesh) |
Returns the size, in bytes, of the GPU element buffer. More... | |
void | VuoMesh_setCPUBuffers (VuoMesh mesh, unsigned int vertexCount, float *positions, float *normals, float *textureCoordinates, float *colors, unsigned int elementCount, unsigned int *elements) |
Changes the mesh's CPU buffers, and uploads them to the GPU. More... | |
void | VuoMesh_setFaceCulling (VuoMesh mesh, VuoMesh_FaceCulling faceCulling) |
Changes the mesh's face culling mode. More... | |
void | VuoMesh_setPrimitiveSize (VuoMesh mesh, VuoReal primitiveSize) |
Changes the size, in Vuo Coordinates, at which lines and points should be rendered. More... | |
const char * | VuoMesh_cStringForElementAssemblyMethod (VuoMesh_ElementAssemblyMethod elementAssemblyMethod) |
Returns a string constant representing elementAssemblyMethod . More... | |
VuoBox | VuoMesh_bounds (const VuoMesh mesh, float matrix[16]) |
Finds the mesh's center and axis-aligned extents, taking into account the passed transform. More... | |
bool | VuoMesh_isPopulated (const VuoMesh mesh) |
Returns true if the mesh has any vertices. More... | |
static VuoMesh_ElementAssemblyMethod | VuoMesh_getExpandedPrimitiveMode (const VuoMesh_ElementAssemblyMethod inputMode) |
For a given element assembly method, returns the equivalent assembly method for individual elements (i.e., after they've been expanded from strips/fans). More... | |
VuoMesh | VuoMesh_makeFromString (const char *str) |
Automatically generated function. More... | |
char * | VuoMesh_getString (const VuoMesh value) |
Automatically generated function. More... | |
void | VuoMesh_retain (const VuoMesh v) |
Automatically generated function. More... | |
void | VuoMesh_release (const VuoMesh v) |
Automatically generated function. More... | |
#define VuoMesh_REQUIRES_INTERPROCESS_JSON |
The way in which an elements
array should be interpreted during rasterization.
enum VuoMesh_FaceCulling |
void VuoMesh_allocateCPUBuffers | ( | unsigned int | vertexCount, |
float ** | positions, | ||
float ** | normals, | ||
float ** | textureCoordinates, | ||
float ** | colors, | ||
unsigned int | elementCount, | ||
unsigned int ** | elements | ||
) |
Allocates:
Makes a shallow copy of the mesh and its submeshes.
CPU mesh data is not present in the copy. GPU mesh data is retained.
const char* VuoMesh_cStringForElementAssemblyMethod | ( | VuoMesh_ElementAssemblyMethod | elementAssemblyMethod | ) |
VuoMesh_ElementAssemblyMethod VuoMesh_elementAssemblyMethodFromCString | ( | const char * | elementAssemblyMethodString | ) |
unsigned long VuoMesh_getCompleteElementCount | ( | const VuoMesh | mesh | ) |
Returns the number of complete elements in the mesh.
If elementCount represents an incomplete element, this function returns the rounded-down number of elements.
For example, if elementCount = 5 and elementAssemblyMethod = VuoMesh_IndividualTriangles, this function returns 3, discarding the last 2 elements that fail to form a complete triangle.
void VuoMesh_getCPUBuffers | ( | const VuoMesh | mesh, |
unsigned int * | vertexCount, | ||
float ** | positions, | ||
float ** | normals, | ||
float ** | textureCoordinates, | ||
float ** | colors, | ||
unsigned int * | elementCount, | ||
unsigned int ** | elements | ||
) |
Outputs vertex and element information, downloading the data from the GPU if needed.
You may pass NULL to any of the output variables.
Do not modify or free the output arrays; the mesh continues to own them.
VuoMesh_ElementAssemblyMethod VuoMesh_getElementAssemblyMethod | ( | const VuoMesh | mesh | ) |
Returns the mesh's element assembly method.
unsigned int VuoMesh_getElementBufferSize | ( | const VuoMesh | mesh | ) |
Returns the size, in bytes, of the GPU element buffer.
|
inlinestatic |
VuoMesh_FaceCulling VuoMesh_getFaceCulling | ( | const VuoMesh | mesh | ) |
Returns the mesh's face culling mode.
unsigned int VuoMesh_getFaceCullingGL | ( | const VuoMesh | mesh | ) |
Returns the OpenGL enum value for the mesh's face culling mode.
unsigned long VuoMesh_getGlMode | ( | const VuoMesh | mesh | ) |
void VuoMesh_getGPUBuffers | ( | const VuoMesh | mesh, |
unsigned int * | vertexCount, | ||
unsigned int * | combinedBuffer, | ||
void ** | normalOffset, | ||
void ** | textureCoordinateOffset, | ||
void ** | colorOffset, | ||
unsigned int * | elementCount, | ||
unsigned int * | elementBuffer | ||
) |
Outputs OpenGL vertex and element buffer information, uploading the data to the GPU if needed.
You may pass NULL to any of the output variables.
struct json_object * VuoMesh_getInterprocessJson | ( | const VuoMesh | value | ) |
Calls VuoMesh_getJson(). Interprocess support is not yet implemented.
struct json_object * VuoMesh_getJson | ( | const VuoMesh | value | ) |
Returns the size, in Vuo Coordinates, at which lines and points should be rendered.
unsigned long VuoMesh_getSplitPrimitiveCount | ( | VuoMesh | mesh | ) |
Returns the number of split primitives in the mesh.
For example:
unsigned long VuoMesh_getSplitVertexCount | ( | VuoMesh | mesh | ) |
Returns the number of split vertices in the mesh.
For example:
char* VuoMesh_getString | ( | const VuoMesh | value | ) |
Automatically generated function.
char * VuoMesh_getSummary | ( | const VuoMesh | mesh | ) |
bool VuoMesh_isPopulated | ( | const VuoMesh | mesh | ) |
VuoMesh VuoMesh_make_VuoPoint2d | ( | VuoList_VuoPoint2d | positions, |
VuoList_VuoColor | colors, | ||
VuoMesh_ElementAssemblyMethod | elementAssemblyMethod, | ||
VuoReal | primitiveSize | ||
) |
VuoMesh VuoMesh_make_VuoPoint3d | ( | VuoList_VuoPoint3d | positions, |
VuoList_VuoColor | colors, | ||
VuoMesh_ElementAssemblyMethod | elementAssemblyMethod, | ||
VuoReal | primitiveSize | ||
) |
VuoMesh VuoMesh_makeCube | ( | void | ) |
VuoMesh VuoMesh_makeEquilateralTriangle | ( | void | ) |
VuoMesh VuoMesh_makeFromCPUBuffers | ( | unsigned int | vertexCount, |
float * | positions, | ||
float * | normals, | ||
float * | textureCoordinates, | ||
float * | colors, | ||
unsigned int | elementCount, | ||
unsigned int * | elements, | ||
VuoMesh_ElementAssemblyMethod | elementAssemblyMethod | ||
) |
Creates a mesh consisting of data that already exists in CPU RAM, and uploads it to the GPU.
The mesh object takes ownership of the arrays passed into it, which it will eventually release using free()
.
VuoMesh VuoMesh_makeFromGPUBuffers | ( | unsigned int | vertexCount, |
unsigned int | combinedBuffer, | ||
unsigned int | combinedBufferSize, | ||
void * | normalOffset, | ||
void * | textureCoordinateOffset, | ||
void * | colorOffset, | ||
unsigned int | elementCount, | ||
unsigned int | elementBuffer, | ||
unsigned int | elementBufferSize, | ||
VuoMesh_ElementAssemblyMethod | elementAssemblyMethod | ||
) |
VuoMesh VuoMesh_makeFromJson | ( | json_object * | js | ) |
VuoMesh VuoMesh_makeFromString | ( | const char * | str | ) |
Automatically generated function.
VuoMesh VuoMesh_makePlane | ( | VuoInteger | columns, |
VuoInteger | rows | ||
) |
Creates a flat mesh subdivided into rows and columns.
VuoMesh VuoMesh_makeQuad | ( | void | ) |
VuoMesh VuoMesh_makeQuadWithoutNormals | ( | void | ) |
void VuoMesh_release | ( | const VuoMesh | v | ) |
Automatically generated function.
void VuoMesh_removeTextureCoordinates | ( | VuoMesh | mesh | ) |
Deallocates and clears the texture coordinate arrays associated with this mesh.
void VuoMesh_retain | ( | const VuoMesh | v | ) |
Automatically generated function.
void VuoMesh_setCPUBuffers | ( | VuoMesh | mesh, |
unsigned int | vertexCount, | ||
float * | positions, | ||
float * | normals, | ||
float * | textureCoordinates, | ||
float * | colors, | ||
unsigned int | elementCount, | ||
unsigned int * | elements | ||
) |
Changes the mesh's CPU buffers, and uploads them to the GPU.
The mesh takes ownership of the buffers, and will free()
them when finished.
void VuoMesh_setFaceCulling | ( | VuoMesh | mesh, |
VuoMesh_FaceCulling | faceCulling | ||
) |
Changes the mesh's face culling mode.
Changes the size, in Vuo Coordinates, at which lines and points should be rendered.