本文整理汇总了C++中plane类的典型用法代码示例。如果您正苦于以下问题:C++ plane类的具体用法?C++ plane怎么用?C++ plane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了plane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: triarea
inline LL triarea(plane::iterator x){
LL res=0;
if (x!=t.begin()) res+=traparea(pre(x),x);
if (next(x)!=t.end()) res+=traparea(x,next(x));
if (x!=t.begin() && next(x)!=t.end()) res+=traparea(next(x),pre(x));
return res;
}
示例2: reflected
Camera Camera::reflected(const plane& pl) const
{
Camera result(*this);
vec3 s = normalize(reflect(side(), pl.normal()));
vec3 u = normalize(reflect(up(), pl.normal()));
vec3 d = normalize(reflect(direction(), pl.normal()));
vec3 p = pl.reflect(position());
mat4 mv = _modelViewMatrix;
mv[0][0] = s.x;
mv[0][1] = u.x;
mv[0][2] = d.x;
mv[1][0] = s.y;
mv[1][1] = u.y;
mv[1][2] = d.y;
mv[2][0] = s.z;
mv[2][1] = u.z;
mv[2][2] = d.z;
mv[3] = vec4(-mv.rotationMultiply(p), mv[3][3]);
result.unlockUpVector();
result.setModelViewMatrix(mv);
return result;
}
示例3: contain
inline int contain(int x,int y){
plane :: iterator S=t.begin() , T=pre(t.end()) ;
if (x<S->first || x>T->first) return 0;
if (x==S->first) return y<=S->second;
if (x==T->first) return y<=T->second;
plane::iterator it=t.lower_bound(x) , p=pre(it);
int x1=p->first , y1=p->second , x2=it->first , y2=it->second;
return (LL)(y-y1)*(x2-x1) <= (LL)(y2-y1)*(x-x1);
}
示例4: plane_intersect
//Intersecao entre dois planos
pair<pt3, pt3> plane_intersect(plane u, plane v){
pt3 p1 = u.n * u.d();
pt3 uv = cross(u.n, v.n);
pt3 uvu = cross(uv, u.n);
if (!cmp(dot(v.n, uvu))) return mp(pt3(inf, inf), pt3(inf, inf)); //planos paralelos
pt3 p2 = p1 - uvu * (dot(v.n, p1) - v.d()) / dot(v.n, uvu);
return mp(p2, p2 + uv);
}
示例5: dot
bool et::intersect::rayPlane(const ray3d& r, const plane& p, vec3* intersection_pt)
{
float d = dot(r.direction, p.normal());
if (d < 0.0f)
{
if (intersection_pt)
*intersection_pt = r.origin + r.direction * dot(p.normal(), p.planePoint() - r.origin) / d;
return true;
}
return false;
}
示例6: setByplane
void setByplane(plane plane) {
glLoadIdentity();
plane->updateV();plane->doth2();
float td=plane->thetha*toDg,ad=plane->alpha*toDg;
glRotatef(-90,1,0,0);
glRotatef(-plane->tht*toDg, 0.0f, 1.0f, 0.0f);
glRotatef(-td,1,0,0);
glRotatef(-ad, 0.0f, 1.0f, 0.0f);
glTranslatef(-plane->cx,-plane->cy,-plane->cz);
}
示例7: isZero
bool isZero(plane x, plane y) {
if (!(x.vect(y) == 0 && x.scalar(y) < 0)) return false;
point yy;
if (y.a == 0) {
yy.x = 0.0;
yy.y = -y.c / (double)y.b;
} else {
yy.x = -y.c / (double)y.a;
yy.y = 0.0;
}
return (x.a * yy.x + x.b * yy.y + x.c) <= 0;
}
示例8: convolve_vert
plane convolve_vert( const plane &p, const std::vector<float> &k )
{
if ( k.size() == 3 )
{
if ( base::equal( k[0], k[2] ) )
return plane( "p.sep_conv3_mirror_v", p.dims(), p, k[0], k[1] );
return plane( "p.sep_conv3_v", p.dims(), p, k[0], k[1], k[2] );
}
precondition( k.size() % 2 != 0, "non-odd-sized kernel {0}", k.size() );
return plane( "p.sep_conv_v", p.dims(), p, k );
}
示例9: cross
int cross(const line &l, const plane &pl,
point &res) {
ld d = sp(pl.n, l.v);
if (sgn(d) == 0) {
return (pl.side(l.p) == 0) ? 2 : 0;
}
ld t = (-sp(pl.n, l.p) - pl.d) / d;
res = l.p + l.v * t;
#ifdef DEBUG
assert(pl.side(res) == 0);
#endif
return 1;
}
示例10: timer
void timer(int v){
//update planes position
planeView.update();
//set roll angles accoring to rate set by button press
rollAngle = rollRate;
pitchAngle = pitchRate;
//compute roll and pitch
planeView.Roll(rollAngle);
planeView.Pitch(pitchAngle);
glutPostRedisplay(); // trigger display function by sending redraw into message queue
glutTimerFunc(1000 / nFPS, timer, v);
}
示例11: OnD3D11DestroyDevice
//--------------------------------------------------------------------------------------
// Release D3D11 resources created in OnD3D11CreateDevice
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D11DestroyDevice( void* pUserContext )
{
g_DialogResourceManager.OnD3D11DestroyDevice();
g_D3DSettingsDlg.OnD3D11DestroyDevice();
//CDXUTDirectionWidget::StaticOnD3D11DestroyDevice();
DXUTGetGlobalResourceCache().OnDestroyDevice();
test.destroy();
tessplane.destroy();
lightsphere.destroy();
tesscube.destroy();
fuse.destroy();
deboard.destroy();
board1.destroy();
geo_alien.destroy();
FirePart.destroy();
SAFE_DELETE( g_pTxtHelper );
SAFE_RELEASE(g_DepthState);
//g_Mesh11.Destroy();
//
//SAFE_RELEASE( g_pVertexLayout11 );
//SAFE_RELEASE( g_pVertexBuffer );
//SAFE_RELEASE( g_pIndexBuffer );
//SAFE_RELEASE( g_pVertexShader );
//SAFE_RELEASE( g_pPixelShader );
//SAFE_RELEASE( g_pSamLinear );
/* SAFE_RELEASE( g_pcbVSPerObject );
SAFE_RELEASE( g_pcbPSPerObject );
SAFE_RELEASE( g_pcbPSPerFrame );*/
}
示例12:
bool triangle<T,color_type>::intersects(const plane<T,color_type>& p) const
{
T unused;
const point3<T>& pp = plane<T,color_type>::get_origin();
point3<T> pu = plane<T,color_type>::get_origin() + plane<T,color_type>::get_u_vector();
point3<T> pv = plane<T,color_type>::get_origin() + plane<T,color_type>::get_v_vector();
if (p.quick_intersection( unit_line3<T>(pp, pu), 0, unused ) ||
p.quick_intersection( unit_line3<T>(pp, pv), 0, unused ) ||
p.quick_intersection( unit_line3<T>(pu, pv), 0, unused ))
{
return true;
}
return false;
}
示例13: apeq
int apeq(const plane &pl1, const plane &pl2, vfloat prec)
{
pvecerror("int apeq(const plane &pl1, const plane &pl2, vfloat prec)");
if( check_par( pl1.dir, pl2.dir, prec) == 0 ) return 0;
if( apeq( pl1.piv , pl2.piv, prec) == 1) return 1;
if( pl1.check_point_in(pl2.piv, prec) == 1 ) return 1;
else return 0;
}
示例14: pvecerror
int operator==(const plane &pl1, const plane &pl2)
{
pvecerror("int operator==(const plane &pl1, const plane &pl2)");
if( !(pl1.dir == pl2.dir || pl1.dir == -pl2.dir) ) return 0;
if( pl1.piv == pl2.piv ) return 1;
if( pl1.check_point_in(pl2.piv,0) == 1 ) return 1;
else return 0;
}
示例15: object
plane::plane(const plane& _plane)
: object(_plane)
, l1(_plane.L1())
, l2(_plane.L2())
, xw(_plane.XW())
, uw(_plane.UW())
, u1(_plane.U1())
, u2(_plane.U2())
, pa(_plane.PA())
, pb(_plane.PB())
{
}