本文整理汇总了C++中TriMesh::appendColorsRgba方法的典型用法代码示例。如果您正苦于以下问题:C++ TriMesh::appendColorsRgba方法的具体用法?C++ TriMesh::appendColorsRgba怎么用?C++ TriMesh::appendColorsRgba使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriMesh
的用法示例。
在下文中一共展示了TriMesh::appendColorsRgba方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: regenerateVboMesh
void BatchedMesh::regenerateVboMesh(MaterialRef material) {
// cout << "BatchedMesh::regenerateVboMesh(): Regenerating VboMesh for
// material:"
// << material << endl;
TriMesh combinedMesh;
vector<Vec3f> vertices;
vector<ColorAf> colors;
vector<Vec2f> texCoords;
vector<uint32_t> indices;
uint32_t vertCount = 0;
_materialBounds[material] = AxisAlignedBox3f();
for (BatchInfoRef batchInfo : _meshes[material]) {
TriMesh *internalMesh = batchInfo->mesh->getInternalMesh(
batchInfo->transform->getTransformMatrixLocal());
vertices = internalMesh->getVertices();
combinedMesh.appendVertices(vertices.data(), vertices.size());
colors = internalMesh->getColorsRGBA();
combinedMesh.appendColorsRgba(colors.data(), colors.size());
texCoords = internalMesh->getTexCoords();
combinedMesh.appendTexCoords(texCoords.data(), texCoords.size());
indices = internalMesh->getIndices();
std::transform(std::begin(indices), std::end(indices), std::begin(indices),
[vertCount](uint32_t x) { return x + vertCount; });
combinedMesh.appendIndices(indices.data(), indices.size());
vertCount += vertices.size();
_materialBounds[material].include(internalMesh->calcBoundingBox());
}
_vboMeshes[material] = gl::VboMesh::create(combinedMesh);
// Recalculate master bounds
_bounds = AxisAlignedBox3f();
for (auto &kvp : _materialBounds) {
_bounds.include(kvp.second);
}
}