当前位置: 首页>>代码示例>>C++>>正文


C++ AABB3D::expand方法代码示例

本文整理汇总了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();
  }
开发者ID:duke-iml,项目名称:ece490-s2016,代码行数:26,代码来源:pc_view.cpp

示例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]);
}
开发者ID:HargisJ,项目名称:KrisLibrary,代码行数:10,代码来源:Polygon3D.cpp

示例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;
}
开发者ID:222464,项目名称:PGE,代码行数:13,代码来源:FormTriangle.cpp

示例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") {
开发者ID:fivethreeo,项目名称:deferred3d-parallel-game-engine,代码行数:44,代码来源:StaticPositionModel.cpp

示例5:

void Triangle3D::getAABB(AABB3D& bb) const
{
	bb.setPoint(a);
	bb.expand(b);
	bb.expand(c);
}
开发者ID:YajiaZhang,项目名称:LoopTK_SLIKMC,代码行数:6,代码来源:Triangle3D.cpp

示例6:

void ConvexPolyhedron3D::getAABB(AABB3D& b) const
{
  b.setPoint(vertices[0]);
  for(int i=1; i<numVertices; i++)
    b.expand(vertices[i]);
}
开发者ID:YajiaZhang,项目名称:LoopTK_SLIKMC,代码行数:6,代码来源:Polyhedron3D.cpp

示例7:

void Segment3D::getAABB(AABB3D& bb) const
{
    bb.setPoint(a);
    bb.expand(b);
}
开发者ID:jtritell,项目名称:KrisLibrary,代码行数:5,代码来源:Segment3D.cpp


注:本文中的AABB3D::expand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。