Camera movement in TeapotWars

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

    • Camera movement in TeapotWars

      I found a post that was created a couple years ago and Mike said that with physics disabled, movement is not possible in TeapotWars.

      My question is - why not the camera? I have literally studied the code for hours and stepped through it over and over and I can't figure out why the world doesn't move even though the camera is changing position (confirmed by the camera position status text corresponding to the input key pressed).

      How does the physics SDK (or lack thereof in this case) affect basic camera movement?
    • RE: Camera movement in TeapotWars

      It's because the camera is attached to a teapot, and the only way the teapot can move is with the physics system. Physics is required for collision detection and dynamcis.

      If you detach the camera from the teapot there is already code in there to move the camera about without the teapot. Look in the movement controller code and you'll see how that works.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • Thanks for the response Mike! BTW, I just received the 3rd edition of GCC in the mail today...love it so far!

      I should have been more clear, the version of TeapotWars I was referring too was the one that used the older Physx library for physics (I also have the second edition). I actually did try switching to the FreeCameraController but doing so only made a few objects on the screen disappear, still no movement.

      Luckily, the version that accompanies the 3rd edition works just fine, albeit some wacky physics (like the teapots spinning endlessly or falling infinitely into the abyss ;) )

      Once I understand D3D cameras a bit more I'll have to go back into the 2nd edition code and see if I can figure out what was going on. For now, I've got my work cut out building the event system. :)