Simple control codes for your helicopter / chopper scene node.
Updated: 18 June, 2012
http://code.google.com/p/irrcodes/downloads/detail?name=chopper_18062012.zip
Make sure the forward direction of the scene node is along the z axis.
ctor:
ChopperControl* chopperControl = new ChopperControl(device, node);
In the device run loop:
while(device->run())
if (device->isWindowActive())
{
chopperControl->update();
driver->beginScene(true, true, 0);
smgr->drawAll();
chopperControl->drawLandingGuide(selector, 0xFFFF0000);
driver->endScene();
...
}
dtor:
if (chopperControl) { delete chopperControl; chopperControl = 0; }
In the event receiver class:
class EventReceiver: public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if (chopperControl)
chopperControl->OnEvent(event);
...
}
Regards
smso



