MouseWheel move Camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Morganolla
Posts: 44
Joined: Tue Nov 17, 2009 9:56 am
Location: Rus

Post by Morganolla »

Thanks everybody. I wrote my class as you advised:

Code: Select all

class MouseWheelReceiver : public IEventReceiver
{

public:
	MouseWheelReceiver()
	{WhRotor=0;}

	virtual bool OnEvent(const SEvent& event)
	{
		if (event.EventType == irr::EET_MOUSE_INPUT_EVENT)
		{
	       if(event.MouseInput.Event == EMIE_MOUSE_WHEEL) WhRotor+=event.MouseInput.Wheel;
		}
 		return false;
	}

	virtual f32 Wheel()
	{ return WhRotor;}

private:
	f32 WhRotor;
};
But function ...Wheel() every time returns 0! Despite I rotate mouse wheel very hard. What's wrong? Where is mistake?
Morganolla
Posts: 44
Joined: Tue Nov 17, 2009 9:56 am
Location: Rus

Post by Morganolla »

Well... I found my mistake. Now, Everything is OK! Thanks.
Post Reply