public Vector4f project(Vector4f other) {
        float n = this.dot(other); // A . B
        float d = other.lengthSquared(); // |B|^2
        return new Vector4f(other).multLocal(n / d);
    }
<code>dot</code> calculates the dot product of this vector with a
provided vector. If the provided vector is null, 0 is returned.

@param vec
           the vector to dot with this vector.
@return the resultant dot product of this vector and a given vector.
jme3-core/src/main/java/com/jme3/math/Vector4f.java