本文整理汇总了C++中plane类的典型用法代码示例。如果您正苦于以下问题:C++ plane类的具体用法?C++ plane怎么用?C++ plane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了plane类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:TRYang,项目名称:acm,代码行数:7,代码来源:dynamic_maintain_convec_hull.cpp
示例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;
}
开发者ID:Loki7979,项目名称:et-engine,代码行数:26,代码来源:camera.cpp
示例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);
}
开发者ID:TRYang,项目名称:acm,代码行数:9,代码来源:dynamic_maintain_convec_hull.cpp
示例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);
}
开发者ID:viniciusmalloc,项目名称:lib-monkeys,代码行数:10,代码来源:pops.cpp
示例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;
}
开发者ID:UIKit0,项目名称:et-engine,代码行数:11,代码来源:collision.cpp
示例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);
}
开发者ID:zentojamorn,项目名称:lego-builder,代码行数:11,代码来源:vector2.cpp
示例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;
}
开发者ID:DariaYakovleva,项目名称:PROJECTS,代码行数:12,代码来源:main2.cpp
示例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 );
}
开发者ID:kdt3rd,项目名称:gecko,代码行数:13,代码来源:plane_convolve.cpp
示例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;
}
开发者ID:kunyavskiy,项目名称:SPbSU4-Team-Notebook,代码行数:13,代码来源:geom-3d.cpp
示例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);
}
开发者ID:seb120,项目名称:FlightSimulator,代码行数:15,代码来源:Flight+Simulator.cpp
示例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 );*/
}
开发者ID:AlexKLM,项目名称:DX11-Shader-Language-Coursework,代码行数:33,代码来源:BasicHLSL11.cpp
示例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;
}
开发者ID:bartholomule,项目名称:amethyst,代码行数:16,代码来源:triangle.hpp
示例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;
}
开发者ID:MadisonAndrews,项目名称:Garfieldpp,代码行数:8,代码来源:plane.c
示例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;
}
开发者ID:MadisonAndrews,项目名称:Garfieldpp,代码行数:9,代码来源:plane.c
示例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())
{
}
开发者ID:yangminseok,项目名称:mphysics,代码行数:13,代码来源:plane.cpp
示例16: isPP
bool isPP(plane x, plane y) {
// cout << x.a << " " << x.b << " " << x.c << " " << y.a <<" "<< y.b <<" " << y.c << endl;
if (x.vect(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;
}
开发者ID:DariaYakovleva,项目名称:PROJECTS,代码行数:13,代码来源:main2.cpp
示例17: pcs
// Cutting point of three planes
Foam::point Foam::plane::planePlaneIntersect
(
const plane& plane2,
const plane& plane3
) const
{
List<scalarList> pcs(3);
pcs[0]= planeCoeffs();
pcs[1]= plane2.planeCoeffs();
pcs[2]= plane3.planeCoeffs();
tensor a
(
pcs[0][0],pcs[0][1],pcs[0][2],
pcs[1][0],pcs[1][1],pcs[1][2],
pcs[2][0],pcs[2][1],pcs[2][2]
);
vector b(pcs[0][3],pcs[1][3],pcs[2][3]);
return (inv(a) & (-b));
}
开发者ID:frankl000,项目名称:OpenFOAM-1.7.x,代码行数:23,代码来源:plane.C
示例18: xformOrtho4
void
plane::
xformOrtho4 ( const plane& planeIn, const matrix4& mat )
{
vec3 ptOn ( vec3::NoInit );
planeIn.closestPtIn ( ptOn, 0.0, 0.0, 0.0 );
normal.xformVec4 ( planeIn.normal, mat );
normal.normalize ();
ptOn.xformPt4 ( ptOn, mat );
// just like in setNormPt, but without redundant set of normal
// setNormPt ( normal, ptOn )
offset = normal.dot ( ptOn );
}
开发者ID:prwhite,项目名称:philibs,代码行数:15,代码来源:pniplane.cpp
示例19: insert
void insert(int x,int y){
if (t.find(x)!=t.end()){
if (y<=t[x]) return;
area-=triarea(t.lower_bound(x));
t.erase(x);
}
plane::iterator it=t.insert(make_pair(x,y)).first;
if (check(it)){
t.erase(it);
return;
}
area+=triarea(it);
while (check(pre(it))){
area-=triarea(pre(it));
t.erase(pre(it));
}
while (check(next(it))){
area-=triarea(next(it));
t.erase(next(it));
}
}
开发者ID:TRYang,项目名称:acm,代码行数:21,代码来源:dynamic_maintain_convec_hull.cpp
示例20: render
void render()
{
fr.SetCameraPos(Camera.getPos());
glm::mat4 view = Camera.getView();
glm::mat4 projection = Camera.getProjection();
glClearColor( 0.f, 0.f, 0.0f, 0.f );
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
fr.render(view, projection);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
pr.render(view,projection);
pr2.render(view,projection);
pr3.render(view,projection);
glDisable(GL_BLEND);
GBuffer::BindForWriting();
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor( 0.f, 0.f, 0.0f, 0.f );
Plane.render(view,projection);
glDisable(GL_DEPTH_TEST);
GBuffer::DefaultBuffer();
return;
}
开发者ID:ChaseCarthen,项目名称:OpenGL-and-GDAL-Tutorials,代码行数:35,代码来源:main.cpp
注:本文中的plane类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论