Vectors for a 2D/3D World in Java
- by jax
I reading about Mathematics in Games and am wondering what is the best way to represent a Vector location in Java.
I know there is a Vector class but I don't think this is what I need.
There is also a Matrix class which looks like it may be what I want (a 1 dimensional matrix maybe).
In particular, if I were to create a location Vector such as:
v(x,y,z) where x,y and z are the coordinates in 3D space, what would be the best way to represent this in Java. It would be nice if I could also add, subtract and find the dot-product of Vectors.
ideas?