[SOLVED] Why is adding a vector to another vector not working?


Why is this code not working?

 Vector3f planeDirection = new Vector3f(0, 0, 0);
 public void someMethod(){
  Vector3f add = new Vector3f(Mouse.getX(), Mouse.getY(), 0);
  System.out.println(planeDirection + "" + add);

When I print out the values, it just prints out this:

(0.0, 0.0, 0.0)(129.0, 143.0, 0.0)

So, even though I am adding a positive vector to a vector of 0, the vector I am adding to does not seem to change.

It’s probably a stupid mistake, but I can’t seem to work this out.



Thanks, but could you explain why that is? add() on your conventional vecmath or LWJGL Vector3f has always worked for me in the past.

If only there were some documentation or something that one could look at to read all about it…


1 Like