Wednesday, June 13, 2012

Zero Means Ten in JME3

So a quick update from yesterdays camera problem I was having.  It turns out I was having a brain fart, since the camera actually was moving!  The mountain that the camera looks at by default was so far away that I just could not notice the movement... we all make newb mistakes every now and then.

Anyways, I have found a new problem that is very strange.  After doing more work on the camera system, I went to test out what I had created.  When I started the game, the camera took off at blazing fast speeds in the y direction.  After poking around and reviewing the code for a while, I decided to test out JME3's debugger.  I was quick to find the problem.  In short, the Vector3f class's static ZERO vector has a positive ten value for the y direction.  Below is what I found when debugging:


Maybe this is me being a newb again, but shouldn't the ZERO vector be all zeros?  Anyways, I experimented with different ways to initialize the vector, and here are the results:



So I need to go through and change all my code that has vectors in it so that they get zeroed out properly.  On a side note, the JME3 debugger works great (being based on netbeans I would expect it to) and I'm sure this wont be the last time I will be using it.

The camera system is turning out to be more challenging then I had thought, but I think it will be very nice and add to the users experience in the end.

No comments:

Post a Comment