VuoMesh implementation.
- Copyright
- Copyright © 2012–2023 Kosada Incorporated. This code may be modified and distributed under the terms of the MIT License. For more information, see https://vuo.org/license.
Definition in file VuoMesh.c.
|
void | VuoMesh_allocateCPUBuffers (unsigned int vertexCount, float **positions, float **normals, float **textureCoordinates, float **colors, unsigned int elementCount, unsigned int **elements) |
| Allocates:
|
|
static void | VuoMesh_free (void *value) |
| Frees the mesh and each of its submeshes, including the vertex and element arrays within it.
|
|
static void | VuoMesh_upload (VuoMesh_internal *m) |
| Uploads mesh to the GPU.
|
|
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.
|
|
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.
|
|
unsigned long | VuoMesh_getGlMode (VuoMesh mesh) |
| Returns the GL mode (e.g., GL_TRIANGLES ) that the mesh should be interpreted as.
|
|
unsigned long | VuoMesh_getSplitPrimitiveCount (VuoMesh mesh) |
| Returns the number of split primitives in the mesh.
|
|
unsigned long | VuoMesh_getSplitVertexCount (VuoMesh mesh) |
| Returns the number of split vertices in the mesh.
|
|
static unsigned long | VuoMesh_getCompleteElementCountInternal (unsigned long elementCount, VuoMesh_ElementAssemblyMethod elementAssemblyMethod) |
| Helper for VuoMesh_make_VuoPoint* and VuoMesh_getCompleteElementCount.
|
|
unsigned long | VuoMesh_getCompleteElementCount (const VuoMesh mesh) |
| Returns the number of complete elements in the mesh.
|
|
static VuoMesh | VuoMesh_makeQuadWithNormalsInternal (void) |
| Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.
|
|
static VuoMesh | VuoMesh_makeQuadWithoutNormalsInternal (void) |
| Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.
|
|
static VuoMesh | VuoMesh_makeEquilateralTriangleInternal (void) |
| Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin.
|
|
VuoMesh | VuoMesh_makeQuad (void) |
| Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.
|
|
VuoMesh | VuoMesh_makeQuadWithoutNormals (void) |
| Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.
|
|
VuoMesh | VuoMesh_makeEquilateralTriangle (void) |
| Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin.
|
|
static VuoMesh | VuoMesh_makeCubeInternal (void) |
| Returns a cube of size 1x1.
|
|
VuoMesh | VuoMesh_makeCube (void) |
| Returns a cube of size 1x1.
|
|
VuoMesh | VuoMesh_makePlane (VuoInteger columns, VuoInteger rows) |
| Creates a flat mesh subdivided into rows and columns.
|
|
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.
|
|
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.
|
|
VuoMesh | VuoMesh_copy (const VuoMesh mesh) |
| Duplicates the mesh's CPU data, and retains the mesh's GPU data.
|
|
VuoMesh | VuoMesh_copyShallow (const VuoMesh mesh) |
| Makes a shallow copy of the mesh and its submeshes.
|
|
void | VuoMesh_removeTextureCoordinates (VuoMesh mesh) |
| Deallocates and clears the texture coordinate arrays associated with this mesh.
|
|
static void | VuoMesh_download (VuoMesh_internal *m) |
| Copies element data from the GPU back to the CPU.
|
|
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.
|
|
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.
|
|
VuoMesh_ElementAssemblyMethod | VuoMesh_getElementAssemblyMethod (const VuoMesh mesh) |
| Returns the mesh's element assembly method.
|
|
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.
|
|
VuoReal | VuoMesh_getPrimitiveSize (const VuoMesh mesh) |
| Returns the size, in Vuo Coordinates, at which lines and points should be rendered.
|
|
unsigned int | VuoMesh_getElementBufferSize (const VuoMesh mesh) |
| Returns the size, in bytes, of the GPU element buffer.
|
|
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.
|
|
void | VuoMesh_setFaceCulling (VuoMesh mesh, VuoMesh_FaceCulling faceCulling) |
| Changes the mesh's face culling mode.
|
|
void | VuoMesh_setPrimitiveSize (VuoMesh mesh, VuoReal primitiveSize) |
| Changes the size, in Vuo Coordinates, at which lines and points should be rendered.
|
|
VuoMesh_ElementAssemblyMethod | VuoMesh_elementAssemblyMethodFromCString (const char *elementAssemblyMethodString) |
| Returns the VuoMesh_ElementAssemblyMethod corresponding with the string elementAssemblyMethodString .
|
|
const char * | VuoMesh_cStringForElementAssemblyMethod (VuoMesh_ElementAssemblyMethod elementAssemblyMethod) |
| Returns a string constant representing elementAssemblyMethod .
|
|
VuoBox | VuoMesh_bounds (const VuoMesh mesh, float matrix[16]) |
| Finds the mesh's center and axis-aligned extents, taking into account the passed transform.
|
|
bool | VuoMesh_isPopulated (const VuoMesh mesh) |
| Returns true if the mesh has any vertices.
|
|
static void | VuoMesh_releaseCallback (struct json_object *js, void *mesh) |
| Callback to pass to json_object_set_userdata() .
|
|
VuoMesh | VuoMesh_makeFromJson (json_object *js) |
| Decodes the JSON object js to create a new value.
|
|
json_object * | VuoMesh_getJson (const VuoMesh value) |
| Encodes value as a JSON object.
|
|
json_object * | VuoMesh_getInterprocessJson (const VuoMesh value) |
| Calls VuoMesh_getJson().
|
|
char * | VuoMesh_getSummary (const VuoMesh mesh) |
| Returns a brief summary of the contents of this mesh.
|
|