Vuo
2.0.0
type
VuoMesh.h
Go to the documentation of this file.
1
10
#pragma once
11
12
#include "
VuoPoint2d.h
"
13
#include "
VuoPoint3d.h
"
14
#include "
VuoPoint4d.h
"
15
#include "
VuoList_VuoPoint2d.h
"
16
#include "
VuoList_VuoPoint3d.h
"
17
29
typedef
enum
{
30
VuoMesh_IndividualTriangles
,
31
VuoMesh_TriangleStrip
,
32
VuoMesh_TriangleFan
,
33
VuoMesh_IndividualLines
,
34
VuoMesh_LineStrip
,
35
VuoMesh_Points
36
}
VuoMesh_ElementAssemblyMethod
;
37
41
typedef
struct
42
{
43
unsigned
int
vertexCount
;
44
VuoPoint4d * positions;
46
VuoPoint4d *
normals
;
47
VuoPoint4d *
tangents
;
48
VuoPoint4d *
bitangents
;
49
VuoPoint4d *
textureCoordinates
;
50
51
unsigned
int
elementCount
;
52
56
unsigned
int
*
elements
;
57
59
VuoMesh_ElementAssemblyMethod
elementAssemblyMethod
;
60
65
VuoReal
primitiveSize
;
66
68
unsigned
int
faceCullingMode
;
69
73
struct
74
{
75
unsigned
int
combinedBuffer;
76
unsigned
int
combinedBufferSize;
77
unsigned
int
combinedBufferStride;
// Number of bytes per buffer entry. If 0, the stride is calculated automatically based on sizeof(VuoPoint4d) multiplied by 1 (position) + the number of non-NULL offsets below.
78
79
void
*normalOffset;
80
void
*tangentOffset;
81
void
*bitangentOffset;
82
void
*textureCoordinateOffset;
83
84
unsigned
int
elementBuffer;
85
unsigned
int
elementBufferSize;
86
} glUpload;
87
}
VuoSubmesh
;
88
92
typedef
struct
_VuoMesh
93
{
94
unsigned
int
submeshCount
;
95
VuoSubmesh
*
submeshes
;
96
} *
VuoMesh
;
97
98
VuoSubmesh
VuoSubmesh_make
(
unsigned
int
vertexCount,
unsigned
int
elementCount);
99
VuoSubmesh
VuoSubmesh_makeFromBuffers
(
unsigned
int
vertexCount,
100
VuoPoint4d *positions, VuoPoint4d *normals, VuoPoint4d *tangents, VuoPoint4d *bitangents, VuoPoint4d *textureCoordinates,
101
unsigned
int
elementCount,
unsigned
int
*elements,
VuoMesh_ElementAssemblyMethod
elementAssemblyMethod);
102
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);
103
unsigned
long
VuoSubmesh_getGlMode
(
VuoSubmesh
submesh);
104
unsigned
long
VuoSubmesh_getSplitPrimitiveCount
(
VuoSubmesh
submesh);
105
unsigned
long
VuoSubmesh_getSplitVertexCount
(
VuoSubmesh
submesh);
106
unsigned
long
VuoSubmesh_getCompleteElementCount
(
const
VuoSubmesh
submesh);
107
unsigned
long
VuoSubmesh_getStride
(
const
VuoSubmesh
submesh);
108
109
VuoMesh
VuoMesh_make
(
unsigned
int
itemCount);
110
void
VuoMesh_upload
(
VuoMesh
mesh);
111
VuoMesh
VuoMesh_makeFromSingleSubmesh
(
VuoSubmesh
submesh);
112
VuoMesh
VuoMesh_makeQuad
(
void
);
113
VuoMesh
VuoMesh_makeQuadWithoutNormals
(
void
);
114
VuoMesh
VuoMesh_makeEquilateralTriangle
(
void
);
115
VuoMesh
VuoMesh_makeCube
(
void
);
116
VuoMesh
VuoMesh_make_VuoPoint2d
(
VuoList_VuoPoint2d
positions,
VuoMesh_ElementAssemblyMethod
elementAssemblyMethod,
VuoReal
primitiveSize);
117
VuoMesh
VuoMesh_make_VuoPoint3d
(
VuoList_VuoPoint3d
positions,
VuoMesh_ElementAssemblyMethod
elementAssemblyMethod,
VuoReal
primitiveSize);
118
119
VuoMesh
VuoMesh_copy
(
const
VuoMesh
mesh);
120
VuoMesh
VuoMesh_copyShallow
(
const
VuoMesh
mesh);
121
122
const
char
*
VuoMesh_cStringForElementAssemblyMethod
(
VuoMesh_ElementAssemblyMethod
elementAssemblyMethod);
123
VuoBox
VuoMesh_bounds
(
const
VuoMesh
mesh,
float
matrix[16]);
124
bool
VuoMesh_isPopulated
(
const
VuoMesh
mesh);
125
void
VuoSubmesh_download
(
VuoSubmesh
*submesh);
126
127
VuoMesh
VuoMesh_makeFromJson
(
struct
json_object
* js);
128
struct
json_object
*
VuoMesh_getJson
(
const
VuoMesh
value);
129
131
#define VuoMesh_REQUIRES_INTERPROCESS_JSON
132
struct
json_object
*
VuoMesh_getInterprocessJson
(
const
VuoMesh
value);
133
134
char
*
VuoMesh_getSummary
(
const
VuoMesh
value);
135
139
static
inline
VuoMesh_ElementAssemblyMethod
VuoMesh_getExpandedPrimitiveMode
(
const
VuoMesh_ElementAssemblyMethod
inputMode)
140
{
141
if
(inputMode ==
VuoMesh_IndividualTriangles
142
|| inputMode ==
VuoMesh_TriangleFan
143
|| inputMode ==
VuoMesh_TriangleStrip
)
144
return
VuoMesh_IndividualTriangles
;
145
else
if
(inputMode ==
VuoMesh_IndividualLines
146
|| inputMode ==
VuoMesh_LineStrip
)
147
return
VuoMesh_IndividualLines
;
148
else
149
return
VuoMesh_Points
;
150
}
151
153
156
VuoMesh
VuoMesh_makeFromString
(
const
char
*str);
157
char
*
VuoMesh_getString
(
const
VuoMesh
value);
158
void
VuoMesh_retain
(
const
VuoMesh
v);
159
void
VuoMesh_release
(
const
VuoMesh
v);
161
Generated on Thu Aug 29 2019 16:20:55 for Vuo by
1.8.16