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


C++ IAnimatedMeshSceneNode::addShadowVolumeSceneNode方法代码示例

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


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

示例1: loadSceneObject

SceneObject* PhysicsSim::loadSceneObject(stringw mesh_file, stringw texture_file)
{
	IAnimatedMesh *mesh = smgr->getMesh(mediaDirectory + mesh_file);

	IAnimatedMeshSceneNode* Node = smgr->addAnimatedMeshSceneNode(mesh, smgr->getRootSceneNode());
	stringw tex_file = texture_file;
	if(tex_file == L"")
	{
		tex_file = mesh_file;
		if(tex_file.find(".dae") > -1)
			tex_file.remove(".dae");
		if(tex_file.find(".3ds") > -1)
			tex_file.remove(".3ds");
		tex_file.append(".jpg");
	}
	tex_file = mediaDirectory + tex_file;
	if(smgr->getFileSystem()->existFile(tex_file))
		Node->setMaterialTexture(0, driver->getTexture(tex_file));
	Node->setMaterialFlag(EMF_LIGHTING, true);
	Node->setMaterialFlag(EMF_TEXTURE_WRAP, false);
	Node->setMaterialFlag(EMF_BACK_FACE_CULLING, true);
	Node->addShadowVolumeSceneNode(0,-1,false);
	Node->getMaterial(0).AmbientColor.set(255,255,255,255);

	updateObjects();
	return Node;
}
开发者ID:mikeiasNS,项目名称:SnowHero-irrlich-Game-,代码行数:27,代码来源:PhysicsSim.cpp

示例2: mLoadMesh

IAnimatedMeshSceneNode* MyIrrlichtComposition::mLoadMesh(vector3df pos,vector3df rot,vector3df scale, std::string name1, std::string name2)
{
	IAnimatedMeshSceneNode* obj = smgr->addAnimatedMeshSceneNode(smgr->getMesh(name1.c_str()));
	if(obj)
	{
		obj->setPosition(pos);
		obj->setMD2Animation(scene::EMAT_RUN);
		obj->setRotation(rot); 
		obj->setScale(scale);
		obj->setMaterialTexture(0, driver->getTexture(name2.c_str()));
		obj->addShadowVolumeSceneNode();
		return obj;
	}
	else 
		exit(2);
}
开发者ID:tetricas,项目名称:First_Irrlicht_Turn,代码行数:16,代码来源:MyIrrlichtDevice.cpp

示例3: addModel

void Unit::addModel() {
	IAnimatedMeshSceneNode* modelNode = Game::getInstance().sceneManager->addAnimatedMeshSceneNode( model, node );
	if (modelNode)
    {
		modelNode->setMaterialTexture( 0, texture );
		modelNode->getMaterial(0).Shininess = 0;
		modelNode->setScale(vector3df(0.15f, 0.15f, 0.15f) );
		modelNode->addShadowVolumeSceneNode(0, 0, false);
		modelNode->setID(0);

		currentAnimation = IDLE_ANIMATION;
		
		float randX = rand() % 8 - 4;
		float randZ =rand() % 8 - 4;
		modelNode->setPosition(vector3df(randX, 0.0f, randZ));
    }

	modelNodes.push_back(modelNode);
}
开发者ID:MegaR,项目名称:ARiseofWar,代码行数:19,代码来源:Unit.cpp

示例4: loadPhysicalObjects

bool PhysicsSim::loadPhysicalObjects(PhysicalStructure &structure, stringc mesh_filename, Vector3D position, bool lock2d)
{

	stringc physics_filename = mesh_filename;
	physics_filename.remove(".dae");
	physics_filename.append(".bullet");
	physics_filename = mediaDirectory + physics_filename;

	if(smgr->getFileSystem()->existFile(physics_filename))
	{
		stringw collada_filename = smgr->getFileSystem()->getAbsolutePath(mediaDirectory) + mesh_filename;

		if(smgr->getFileSystem()->existFile(collada_filename))
		{
			btBlenderImporter* fileLoader = new btBlenderImporter(position);
			fileLoader->loadFile(physics_filename.c_str());

			smgr->getMesh(collada_filename);

			for(int i = 0; i < fileLoader->getNumRigidBodies(); i++)
			{
				btRigidBody* rb = (btRigidBody*)fileLoader->getRigidBodyByIndex(i);

				if(lock2d)
				{
					rb->setLinearFactor(btVector3(1,0,1));
					rb->setAngularFactor(btVector3(0,1,0));
				}

				stringc meshname(fileLoader->getNameForPointer(rb));

				stringc bodyname = meshname;
				stringc tex_file = meshname;

				s32 underline = tex_file.findFirst('_');
				if(underline < 0)
					underline = tex_file.findFirst('.');
				if(underline > -1)
					tex_file = tex_file.subString(0, underline+1);

				tex_file = mediaDirectory + tex_file + ".jpg";

				if(fileLoader->getNumRigidBodies() > 1)
					meshname = collada_filename + "#" + meshname + "-mesh";
				else
					meshname = collada_filename;
				IAnimatedMesh *mesh = smgr->getMeshCache()->getMeshByName(meshname);

				if(mesh){
					IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh, smgr->getRootSceneNode());
					node->setMaterialFlag(EMF_LIGHTING, true);
					node->setMaterialFlag(EMF_TEXTURE_WRAP, false);
					node->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
					node->addShadowVolumeSceneNode(0,-1,false);

					if(smgr->getFileSystem()->existFile(tex_file))
					{
						node->setMaterialTexture(0, driver->getTexture(tex_file));
					}

					PhysicalObject* pobj = new PhysicalObject(node, rb, bodyname);
					objects_list.push_back(pobj);
					structure.bodies.push_back(pobj);
					dynamicsWorld->addRigidBody(pobj->getRigidBody());

				}

			}


			for(int i = 0; i < fileLoader->getNumConstraints(); i++)
			{
				Joint* jt = new Joint(fileLoader->getConstraintByIndex(i));
				joints_list.push_back(jt);
				structure.joints.push_back(jt);
				btTypedConstraint* constr = jt->getConstraint();
				dynamicsWorld->addConstraint(constr, true);
			}

			delete fileLoader;

			updateObjects();
			return true;
		}
	}

	return false;

}
开发者ID:mikeiasNS,项目名称:SnowHero-irrlich-Game-,代码行数:89,代码来源:PhysicsSim.cpp


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