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


C++ ISceneManager::createRotationAnimator方法代码示例

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


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

示例1: example_customscenenode

int example_customscenenode()
{
    // create device
    IrrlichtDevice *device = startup();
    if (device == 0) return 1; // could not create selected driver.

    // create engine and camera
    EventReceiver_basic receiver(device);
    device->setEventReceiver(&receiver);

    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();
    IGUIEnvironment* guienv = device->getGUIEnvironment();

    smgr->addCameraSceneNode(0, vector3df(0, -40, 0), vector3df(0, 0, 0));

    CSampleSceneNode *myNode = new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666);

    ISceneNodeAnimator* anim = smgr->createRotationAnimator(vector3df(0.8f, 0, 0.8f));

    if (anim) {
        myNode->addAnimator(anim);
        anim->drop();
        anim = 0; // As I shouldn't refer to it again, ensure that I can't
    }

    myNode->drop();
    myNode = 0; // As I shouldn't refer to it again, ensure that I can't

    return run(device);
}
开发者ID:osom8979,项目名称:example,代码行数:31,代码来源:t17.cpp

示例2: main

 int main()
 {
    IrrlichtDevice* irrDevice   = createDevice(EDT_OPENGL,dimension2d<s32>(800,600),32,false,false,false,0);
    IVideoDriver*   irrVideo    = irrDevice->getVideoDriver();
    ISceneManager*  irrSceneMgr = irrDevice->getSceneManager();
    TMovie* movie = new TMovie(irrDevice->getTimer());
    movie->LoadMovie("Mymovie.avi");
    irrVideo->setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false);
    u32 w = movie->getMovieWidth();
    u32 h = movie->getMovieHeight();
    ITexture* movTxtr = irrVideo->addTexture(dimension2d<s32>(w<513?512:1024,h<513?512:1024),"imovie"); 
    irrSceneMgr->addCameraSceneNode(0, vector3df(0,0,-20), vector3df(0,0,0));
    CSampleSceneNode* myNode = new CSampleSceneNode(irrSceneMgr->getRootSceneNode(), irrSceneMgr, 666);
    myNode->setMaterialTexture( 0, movTxtr);
    myNode->drop();
    ISceneNodeAnimator* anim = irrSceneMgr->createRotationAnimator(vector3df(0,0.1f,0));
    myNode->addAnimator(anim);
    anim->drop();
 
    while(irrDevice->run())
     {
        irrVideo->beginScene(true, true, SColor(0,200,200,200));
                  if (movie->NextMovieFrame())
                    movie->DrawMovie(0,0,movTxtr);
                  irrSceneMgr->drawAll();
        irrVideo->endScene();
     }       
    irrDevice->drop();

    return 0;
}
开发者ID:tecan,项目名称:IrrlichtDemos,代码行数:31,代码来源:hybridVideoTexture.cpp

示例3: BaseGameEntity

GameFieldNeo::GameFieldNeo()
	: BaseGameEntity(BaseGameEntity::GetNextValidID(), vector3df(0.f, 0.f, 0.f), 0.f, vector3df(1.f, 1.f, 1.f))	  
{
	// get ready scene node
	ISceneManager* pSmgr = IrrDvc.GetSmgr();
	m_pMesh = pSmgr->getMesh("Rsrc/Cube.dae");
	if (m_pMesh)
	{
		m_pSceneNode = pSmgr->addAnimatedMeshSceneNode(m_pMesh);
		m_pSceneNode->setScale(vector3df(10.f, 10.f, 10.f));
		m_pSceneNode->setMaterialFlag(video::EMF_LIGHTING, false);		
	}	

	scene::ISceneNodeAnimator* pAnim = pSmgr->createRotationAnimator(core::vector3df(1,1,1));
	if (pAnim)
	{
		m_pSceneNode->addAnimator(pAnim);
		pAnim->drop();
	}
}
开发者ID:ptptomr,项目名称:project_ran,代码行数:20,代码来源:GameFieldNeo.cpp

示例4: main

