本文整理汇总了C++中AABB3D::expand方法的典型用法代码示例。如果您正苦于以下问题:C++ AABB3D::expand方法的具体用法?C++ AABB3D::expand怎么用?C++ AABB3D::expand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AABB3D
的用法示例。
在下文中一共展示了AABB3D::expand方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
virtual bool Initialize() {
viewport.n = 0.1;
viewport.f = 100;
viewport.setLensAngle(DtoR(30.0));
camera.dist = 6;
if(!geometry.empty()) {
AABB3D bb;
bb.minimize();
for(size_t i=0;i<geometry.size();i++) {
AABB3D bi = geometry[i]->GetAABB();
bb.expand(bi.bmin);
bb.expand(bi.bmax);
}
camera.tgt = (bb.bmin + bb.bmax)*0.5;
Real size = (bb.bmax-bb.bmin).maxElement();
camera.dist = 3.0*size;
if(size < 0.1) viewport.n = size;
if(size*3 > 100) viewport.f = size*3;
}
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glClearColor(0,0,0,0);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
return GLUTNavigationProgram::Initialize();
}
示例2:
void Polygon3D::getAABB(AABB3D& bb) const
{
if(vertices.size() == 0) {
bb.minimize();
return;
}
bb.setPoint(vertices[0]);
for(size_t i=1; i<vertices.size(); i++)
bb.expand(vertices[i]);
}
示例3: getAABB
AABB3D FormTriangle::getAABB() {
AABB3D aabb;
aabb._lowerBound = aabb._upperBound = _points[0];
aabb.expand(_points[1]);
aabb.expand(_points[2]);
aabb.calculateHalfDims();
aabb.calculateCenter();
return aabb;
}
示例4: loadFromOBJ
bool StaticPositionModel::loadFromOBJ(const std::string &fileName, AABB3D &aabb, bool useBuffers, bool clearArrays) {
std::ifstream fromFile(fileName);
if (!fromFile.is_open()) {
#ifdef D3D_DEBUG
std::cerr << "Could not load model file " << fileName << std::endl;
#endif
return false;
}
std::string rootName(getRootName(fileName));
std::vector<Vec3f> filePositions;
// Hash map for linking indices to vertex array index for attributes
std::unordered_map<staticPositionMeshIndexType, size_t> indexToVertex;
// Initial extremes
aabb._lowerBound = Vec3f(999999.0f, 999999.0f, 999999.0f);
aabb._upperBound = Vec3f(-999999.0f, -999999.0f, -999999.0f);
std::unordered_map<std::string, size_t> matReferences;
while (!fromFile.eof()) {
// Read line header
std::string line;
getline(fromFile, line);
std::stringstream ss(line);
std::string header;
ss >> header;
if (header == "v") {
// Add vertex
float x, y, z;
ss >> x >> y >> z;
filePositions.push_back(Vec3f(x, y, z));
aabb.expand(Vec3f(x, y, z));
}
else if (header == "f") {
示例5:
void Triangle3D::getAABB(AABB3D& bb) const
{
bb.setPoint(a);
bb.expand(b);
bb.expand(c);
}
示例6:
void ConvexPolyhedron3D::getAABB(AABB3D& b) const
{
b.setPoint(vertices[0]);
for(int i=1; i<numVertices; i++)
b.expand(vertices[i]);
}
示例7:
void Segment3D::getAABB(AABB3D& bb) const
{
bb.setPoint(a);
bb.expand(b);
}