Plane class bug

1)

public float pseudoDistance(Vector3f point) {

return normal.dot(point) - constant;

}

it should be :

public float pseudoDistance(Vector3f point) {

return normal.dot(point) + constant;

}

because according to math world :

ax+by+cz+d =0 or d = -ax-by-cz = -(normal.dot(origin))

It is already negative. d is the constant;



Edit: i just read the class description it uses a different formula for constant (negative sign).





2) it lacks constructor that takes as arguments normal, origin.

public static Plane createPlane(Vector3f planeOrigin, Vector3f planeNormal)

{

return new Plane(planeOrigin, -planeNormal.dot(planeOrigin));

}