public static Vector3f insideUnitSphere() {
        float u = nextRandomFloat();
        // Azimuthal angle [0, 2PI]
        float theta = FastMath.TWO_PI * nextRandomFloat();
        // Polar angle [0, PI] for uniform surface distribution
        float phi = FastMath.acos(2f * nextRandomFloat() - 1f);

        // For uniform distribution within the volume, radius R should be such that R^3 is uniformly distributed.
        // So, R = cbrt(random_uniform_0_to_1)
        float radius = (float) Math.cbrt(u);

        float sinPhi = FastMath.sin(phi);
        float x = radius * sinPhi * FastMath.cos(theta);
        float y = radius * sinPhi * FastMath.sin(theta);
        float z = radius * FastMath.cos(phi);

        return new Vector3f(x, y, z);
    }
Returns a random point inside or on a sphere with radius 1.0
This method uses spherical coordinates combined with a cubed-root radius.

@return A new {@link Vector3f} representing a random point within the unit sphere.
jme3-core/src/main/java/com/jme3/math/FastMath.java