I forgot to mention that I developed a function to calculate a random vector inside a plane, Maybe can I add it to the jme plane class ?

Here is the code:

[java]

//Generates a random vector inside a plane defined by a normal vector and a point

private Vector3f randomVectInPlane(Vector3f planeNormalV, Vector3f planePoint)

{

Random rand = FastMath.rand;

```
/* Plane ecuation: Ax + By + Cz + D = 0
* => z = -(Ax + By + D) / C
* => x = -(By + Cz + D) / A
* => y = -(Ax + Cz + D) / B
*/
float a = planeNormalV.x;
float b = planeNormalV.y;
float c = planeNormalV.z;
float d = -(
(a * planePoint.x) +
(b * planePoint.y) +
(c * planePoint.z)
);
float x, y, z;
if(c != 0)
{
x = rand.nextFloat();
y = rand.nextFloat();
z = -((a * x) + (b * y) + d) / c;
}
else if(a != 0)
{
y = rand.nextFloat();
z = rand.nextFloat();
x = -((b * y) + (c * z) + d) / a;
}
else if(b != 0)
{
x = rand.nextFloat();
z = rand.nextFloat();
y = -((a * x) + (c * z) + d) / b;
}
else
{
x = rand.nextFloat();
y = rand.nextFloat();
z = rand.nextFloat();
}
Vector3f randPoint = new Vector3f(x, y, z);
return randPoint.subtract(planePoint);
```

}

[/java]