本文整理汇总了C++中SubEntity::_getSkelAnimVertexData方法的典型用法代码示例。如果您正苦于以下问题:C++ SubEntity::_getSkelAnimVertexData方法的具体用法?C++ SubEntity::_getSkelAnimVertexData怎么用?C++ SubEntity::_getSkelAnimVertexData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubEntity
的用法示例。
在下文中一共展示了SubEntity::_getSkelAnimVertexData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getEntityStatistics
//-----------------------------------------------------------------------
void
MeshInformer::getEntityTriangles(const Entity* entity,
std::vector<Vector3>& vertices,
std::vector<size_t>& indices,
std::vector<size_t>* indexOffsets)
{
size_t numVertices = 0, numIndices = 0;
getEntityStatistics(entity, numVertices, numIndices);
size_t vertex_offset = vertices.size();
size_t index_offset = indices.size();
vertices.resize(vertex_offset + numVertices);
indices.resize(index_offset + numIndices);
// Software blended vertex data available only if animation enabled, and software animation are
// used by internally engine, or user requested software animation.
bool useBlended = entity->_isAnimated() &&
(!entity->isHardwareAnimationEnabled() || entity->getSoftwareAnimationRequests() > 0);
// Use skinned vertex data only if blended data available and skeleton animation enabled.
bool useSkinned = useBlended && entity->_isSkeletonAnimated();
Vector3* pVertices = &vertices[0];
size_t* pIndices = &indices[0];
size_t shared_vertex_offset = vertex_offset;
bool added_shared_vertex = false;
size_t numSubEntities = entity->getNumSubEntities();
for (size_t i = 0; i < numSubEntities; ++i)
{
SubEntity* subEntity = entity->getSubEntity(i);
if (!subEntity->isVisible())
{
// Skip non-visible sub-entity
continue;
}
SubMesh* subMesh = subEntity->getSubMesh();
if (indexOffsets)
{
indexOffsets->push_back(index_offset);
}
if (subMesh->operationType == RenderOperation::OT_TRIANGLE_LIST ||
subMesh->operationType == RenderOperation::OT_TRIANGLE_STRIP ||
subMesh->operationType == RenderOperation::OT_TRIANGLE_FAN)
{
size_t current_vertex_offset;
if (subMesh->useSharedVertices)
{
if (!added_shared_vertex)
{
size_t vertexCount = getVertices(pVertices + vertex_offset,
useSkinned ? entity->_getSkelAnimVertexData()
:
useBlended && subMesh->parent->getSharedVertexDataAnimationType() != VAT_NONE ? entity->_getSoftwareVertexAnimVertexData()
:
subMesh->parent->sharedVertexData);
shared_vertex_offset = vertex_offset;
vertex_offset += vertexCount;
added_shared_vertex = true;
}
current_vertex_offset = shared_vertex_offset;
}
else
{
size_t vertexCount = getVertices(pVertices + vertex_offset,
useSkinned ? subEntity->_getSkelAnimVertexData()
:
useBlended && subMesh->getVertexAnimationType() != VAT_NONE ? subEntity->_getSoftwareVertexAnimVertexData()
:
subMesh->vertexData);
current_vertex_offset = vertex_offset;
vertex_offset += vertexCount;
}
size_t index_count = getTriangles(pIndices + index_offset, subMesh->indexData, current_vertex_offset, subMesh->operationType);
index_offset += index_count;
}
}
}