1
// Copyright (C) 2008-2011 Colin MacDonald
2
// No rights reserved: this software is in the public domain.
11
/** Tests the offset capability of the fly circle animator */
12
bool flyCircleAnimator(void)
14
IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO,
15
core::dimension2du(160,120), 32);
19
IVideoDriver* driver = device->getVideoDriver();
20
ISceneManager* smgr = device->getSceneManager();
22
const f32 offsetDegrees[] = { 0.f, 45.f, 135.f, 270.f };
24
for(u32 i = 0; i < sizeof(offsetDegrees) / sizeof(offsetDegrees[0]); ++i)
26
IBillboardSceneNode * node = smgr->addBillboardSceneNode();
27
// Have the animator rotate around the Z axis plane, rather than the default Y axis
28
ISceneNodeAnimator * animator = smgr->createFlyCircleAnimator(
29
vector3df(0, 0, 0), 30.f, 0.001f,
30
vector3df(0, 0, 1), (offsetDegrees[i] / 360.f));
31
if(!node || !animator)
34
node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
35
node->setMaterialTexture(0, driver->getTexture("../media/particle.bmp"));
36
node->setMaterialFlag(video::EMF_LIGHTING, false);
38
node->addAnimator(animator);
42
(void)smgr->addCameraSceneNode(0, vector3df(0, 0, -50), vector3df(0, 0, 0));
46
// Don't do device->run() since I need the time to remain at 0.
47
if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
51
result = takeScreenshotAndCompareAgainstReference(driver, "-flyCircleAnimator.png", 100);
54
device->closeDevice();