本文整理汇总了C++中BoundingBox::addPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::addPoint方法的具体用法?C++ BoundingBox::addPoint怎么用?C++ BoundingBox::addPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::addPoint方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addGeometry
void addGeometry(SPGeometry geometry)
{
mBB.addPoint(geometry->getBB().min());
mBB.addPoint(geometry->getBB().max());
mGeometries.push_back(geometry);
}
示例2: getBoundingBox
BoundingBox CsgRegularPolygon::getBoundingBox()
{
BoundingBox ret;
Matrix33f mat = getMatrix();
Vec3f v;
v = mat * Vec3f(-0.5, -0.5, 1);
ret.addPoint(v);
v = mat * Vec3f(-0.5, +0.5, 1);
ret.addPoint(v);
v = mat * Vec3f(+0.5, -0.5, 1);
ret.addPoint(v);
v = mat * Vec3f(+0.5, +0.5, 1);
ret.addPoint(v);
return ret;
}
示例3: buildCollision
void buildCollision()
{
if (!mChanged)
return;
mChanged = false;
mBoundingBoxes.clear();
m_BB.reset();
for (size_t div = 0; div < mVertices.size() / mDivCount; div++)
{
BoundingBox<Vector> bb;
for (auto i = div*mDivCount; i < mVertices.size(); i++)
{
if (i > div*mDivCount + mDivCount)
break;
bb.addPoint(mVertices[i]);
m_BB.addPoint(mVertices[i]);
}
mBoundingBoxes.push_back(bb);
}
if (mVertices.size() % mDivCount != 0)
{
BoundingBox<Vector> bb;
auto start = mVertices.size() - mVertices.size() % mDivCount;
auto end = mVertices.size();
for (auto i = start; i < end; i++)
{
bb.addPoint(mVertices[i]);
m_BB.addPoint(mVertices[i]);
}
mBoundingBoxes.push_back(bb);
}
}
示例4: getPoints
void Mesh
::getBoundingBox(BoundingBox &b) const
{
b.setEmpty();
// iterate over positions
for(PointList::const_iterator p = getPoints().begin();
p != getPoints().end();
++p)
{
b.addPoint(*p);
} // end for p
} // end Mesh::getBoundingBox()
示例5: CreateBoundingBox
osg::Node* OSGVisualizationFactory::CreateBoundingBox(osg::Node *model, bool wireFrame)
{
if (!model)
return NULL;
const osg::MatrixList& m = model->getWorldMatrices();
osg::ComputeBoundsVisitor cbv;
model->accept( cbv );
osg::BoundingBox bboxOSG = cbv.getBoundingBox();
osg::Vec3 minV = bboxOSG._min * m.front();
osg::Vec3 maxV = bboxOSG._max * m.front();
BoundingBox bbox;
Eigen::Vector3f minPoint(minV[0],minV[1],minV[2]);
Eigen::Vector3f maxPoint(maxV[0],maxV[1],maxV[2]);
bbox.addPoint(minPoint);
bbox.addPoint(maxPoint);
return CreateBoundingBoxVisualization(bbox,wireFrame);
}
示例6: recomputeBoundingBox
void PointSetNode::recomputeBoundingBox()
{
CoordinateNode *coordinate = getCoordinateNodes();
if (!coordinate) {
setBoundingBoxCenter(0.0f, 0.0f, 0.0f);
setBoundingBoxSize(-1.0f, -1.0f, -1.0f);
return;
}
BoundingBox bbox;
float point[3];
int nCoordinatePoints = coordinate->getNPoints();
for (int n=0; n<nCoordinatePoints; n++) {
coordinate->getPoint(n, point);
bbox.addPoint(point);
}
setBoundingBox(&bbox);
}