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


C++ Plane::a方法代码示例

本文整理汇总了C++中Plane::a方法的典型用法代码示例。如果您正苦于以下问题:C++ Plane::a方法的具体用法?C++ Plane::a怎么用?C++ Plane::a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plane的用法示例。


在下文中一共展示了Plane::a方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: reverseEqual

 // is this plane reverse equal to the other plane
 // true if dot product of outward normals is <= (-1+tol) and abs(d1+d2) <= tol
 bool Plane::reverseEqual(const Plane& other, double tol) const
 {
   double dot = (m_a*other.a() + m_b*other.b() + m_c*other.c());
   double dist = m_d + other.d();
   bool result = (dot <= -1+tol) && (fabs(dist) <= tol);
   return result;
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:9,代码来源:Plane.cpp

示例2: equal

 // is this plane equal to the other plane
 // true if dot product of outward normals is >= (1-tol) and abs(d1-d2) <= tol
 bool Plane::equal(const Plane& other, double tol) const
 {
   double dot = (m_a*other.a() + m_b*other.b() + m_c*other.c());
   double dist = m_d - other.d();
   bool result = (dot >= 1-tol) && (fabs(dist) <= tol);
   return result;
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:9,代码来源:Plane.cpp

示例3: parallel

 bool Plane::parallel(const Plane& other, double tol) const
 {
   // dot product of outward normals should be 1 or negative 1
   double dot = (m_a*other.a() + m_b*other.b() + m_c*other.c());
   bool result = (fabs(dot) >= 1.0-tol);
   return result;
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:7,代码来源:Plane.cpp

示例4:

 Plane::Plane(const Plane& other)
   : m_a(other.a()), m_b(other.b()), m_c(other.c()), m_d(other.d())
 {
   // test that normal has length 1
   double length = m_a*m_a + m_b*m_b + m_c*m_c;
   double tol = 0.0001;
   OS_ASSERT(fabs(1.0-length) < tol);
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:8,代码来源:Plane.cpp

示例5: extract

void Frustum::extract(const Matrix4f &projmatrix,const Matrix4f &viewmatrix)
{
	planes->clear();

	Plane plane;
	Matrix4f matr;

	matr=viewmatrix*projmatrix;
	
//	matr.dumpMatrix();
//	Kernel::logger() << "\n";
	
	// Left
	plane.a(matr[3]+matr[0]);
	plane.b(matr[7]+matr[4]);
	plane.c(matr[11]+matr[8]);
	plane.d(matr[15]+matr[12]);
	plane.d(plane.d()/plane.normal().length());
	plane.normal().normalize();
	planes->push_back(plane);
	
	// Right
	plane.a(matr[3]-matr[0]);
	plane.b(matr[7]-matr[4]);
	plane.c(matr[11]-matr[8]);
	plane.d(matr[15]-matr[12]);
	plane.d(plane.d()/plane.normal().length());
	plane.normal().normalize();
	planes->push_back(plane);

	// Bottom
	plane.a(matr[3]+matr[1]);
	plane.b(matr[7]+matr[5]);
	plane.c(matr[11]+matr[9]);
	plane.d(matr[15]+matr[13]);
	plane.d(plane.d()/plane.normal().length());
	plane.normal().normalize();
	planes->push_back(plane);

	// Top
	plane.a(matr[3]-matr[1]);
	plane.b(matr[7]-matr[5]);
	plane.c(matr[11]-matr[9]);
	plane.d(matr[15]-matr[13]);
	plane.d(plane.d()/plane.normal().length());
	plane.normal().normalize();
	planes->push_back(plane);

	// Near
	plane.a(matr[3]+matr[2]);
	plane.b(matr[7]+matr[6]);
	plane.c(matr[11]+matr[10]);
	plane.d(matr[15]+matr[14]);
	plane.d(plane.d()/plane.normal().length());
	plane.normal().normalize();
	planes->push_back(plane);
		
	// Far
	plane.a(matr[3]-matr[2]);
	plane.b(matr[7]-matr[6]);
	plane.c(matr[11]-matr[10]);
	plane.d(matr[15]-matr[14]);
	plane.d(plane.d()/plane.normal().length());
	plane.normal().normalize();

/*	projmatrix->dumpMatrix();
	printf("]\n%.02f %.02f %.02f %.02f\n",
		plane.a(),
		plane.b(),
		plane.c(),
		plane.d());*/

//	planes->push_back(plane);	
/*     p=&frustumPlane[RIGHT];
     p->n.x=m[3]-m[0];
     p->n.y=m[7]-m[4];
     p->n.z=m[11]-m[8];
     p->d=m[15]-m[12];
   
     p=&frustumPlane[LEFT];
     p->n.x=m[3]+m[0];
     p->n.y=m[7]+m[4];
     p->n.z=m[11]+m[8];
     p->d=m[15]+m[12];
   
     p=&frustumPlane[BOTTOM];
     p->n.x=m[3]+m[1];
     p->n.y=m[7]+m[5];
     p->n.z=m[11]+m[9];
     p->d=m[15]+m[13];
   
     p=&frustumPlane[TOP];
     p->n.x=m[3]-m[1];
     p->n.y=m[7]-m[5];
     p->n.z=m[11]-m[9];
     p->d=m[15]-m[13];
   
     p=&frustumPlane[PFAR];
     p->n.x=m[3]-m[2];
     p->n.y=m[7]-m[6];
//.........这里部分代码省略.........
开发者ID:pkamenarsky,项目名称:hastegame,代码行数:101,代码来源:frustum.cpp

示例6: Oriented_squared_distance2

//**********************************************************************************
//distace of point from a plane (squared) with sign
double Oriented_squared_distance2(Plane P, CGALpoint x){
	double h = P.a()*x.x()+P.b()*x.y()+P.c()*x.z()+P.d();
	return ((h>0.)-(h<0.))*pow(h,2)/(CGALvector(P.a(),P.b(),P.c())).squared_length();
}
开发者ID:Mikelian,项目名称:trunk,代码行数:6,代码来源:_polyhedra_utils.cpp


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