Vuo  2.0.0
Functions
VuoMesh.c File Reference

Description

VuoMesh implementation.

Definition in file VuoMesh.c.

Go to the source code of this file.

Macros

#define glGenVertexArrays   glGenVertexArraysAPPLE
 Stub. More...
 
#define glBindVertexArray   glBindVertexArrayAPPLE
 Stub. More...
 
#define glDeleteVertexArrays   glDeleteVertexArraysAPPLE
 Stub. More...
 

Functions

VuoSubmesh VuoSubmesh_make (unsigned int vertexCount, unsigned int elementCount)
 Allocates the vertex (position, normal, ...) and element arrays. More...
 
VuoSubmesh VuoSubmesh_makeFromBuffers (unsigned int vertexCount, VuoPoint4d *positions, VuoPoint4d *normals, VuoPoint4d *tangents, VuoPoint4d *bitangents, VuoPoint4d *textureCoordinates, unsigned int elementCount, unsigned int *elements, VuoMesh_ElementAssemblyMethod elementAssemblyMethod)
 Creates a VuoSubmesh consisting of data that already exists in CPU RAM. More...
 
VuoSubmesh VuoSubmesh_makeGl (unsigned int vertexCount, unsigned int combinedBuffer, unsigned int combinedBufferSize, unsigned int combinedBufferStride, void *normalOffset, void *tangentOffset, void *bitangentOffset, void *textureCoordinateOffset, 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...
 
unsigned long VuoSubmesh_getGlMode (VuoSubmesh submesh)
 Returns the GL mode (e.g., GL_TRIANGLES) that submesh should be interpreted as. More...
 
unsigned long VuoSubmesh_getSplitPrimitiveCount (VuoSubmesh submesh)
 Returns the number of split primitives in submesh. More...
 
unsigned long VuoSubmesh_getSplitVertexCount (VuoSubmesh submesh)
 Returns the number of split vertices in submesh. More...
 
unsigned long VuoSubmesh_getCompleteElementCount (const VuoSubmesh submesh)
 Returns the number of complete elements in submesh. More...
 
void VuoMesh_free (void *value)
 Frees the mesh and each of its submeshes, including the vertex and element arrays within it. More...
 
VuoMesh VuoMesh_make (unsigned int submeshCount)
 Creates and registers a mesh with empty slots for the given number of sub-meshes. More...
 
void VuoMesh_upload (VuoMesh mesh)
 Uploads mesh to the GPU. More...
 
VuoMesh VuoMesh_makeFromSingleSubmesh (VuoSubmesh submesh)
 Creates and registers a mesh with space for one submesh, and sets it to the given submesh. More...
 
static VuoMesh VuoMesh_makeSingletonFromSingleSubmesh (VuoSubmesh submesh)
 Creates and registers a singleton mesh with space for one submesh, and sets it to the given submesh. More...
 
static VuoMesh VuoMesh_makeQuadWithNormalsInternal (void)
 Returns a quad with dimensions 1x1, on the XY plane, centered at the origin. More...
 
static VuoMesh VuoMesh_makeQuadWithoutNormalsInternal (void)
 Returns a quad with dimensions 1x1, on the XY plane, centered at the origin. More...
 
static VuoMesh VuoMesh_makeEquilateralTriangleInternal (void)
 Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin. More...
 
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...
 
static VuoMesh VuoMesh_makeCubeInternal (void)
 Returns a cube of size 1x1. More...
 
VuoMesh VuoMesh_makeCube (void)
 Returns a cube of size 1x1. More...
 
VuoMesh VuoMesh_make_VuoPoint2d (VuoList_VuoPoint2d positions, 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, VuoMesh_ElementAssemblyMethod elementAssemblyMethod, VuoReal primitiveSize)
 Returns a VuoMesh consisting of the given positions and element assembly method. More...
 
VuoMesh VuoMesh_copy (const VuoMesh mesh)
 Makes a copy of the mesh and its submeshes. More...
 
VuoMesh VuoMesh_copyShallow (const VuoMesh mesh)
 Makes a shallow copy of the mesh and its submeshes. More...
 
VuoMesh_ElementAssemblyMethod VuoMesh_elementAssemblyMethodFromCString (const char *elementAssemblyMethodString)
 
const char * VuoMesh_cStringForElementAssemblyMethod (VuoMesh_ElementAssemblyMethod elementAssemblyMethod)
 Returns a string constant representing elementAssemblyMethod. More...
 
unsigned long VuoSubmesh_getStride (const VuoSubmesh submesh)
 Returns the number of bytes per combined-buffer entry. More...
 
VuoPoint4d * extractElements (CGLContextObj cgl_ctx, VuoSubmesh *submesh, unsigned int vertexCount, unsigned int bufferStrideInBytes, unsigned int bufferIndex)
 Pulls an element array from gl buffer. More...
 
void VuoSubmesh_download (VuoSubmesh *submesh)
 Copies element data from GPU back to the CPU. More...
 
VuoBox VuoMesh_bounds (const VuoMesh v, float matrix[16])
 Iterates through mesh's vertices finding the center and extents. More...
 
bool VuoMesh_isPopulated (const VuoMesh mesh)
 Returns true if the mesh has at least one submesh with a non-zero vertex count. More...
 
VuoMesh VuoMesh_makeFromJson (json_object *js)
 
json_objectVuoMesh_getJson (const VuoMesh value)
 
json_objectVuoMesh_getInterprocessJson (const VuoMesh value)
 
char * VuoSubmesh_getSummary (const VuoSubmesh value)
 
char * VuoMesh_getSummary (const VuoMesh value)
 

Macro Definition Documentation

◆ glBindVertexArray

#define glBindVertexArray   glBindVertexArrayAPPLE

Stub.

Definition at line 17 of file VuoMesh.c.

◆ glDeleteVertexArrays

#define glDeleteVertexArrays   glDeleteVertexArraysAPPLE

Stub.

Definition at line 18 of file VuoMesh.c.

◆ glGenVertexArrays

#define glGenVertexArrays   glGenVertexArraysAPPLE

Stub.

Definition at line 16 of file VuoMesh.c.

Function Documentation

◆ extractElements()

VuoPoint4d* extractElements ( CGLContextObj  cgl_ctx,
VuoSubmesh submesh,
unsigned int  vertexCount,
unsigned int  bufferStrideInBytes,
unsigned int  bufferIndex 
)

Pulls an element array from gl buffer.

Definition at line 1082 of file VuoMesh.c.

◆ VuoMesh_free()

void VuoMesh_free ( void *  value)

Frees the mesh and each of its submeshes, including the vertex and element arrays within it.

Definition at line 273 of file VuoMesh.c.

◆ VuoMesh_makeCubeInternal()

static VuoMesh VuoMesh_makeCubeInternal ( void  )
static

Returns a cube of size 1x1.

Definition at line 621 of file VuoMesh.c.

◆ VuoMesh_makeEquilateralTriangleInternal()

static VuoMesh VuoMesh_makeEquilateralTriangleInternal ( void  )
static

Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin.

Definition at line 531 of file VuoMesh.c.

◆ VuoMesh_makeQuadWithNormalsInternal()

static VuoMesh VuoMesh_makeQuadWithNormalsInternal ( void  )
static

Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.

Definition at line 439 of file VuoMesh.c.

◆ VuoMesh_makeQuadWithoutNormalsInternal()

static VuoMesh VuoMesh_makeQuadWithoutNormalsInternal ( void  )
static

Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.

The quad consists of only positions and texture coordinates (without normals, tangents, or bitangents).

Definition at line 496 of file VuoMesh.c.

◆ VuoMesh_makeSingletonFromSingleSubmesh()

static VuoMesh VuoMesh_makeSingletonFromSingleSubmesh ( VuoSubmesh  submesh)
static

Creates and registers a singleton mesh with space for one submesh, and sets it to the given submesh.

Uploads the submesh to the GPU.

Definition at line 425 of file VuoMesh.c.