本文整理汇总了C++中Geometry::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::Add方法的具体用法?C++ Geometry::Add怎么用?C++ Geometry::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry::Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Material
Shock::Shock(class PlayerAI *player, Vector &direction){
mat = new Material("Textures/Shield/Shield",Texture::cARGB);
mat->SetMode(MATERIAL_DEST_ADD_SOURCE);
Geometry *g = new Geometry();
g->SetName(0,"Shock");
g->Apply(mat);
g->Add(Vector(-25000, 25000,0));
g->Add(Vector( 25000, 25000,0));
g->Add(Vector( 25000,-25000,0));
g->Add(Vector(-25000,-25000,0));
g->Add(Vertex(0,0,0));
g->Add(Vertex(1,1,0));
g->Add(Vertex(2,1,1));
g->Add(Vertex(3,0,1));
IndexedPolygon *pol;
pol = g->NewIndexedPolygon(); //new IndexedPolygon(g);
pol->Add(0);
pol->Add(1);
pol->Add(2);
pol->Add(3);
Intelligence::Apply(g);
g->Node::Apply(0,this);
player->GetCreatorGeometry()->Node::Apply(0,g);
SetPosition(Vector(0,0,0));
Quaternion dir = Quaternion(direction.X,-direction.Y,0,0);
SetOrientation(Quaternion(dir));
Spawn = -1.0f;
}
示例2: Material
Planet::Planet(Camera *cam, class Geometry *parent){
camera = cam;
mat = new Material("Textures/Backdrops/Planet5",Texture::cARGB);
mat->SetMode(MATERIAL_SOURCE_DIFFUSE|MATERIAL_DEST_MULTIPLY_ONE_MINUS_ALPHA);
Geometry *g = new Geometry();
g->SetName(0,"Planet");
g->Apply(mat);
g->Add(Vector(-6000, 6000,0));
g->Add(Vector( 6000, 6000,0));
g->Add(Vector( 6000,-6000,0));
g->Add(Vector(-6000,-6000,0));
g->Add(Vertex(0,0,0));
g->Add(Vertex(1,1,0));
g->Add(Vertex(2,1,1));
g->Add(Vertex(3,0,1));
IndexedPolygon *pol;
pol = /*g->NewIndexedPolygon();*/ new IndexedPolygon(g);
pol->Add(0);
pol->Add(1);
pol->Add(2);
pol->Add(3);
Intelligence::Apply(g);
g->Node::Apply(0,this);
parent->Node::Apply(0,g);
SetPosition(Vector(0,0,0));
g->SetSquareRadius(0);
}
示例3: Nebula
Meteorites::Meteorites() : Client(), Message(){
ViewBunch = new DynamicArray();
BitmapBunch = new DynamicArray();
SetName("MeteoritesGame");
printf("------------------------------------------------------------------------\n");
printf("Initializing TV-Meteorites, Copyright (C) RealityMakers Entertainment as\n");
printf("------------------------------------------------------------------------\n");
View1 = new View(Rect(0,0,1,1));
View1->SetClearState(false);
/*
Scores = new ScoreViews(View1);
*/
// 191,189
// 101
// 85
#ifdef TV2
tv2bm = new Bitmap("Textures/tv2/tv2",BITMAP_RGB);
tv2v = new View(Rect(
1-.075f*.8f-.01f,
.01f,
1-.01f,
.1f*.8f+.01f));
tv2bm->SetTranslusency(.5f);
tv2v->Apply(tv2bm);
tv2v->SetClearState(false);
View1->Apply(tv2v);
#endif
#ifdef SCHIBSTED
tv2bm = new Bitmap("Textures/tv2/slogo",BITMAP_RGB);
tv2v = new View(Rect(
1-.09f*.8f*1.5f-.01f,
.01f,
1-.01f,
.1f*.8f+.01f));
tv2bm->SetTranslusency(.5f);
tv2v->Apply(tv2bm);
tv2v->SetClearState(false);
View1->Apply(tv2v);
#endif
#ifdef JANCO
Bitmap *tv2bm = new Bitmap("Textures/tv2/janco",BITMAP_RGB);
View *tv2v = new View(Rect(
.9f,
0,
1,
.1f));
tv2bm->SetTranslusency(.5f);
tv2v->Apply(tv2bm);
tv2v->SetClearState(false);
View1->Apply(tv2v);
#endif
Info1 = new Bitmap("Textures/Interface/Instructions/Inntasting",BITMAP_RGB);
Info2 = new Bitmap("Textures/Interface/Instructions/Kontroll",BITMAP_RGB);
Info3 = new Bitmap("Textures/Interface/Instructions/Pickups",BITMAP_RGB);
//printf("%d,%d\n",Info1->GetWidth(),Info1->GetHeight());
//printf("%d,%d\n",Info2->GetWidth(),Info2->GetHeight());
//printf("%d,%d\n",Info3->GetWidth(),Info3->GetHeight());
View *InfoView = new View(Rect(.75f,.7f,.95f,.9f));
InfoView->SetClearState(false);
View *v1 = new View(Rect(0,0,1,1.3f));
View *v2 = new View(Rect(0,0,1,101.0f/189.0f*1.3f));
View *v3 = new View(Rect(0,0,1,85.0f/189.0f*1.3f));
InfoViews = new DynamicArray();
InfoViews->Add(InfoView);
InfoViews->Add(v1);
InfoViews->Add(v2);
InfoViews->Add(v3);
v1->Apply(Info1);
v2->Apply(Info2);
v3->Apply(Info3);
v1->SetClearState(false);
v2->SetClearState(false);
v3->SetClearState(false);
InfoView->Apply(v1);
InfoView->Apply(v2);
InfoView->Apply(v3);
View1->Apply(InfoView);
// Info3->SetTranslusency(.8f);
#if 1
scene = new Scene(View1);
#else
Scores = new ScoreViews(View1);
null = new Geometry();
null->SetPosition(Vector(0,0,10000));
Back = new Geometry();
Back->Node::Apply(new Background(Back));
Back->SetPosition(Vector(0,0,8000*3));
Back->Post();
null->Node::Apply(Back);
//.........这里部分代码省略.........
示例4: Material
Sun::Sun(Camera *cam, class Geometry *parent){
camera = cam;
mat1 = new Material("Textures/Lens/Halo",Texture::cRGB);
mat1->SetMode(MATERIAL_SOURCE_DIFFUSE|MATERIAL_DEST_ADD_SOURCE); //MATERIAL_DEST_MULTIPLY_ONE_MINUS_ALPHA);
mat2 = new Material("Textures/Lens/Sun",Texture::cRGB);
mat2->SetMode(MATERIAL_SOURCE_DIFFUSE|MATERIAL_DEST_ADD_SOURCE); //MULTIPLY_ONE_MINUS_ALPHA);
//mat1->SetTransparency(.6f);
//mat2->SetTransparency(.8f);
mat1->SetTransparency(.95f);
mat2->SetTransparency(.8f);
Geometry *g = new Geometry();
g->SetName(0,"Sun");
g->Apply(mat1);
/*
g->Add(Vector(-6000/2/3, 6000/2/3,0));
g->Add(Vector( 6000/2/3, 6000/2/3,0));
g->Add(Vector( 6000/2/3,-6000/2/3,0));
g->Add(Vector(-6000/2/3,-6000/2/3,0));
g->Add(Vector(-6000*5/2, 6000*5/2,-10000));
g->Add(Vector( 6000*5/2, 6000*5/2,-10000));
g->Add(Vector( 6000*5/2,-6000*5/2,-10000));
g->Add(Vector(-6000*5/2,-6000*5/2,-10000));
*/
g->Add(Vector(-6000*5/2, 6000*5/2,0));
g->Add(Vector( 6000*5/2, 6000*5/2,0));
g->Add(Vector( 6000*5/2,-6000*5/2,0));
g->Add(Vector(-6000*5/2,-6000*5/2,0));
g->Add(Vector(-6000*5/2, 6000*5/2,-10000));
g->Add(Vector( 6000*5/2, 6000*5/2,-10000));
g->Add(Vector( 6000*5/2,-6000*5/2,-10000));
g->Add(Vector(-6000*5/2,-6000*5/2,-10000));
g->Add(Vertex(0,0,0));
g->Add(Vertex(1,1,0));
g->Add(Vertex(2,1,1));
g->Add(Vertex(3,0,1));
g->Add(Vertex(4,0,0));
g->Add(Vertex(5,1,0));
g->Add(Vertex(6,1,1));
g->Add(Vertex(7,0,1));
IndexedPolygon *pol;
pol = new IndexedPolygon(g); //new IndexedPolygon(g);
pol->Add(0);
pol->Add(1);
pol->Add(2);
pol->Add(3);
//pol->Apply(mat1);
/* pol = new IndexedPolygon(g); //new IndexedPolygon(g);
pol->Apply(mat2);
pol->Add(4);
pol->Add(5);
pol->Add(6);
pol->Add(7);*/
Intelligence::Apply(g);
g->Node::Apply(0,this);
parent->Node::Apply(0,g);
SetPosition(Vector(0,0,50000));
g->SetSquareRadius(0);
}