<Matrix|User's Guide|Quaternion>
Vectors are used to represent a multitude of things in jME, points in space, vertices in a triangle mesh, normals, etc. These classes (Vector3f in particular) are probably the most used class in jME.
A Vector is defined by an n-tuple of real numbers. V = <V1, V2,…, Vn>.
We have two Vectors (2f and 3f) meaning we have tuples of 2 float values or 3 float values.
A Vector can be multiplied by a scalar value to produce a second Vector with the same proportions as the first. aV = Va = <aV1, aV2,…,aVn>
Adding or subtracting two Vectors occurs component-wise. That is the first component is added (subtracted) with the first component of the second Vector and so on.
P + Q = <P1+Q1, P2+Q2, …, Pn+Qn>
The magnitude defines the length of a Vector. A Vector of magnitude 1 is unit length.
For example, if V = (x, y, z), the magnitude is the square root of (x2 + y2 + z2).
A Vector can be normalized or made unit length by multiplying the Vector by (1/magnitude).
The dot product of two vectors is defined as: P dot Q = PxQx + PyQy + PzQz
Using the dot product allows us to determine how closely two Vectors are pointing to the same point. If the dot product is negative they are facing in relatively opposite directions, while postive tells us they are pointing in the relative same direction.
If the dot product is 0 then the two Vectors are orthogonal or 90 degrees off.
The Cross Product of two Vectors returns a third Vector that is prependicular to the two Vectors. This is very useful for calculating surface normals.
P X Q = <PyQz - PzQy, PzQx - PxQz, PxQy - PyQx>
Vector3f and Vector2f store their values (x, y, z) and (x, y) respectively as floats. Most methods are straight forward, and I will leave documentation to the Javadoc.