new controller code doesn't use events?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • new controller code doesn't use events?

      Hi,

      I'm noticing something confusing in the MovementController code that was added post-press. In MovementController:: OnUpdate I see code like m_object->VSetTransform(&m_matToWorld, &m_matFromWorld);, rather then adding a movement event like in the book for the game view to update the scenenode.

      Doesn't this break the rules by allowing the controller to directly manipulate the position of the scenenode, thereby bypassing all game logic? Thanks for any clarification on this!

      The post was edited 1 time, last by trs79 ().

    • RE: new controller code doesn't use events?

      The answer to your question is yes - it essentially breaks the rules but only ifthe movement controller class controlled an object that matters in the game world.

      The only place the movement controller is actualy used is in control of a freely roaming camera - which for TeapotWars isn't a game object - it is only on the rendering side.

      So, the version of the movement controller you see makes no effort at all to interact with the simulated world in the game.

      A better implementation of this movement controller would do something like you see in the TeapotController class.

      Good catch, though!
      Mr.Mike
      Author, Programmer, Brewer, Patriot