Author Topic: Camera getZAxis vs getDirection  (Read 2833 times)

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Camera getZAxis vs getDirection
« on: October 20, 2008, 03:45:42 am »
Hi, Should be the same the getDirection and the getZAxis methods? as the Z axis of the camera should be looking to the front of it. The same of getDirection.....??  ???

or getZAxis gets the projected vector of the get direction over a World plan or something? In my game I was trying to use the getZAxis for seting the direction of my shots by I had strange results like shotting the right and the bullet moving the left. shooting up and the bullet moving to down. Anyway I tested the getDirection method and worked perfectly.
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12198
    • View Profile
Re: Camera getZAxis vs getDirection
« Reply #1 on: October 20, 2008, 09:35:44 am »
When thinking about the camera, it feels like you are rotating and moving the camera around in the world. That's how it looks, but that's not what actually happens. What happens is, that you are moving the world around the camera with the inverted values. That's why getZAxis() gives you the inverted directions of what you would expect. getDirection() corrects this internally, hence the difference in behaviour.