Exemplo n.º 1
0
 //Create a linker with a key handler, enabling you to move the camera with the WASDEFZX keys.
 //If you pass null, it will not link the keys.
 public Linker(I_Observable<I_KeyListener> keyHandler,Viewport3D viewport)
     : this(viewport)
 {
     if (keyHandler != null)
     {
         keyHandler.addListener(keyController);
         keyHandler.addListener(platform); //let the view port listen to my key events
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Tell the camera which displays the robot to listen to a particular key handler. The camera will expect AWSDEFZX command
 /// keys to control its movement at the time of writing (see the ViewPlatform class for details). This is only worth
 /// doing if you provided a viewport initially.
 /// </summary>
 /// <param name="keyHandler">The key handler that the camera should listen to.</param>
 public void setCameraToListenToKeys(I_Observable<I_KeyListener> keyHandler)
 {
     if (keyHandler == null) throw new ArgumentException("Unexpected null key handler.");
     keyHandler.addListener(platform);
 }