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


C++ Geometry::NewIndexedPolygon方法代码示例

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


在下文中一共展示了Geometry::NewIndexedPolygon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:patrickhno,项目名称:meteorites,代码行数:29,代码来源:Shock.cpp

示例2: Nebula


//.........这里部分代码省略.........
	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);

	new Nebula(null);
	new	Sun(null);
//	new Planet(null);

	cam = new Camera();
	cam->SetName(String("Camera"));
	null->Node::Apply(cam);
	camAI = new CameraAI(cam);
	cam->Apply(camAI);
	View1->Attatch(cam);
/*
//	PlayerGeometries = new DynamicArray();
	for(int n=0; n<16; n++){
		Geometry *Ship = new Geometry();
		char name[1024];
		sprintf(name,"Player%d",n);
		Ship->SetName(String(name));	// fixme: Optimize!
		//Ship->SetPosition(Vector(0,0,-800000));
		Ship->Post();
//		PlayerGeometries->Add(Ship);
		//AI_Player1 = new PlayerAI(Ship);
		null->Node::Apply(Ship);
		Ship->Node::Apply(new PlayerAI(Ship,Scores,Scores->GetPlayer(n),0));
	}
*/
//#if 0
	for(int n=0; n<10; n++){
		Geometry *Rock = new Geometry();
		Rock->SetName("Rock");
		Rock->Add(Vector(-400,-400,0));
		Rock->Add(Vector( 400,-400,0));
		Rock->Add(Vector( 400, 400,0));
		Rock->Add(Vector(-400, 400,0));
		Rock->Add(Vertex(0,0,0));
		Rock->Add(Vertex(1,1,0));
		Rock->Add(Vertex(2,1,1));
		Rock->Add(Vertex(3,0,1));
		IndexedPolygon *pol = Rock->NewIndexedPolygon();
		pol->Add(0);
		pol->Add(1);
		pol->Add(2);
		pol->Add(3);
		RockAI *AI_Rock = new RockAI(/*this,*/Rock,400.0f);
		Rock->Node::Apply(AI_Rock);
		null->Node::Apply(Rock);
	}
//#endif
	//
#if 0
	printf("Initializing levels.\n");
	//#ifndef _DEBUG
	InitLevels(2);
	NextLevel(10);
	//#endif
	printf("Done.\n");
#endif
#endif
	printf("------------------------------------------------------------------------\n");
	printf("                       TV-Meteorites initalized\n");
	printf("------------------------------------------------------------------------\n");

	Initialized = true;
}
开发者ID:patrickhno,项目名称:meteorites,代码行数:101,代码来源:MeteoritesSingle.cpp


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