int main(int argc, char **argv) {

	// Help?
	if (argv[1] && argv[1][0] == '-') die(helpmsg);

	putenv((char *) "vblank_mode=0"); // No vsync for us, thanks.

	MyEventReceiver *r = new MyEventReceiver();
	IrrlichtDevice *dev = createDevice(EDT_OPENGL, core::dimension2d<u32>(1024,768), 32,
				false, false, false, r);
	if (!dev) die("Can't initialize Irrlicht");

	IVideoDriver *drv = dev->getVideoDriver();
	ISceneManager *smgr = dev->getSceneManager();
	IGPUProgrammingServices *gpu = drv->getGPUProgrammingServices();
	ICameraSceneNode *cam = NULL;
	ITexture *pic = NULL;
	IMeshSceneNode *ball = NULL;
	bool showpic = false;

	IReadFile *areamap = createMemoryReadFile(AreaMap33, sizeof(AreaMap33), "AreaMap33", false);
	if (!areamap) die("Failed to load areamap");
	ITexture *areamaptex = drv->getTexture(areamap);
	areamap->drop();

	// If there's an argument, assume it is a pic to load; otherwise, draw a sphere

	if (argv[1] && access(argv[1], R_OK) == 0) {
		showpic = true;
		pic = drv->getTexture(argv[1]);
		if (!pic) die("Can't load image");

		cam = smgr->addCameraSceneNode();
	} else {
		cam = smgr->addCameraSceneNodeMaya();
		cam->setTarget(vector3df(0, 0, 0));
		ball = smgr->addSphereSceneNode(40, 8);

		int ballshader = gpu->addHighLevelShaderMaterial(rnd,0,EVST_VS_1_1,0);
		ball->setMaterialType((E_MATERIAL_TYPE) ballshader);

		ISceneNodeAnimator *cool = smgr->createRotationAnimator(vector3df(-0.1, 0.1, -0.1));
		ball->addAnimator(cool);
		cool->drop();
	}

	// Set up static defines, RTTs, quads
	dimension2d<u32> screensize = drv->getScreenSize();
	char defines[128];
	snprintf(defines, 128,
		"#define PIXEL_SIZE vec2(1.0f / %u.0, 1.0f / %u.0)\n"
		"#define MAX_SEARCH_STEPS 8.0\n#define MAX_DISTANCE 33.0\n",
		screensize.Width, screensize.Height);

	ITexture *rt1 = drv->addRenderTargetTexture(screensize, "rt1", ECF_A8R8G8B8);
	ITexture *rt2 = drv->addRenderTargetTexture(screensize, "rt2", ECF_A8R8G8B8);
	ITexture *rt3 = drv->addRenderTargetTexture(screensize, "rt3", ECF_A8R8G8B8);
	if (!rt1 || !rt2 || !rt3) die("No RTT");

	ScreenQuad *def = new ScreenQuad(drv);
	ScreenQuad *sq = new ScreenQuad(drv);
	ScreenQuad *sq2 = new ScreenQuad(drv);
	ScreenQuad *sq3 = new ScreenQuad(drv);
	ScreenQuad *norm = new ScreenQuad(drv);
	if (showpic) def->SetTexture(pic);
	sq->SetTexture(rt1);
	sq->GetMaterial().setFlag(EMF_BILINEAR_FILTER, false);
	norm->SetTexture(rt1);
	norm->GetMaterial().setFlag(EMF_BILINEAR_FILTER, false);

	sq2->SetTexture(rt2);
	sq2->SetTexture(rt2, 1);
	sq2->SetTexture(areamaptex, 2);
	sq2->GetMaterial().TextureLayer[2].BilinearFilter = false;

	sq3->SetTexture(rt3);
	sq3->GetMaterial().setFlag(EMF_BILINEAR_FILTER, false);
	sq3->SetTexture(rt1,1);
	state_t state = MLAA_OFF;

	stringc tmp1, tmp2;
	tmp1 = defines;
	tmp1 += offsetvs;
	tmp2 = defines;
	tmp2 += color1fs;

	// Load shaders
	int edge = gpu->addHighLevelShaderMaterial(tmp1.c_str(),0,EVST_VS_1_1,tmp2.c_str());
	sq->SetMaterialType((E_MATERIAL_TYPE) edge);

	tmp2 = defines;
	tmp2 += blend2fs;

	blendcb *bcb = new blendcb();
	edge = gpu->addHighLevelShaderMaterial(tmp1.c_str(),0,EVST_VS_1_1,tmp2.c_str(),0,EPST_PS_1_1,bcb);
	sq2->SetMaterialType((E_MATERIAL_TYPE) edge);

	tmp2 = defines;
	tmp2 += neigh3fs;

//.........这里部分代码省略.........
开发者ID:clbr,项目名称:MLAA-test-app,代码行数:101,代码来源:mlaatest.cpp

示例5: sceneNodeAnimator

/** Test functionality of the ISceneNodeAnimator implementations. */
bool sceneNodeAnimator(void)
{
	IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(160, 120));
	assert_log(device);
	if(!device)
		return false;

	ISceneManager * smgr = device->getSceneManager();

	// Test the hasFinished() method.
	ISceneNodeAnimatorCollisionResponse* collisionResponseAnimator
		= smgr->createCollisionResponseAnimator(0, 0);

	ISceneNodeAnimator* deleteAnimator = smgr->createDeleteAnimator(1);

	ISceneNodeAnimator* flyCircleAnimator = smgr->createFlyCircleAnimator();

	ISceneNodeAnimator* flyStraightAnimator
		= smgr->createFlyStraightAnimator(vector3df(0, 0, 0), vector3df(0, 0, 0), 1, false);

	ISceneNodeAnimator* flyStraightAnimatorLooping
		= smgr->createFlyStraightAnimator(vector3df(0, 0, 0), vector3df(0, 0, 0), 1, true);

	ISceneNodeAnimator* rotationAnimator = smgr->createRotationAnimator(vector3df(0, 0, 0));

	array<vector3df> points;
	points.push_back(vector3df(0, 0, 0));
	points.push_back(vector3df(0, 0, 0));
	ISceneNodeAnimator* followSplineAnimator = smgr->createFollowSplineAnimator(0, points, 1000.f);

	array<video::ITexture*> textures;
	textures.push_back(0);
	textures.push_back(0);

	ISceneNodeAnimator* textureAnimator = smgr->createTextureAnimator(textures, 1, false);
	ISceneNodeAnimator* textureAnimatorLooping = smgr->createTextureAnimator(textures, 1, true);

	bool result = true;

	ISceneNode * deletedNode = smgr->addEmptySceneNode();
	deletedNode->addAnimator(deleteAnimator);

	ISceneNode * testNode = smgr->addEmptySceneNode();
	testNode->addAnimator(collisionResponseAnimator);
	testNode->addAnimator(deleteAnimator);
	testNode->addAnimator(flyCircleAnimator);
	testNode->addAnimator(flyStraightAnimator);
	testNode->addAnimator(flyStraightAnimatorLooping);
	testNode->addAnimator(rotationAnimator);
	testNode->addAnimator(followSplineAnimator);
	testNode->addAnimator(textureAnimator);
	testNode->addAnimator(textureAnimatorLooping);

	result &= !collisionResponseAnimator->hasFinished();
	result &= !deleteAnimator->hasFinished();
	result &= !flyCircleAnimator->hasFinished();
	result &= !flyStraightAnimator->hasFinished();
	result &= !flyStraightAnimatorLooping->hasFinished();
	result &= !rotationAnimator->hasFinished();
	result &= !followSplineAnimator->hasFinished();
	result &= !textureAnimator->hasFinished();
	result &= !textureAnimatorLooping->hasFinished();

	device->run();
	device->sleep(10);
	device->run();
	smgr->drawAll();

	// These animators don't have an endpoint.
	result &= !collisionResponseAnimator->hasFinished();
	result &= !flyCircleAnimator->hasFinished();
	result &= !rotationAnimator->hasFinished();
	result &= !followSplineAnimator->hasFinished();

	// These animators are looping and so can't finish.
	result &= !flyStraightAnimatorLooping->hasFinished();
	result &= !textureAnimatorLooping->hasFinished();

	// These have an endpoint and have reached it.
	result &= deleteAnimator->hasFinished();
	result &= flyStraightAnimator->hasFinished();
	result &= textureAnimator->hasFinished();

	collisionResponseAnimator->drop();
	deleteAnimator->drop();
	flyCircleAnimator->drop();
	flyStraightAnimator->drop();
	flyStraightAnimatorLooping->drop();
	rotationAnimator->drop();
	followSplineAnimator->drop();
	textureAnimator->drop();
	textureAnimatorLooping->drop();

	device->closeDevice();
	device->run();
	device->drop();

	if(!result)
	{
//.........这里部分代码省略.........
开发者ID:Habaut,项目名称:GameBindings,代码行数:101,代码来源:sceneNodeAnimator.cpp


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