本文整理汇总了C++中BoundingBox::ext方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::ext方法的具体用法?C++ BoundingBox::ext怎么用?C++ BoundingBox::ext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::ext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateBoundingBox
void Mesh::calculateBoundingBox (BoundingBox& bbox) {
int numVertices = getNumVertices();
if (numVertices == 0) gdx_log_error("gdx","No vertices defined");
float_buffer verts = vertices->getBuffer();
bbox.inf();
VertexAttribute& posAttrib = *getVertexAttribute(VertexAttributes::Usage::Position);
int offset = posAttrib.offset / 4;
int vertexSize = vertices->getAttributes().vertexSize / 4;
int idx = offset;
switch (posAttrib.numComponents) {
case 1:
for (int i = 0; i < numVertices; i++) {
bbox.ext(verts.get(idx), 0, 0);
idx += vertexSize;
}
break;
case 2:
for (int i = 0; i < numVertices; i++) {
bbox.ext(verts.get(idx), verts.get(idx + 1), 0);
idx += vertexSize;
}
break;
case 3:
for (int i = 0; i < numVertices; i++) {
bbox.ext(verts.get(idx), verts.get(idx + 1), verts.get(idx + 2));
idx += vertexSize;
}
break;
}
}
示例2: getBoundingBox
void StillModel::getBoundingBox ( BoundingBox& bbox )
{
bbox.inf();
for ( size_t i = 0; i < subMeshes.size(); i++ ) {
subMeshes[i]->mesh->calculateBoundingBox ( tmpbox );
bbox.ext ( tmpbox );
}
}
示例3: calculateBoundingBox
void Mesh::calculateBoundingBox(BoundingBox& bbox)
{
int numVertices = getNumVertices();
if (numVertices == 0)
throw GdxRuntimeException("No vertices defined");
float* verts = m_vertices->getBuffer();
bbox.inf();
VertexAttribute posAttrib;
getVertexAttribute(VertexAttributes::Position, posAttrib);
int offset = posAttrib.offset / 4;
int vertexSize = m_vertices->getAttributes().vertexSize() / 4;
int idx = offset;
switch (posAttrib.numComponents) {
case 1:
for (int i = 0; i < numVertices; i++)
{
bbox.ext(verts[idx], 0, 0);
idx += vertexSize;
}
break;
case 2:
for (int i = 0; i < numVertices; i++)
{
bbox.ext(verts[idx], verts[idx + 1], 0);
idx += vertexSize;
}
break;
case 3:
for (int i = 0; i < numVertices; i++)
{
bbox.ext(verts[idx], verts[idx + 1], verts[idx + 2]);
idx += vertexSize;
}
break;
}
}