Giving same keyboard/mouse event to 2 FPS cam different

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
angel80
Posts: 22
Joined: Mon Feb 07, 2005 1:37 pm
Location: Paris (France)

Giving same keyboard/mouse event to 2 FPS cam different

Post by angel80 »

Hi all,
I'm a new Irrlicht user, I'm working on a project for virtual reality room, actually I'm writting a program with Irrlicht to generate a stereoscopic view (2 cam positionning as the eyes).
I'd like to know if it's possible to make 2 differents cameras (FPS) to have the same behavior (event) from the user.
Your help will be very helpfull
PS: sorry for my bad english
.: Franck :.
angel80
Posts: 22
Joined: Mon Feb 07, 2005 1:37 pm
Location: Paris (France)

Add to the forward text

Post by angel80 »

I forgot to say that I'm coding a function based on an exemple found in this forum

Create a custom eventReceiver:

Code: Select all

class MyEventReceiver : public IEventReceiver {
public:
  virtual bool OnEvent(SEvent event) {

    //Key S enables/disables SplitScreen
    if (event.KeyInput.Key == KEY_KEY_S && event.KeyInput.PressedDown) {
      SplitScreen = !SplitScreen;
      return true;
    }

      camera[3]->OnEvent(event);

      camera[2]->OnEvent(event);   

    return false;
  }
};
then

Create 2 cameras with a splitting screen

Code: Select all

        smgr->setActiveCamera(camera[2]);
        driver->setViewPort(rect<s32>(0,0,ResX/2,ResY));
        smgr->drawAll();

        smgr->setActiveCamera(camera[3]);
      	driver->setViewPort(rect<s32>(ResX/2,0,ResX,ResY));
        smgr->drawAll();

the problem is: it's only work for mouse event and it don't work well (when I turn around, one camera is late comparing to the other

Can anybody help me???
Thanks
.: Franck :.
Guest

Post by Guest »

Double buffering could help. It will probably be as slow, but they will update at the same time, making it appear smoother.
Guest

Post by Guest »

Double buffering could help. It will probably be as slow, but they will update at the same time, making it appear smoother.
Post Reply