20 assert(corners.size() > 2);
32 assert(corners.size() > 2 && texCoords.size() == corners.size());
45 assert(width > 0 && height > 0);
64 SL_EXIT_MSG(
"SLPolygon::buildMesh: NO. of vertices exceeds the maximum (65535) allowed.");
74 UV[0].resize(
P.size());
78 I16.resize((
P.size() - 2) * 3);
94 if (!
UV[0].empty())
UV[0][i] =
_uv1[i];
#define SL_EXIT_MSG(message)
vector< SLVec2f > SLVVec2f
vector< SLVec3f > SLVVec3f
SLVec3< SLfloat > SLVec3f
Toplevel holder of the assets meshes, materials, textures and shaders.
Defines a standard CG material with textures and a shader program.
An SLMesh object is a triangulated mesh, drawn with one draw call.
SLVushort I16
Vector of vertex indices 16 bit.
SLbool _isVolume
Flag for RT if mesh is a closed volume.
SLVVec3f N
Vector for vertex normals (opt.) layout (location = 1)
virtual void deleteData()
SLMesh::deleteData deletes all mesh data and vbo's.
SLVVec2f UV[2]
Array of 2 Vectors for tex. coords. (opt.) layout (location = 2)
SLVVec3f P
Vector for vertex positions layout (location = 0)
SLVVec2f _uv1
texture coords for corners
void buildMesh(SLMaterial *mat)
SLPolygon::buildMesh fills in the underlying arrays from the SLMesh object.
SLVVec3f _corners
corners in ccw order
SLPolygon(SLAssetManager *assetMgr, const SLVVec3f &corner, const SLstring &name="polygon mesh", SLMaterial *mat=nullptr)
ctor for generic convex polygon