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


C++ StaticObject::setTree方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
	GekoMesh gekoMesh;
	geko.setExp(0.0);
	geko.setLevelThreshold(100.0);
	geko.setLevel(0);

	Node playerNode("Player");

	playerNode.addGeometry(&gekoMesh);
	playerNode.setObject(&geko);
	playerNode.addTexture(&texCV);

	sfh.generateSource(posFood, RESOURCES_PATH "/Sound/Rascheln.wav");
	geko.setSoundHandler(&sfh);
	geko.setSourceName(MOVESOUND, "SpielerFootsteps", RESOURCES_PATH "/Sound/Rascheln.wav");
	//geko.setSourceName(BACKGROUNDMUSIC, "Hintergrund", RESOURCES_PATH "/Sound/jingle2.wav");
	geko.setSourceName(FIGHTSOUND, "Kampfsound", RESOURCES_PATH "/Sound/punch.wav");
	geko.setSourceName(EATSOUND, "Essen", RESOURCES_PATH "/Sound/Munching.wav");
	geko.setSourceName(QUESTSOUND, "Quest", RESOURCES_PATH "/Sound/jingle.wav");
	geko.setSourceName(ITEMSOUND, "Item", RESOURCES_PATH "/Sound/itempickup.wav");
	geko.setSourceName(FIRESOUND, "Fire", RESOURCES_PATH "/Sound/Feuer_kurz.wav");

	sfh.disableLooping("Essen");
	sfh.disableLooping("Quest");
	sfh.disableLooping("Item");
	//sfh.generateSource("Feuer",posFood, RESOURCES_PATH "/Sound/Feuer kurz.wav");

	playerNode.setCamera(&cam);

	//===================================================================//
	//==================Object declarations - Geometry, Texture, Node=== //
	//==========================Object: Tree===========================//

	StaticObject treeStatic;
	treeStatic.setTree();

	TreeMesh tree;
	Node treeNode("Tree");
	treeNode.addGeometry(&tree);
	treeNode.setObject(&treeStatic);
	treeNode.addTranslation(posFood);
	treeNode.getBoundingSphere()->radius = 3.0;

	//===================================================================//
	//==================Object declarations - Geometry, Texture, Node=== //
	//==========================Object: Plane===========================//

	StaticObject terrainObject;
	terrainObject.setClassType(ClassType::TERRAIN);

	Plane terrain;
	Texture terrainTex((char*)RESOURCES_PATH "/Grass.jpg");

	Node terrainNode("Plane");
	terrainNode.addGeometry(&terrain);
	terrainNode.addTexture(&terrainTex);
	terrainNode.setObject(&terrainObject);
	terrainNode.addTranslation(0.0, -0.75, 0.0);
	terrainNode.addRotation(90.0f, glm::vec3(1.0, 0.0, 0.0));
	terrainNode.addScale(20.0, 20.0, 20.0);

	//===================================================================//
	//==================Setting up the Level and Scene==================//
	//==================================================================//

	Level testLevel("testLevel");
	Scene testScene("testScene");
开发者ID:GameEngineKoblenz,项目名称:GeKo,代码行数:67,代码来源:main.cpp

示例2: main


//.........这里部分代码省略.........
	sfh.disableLooping("Kampfsound");
	sfh.disableLooping("Quest");
	sfh.disableLooping("Item");
	sfh.generateSource("Feuer",posFood, RESOURCES_PATH "/Sound/Feuer kurz.wav");



	playerNode.setCamera(&cam);

	// ==============================================================
	// == Items =====================================================
	// ==============================================================
	/*Item cookie(1);
	cookie.setName("Cookie");
	cookie.setTypeId(ItemType::COOKIE);
	Item cookie2(2);
	cookie.setName("Cookie");
	cookie.setTypeId(ItemType::COOKIE);
	Item branch(3);
	branch.setName("Branch");
	branch.setTypeId(ItemType::BRANCH);
*/


	//===================================================================//
	//==================Object declarations - Geometry, Texture, Node=== //
	//==========================Object: Tree===========================//

	TreeMesh tree;

	glm::vec3 trees[5] = { glm::vec3(16.0, 0.0, 76.0), glm::vec3(23.0, 0.0, 74.0), glm::vec3(21.5, 0.0, 78.5), glm::vec3(15.0, 0.0, 81.5), glm::vec3(27.5, 0.0, 88.5), };

	StaticObject treeStatic;
	treeStatic.setTree();
//	treeStatic.setObjectType(ObjectType::TREE);
	Node treeNode("Tree");
	treeNode.addGeometry(&tree);
	treeNode.setObject(&treeStatic);

	//treeNode.addScale(10.0, 10.0, 10.0);
	treeNode.addTranslation(trees[0]);

	treeNode.getBoundingSphere()->radius = 3.0;

	StaticObject treeStatic2;
	treeStatic2.setTree();
	Node treeNode2("Tree2");
	treeNode2.addGeometry(&tree);
	treeNode2.setObject(&treeStatic2);
	treeNode2.addTranslation(trees[1]);
	treeNode2.getBoundingSphere()->radius = 3.0;

	StaticObject treeStatic3;
	treeStatic3.setTree();
	Node treeNode3("Tree3");
	treeNode3.addGeometry(&tree);
	treeNode3.setObject(&treeStatic3);
	treeNode3.addTranslation(trees[2]);
	treeNode3.getBoundingSphere()->radius = 3.0;

	StaticObject treeStatic4;
	treeStatic4.setTree();
	Node treeNode4("Tree4");
	treeNode4.addGeometry(&tree);
	treeNode4.setObject(&treeStatic4);
	treeNode4.addTranslation(trees[3]);
开发者ID:MaikKlein,项目名称:GeKo,代码行数:67,代码来源:main.cpp


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