Back to class index
| Sphere::RandomPointInsideSyntaxfloat4 Sphere::RandomPointInside(LCG &lcg); [19 lines of code]float4 Sphere::RandomPointInside(LCG &lcg, const float4 ¢er, float radius); [4 lines of code] Generates a random point inside this sphere. The points are distributed uniformly. This function uses the rejection method to generate a uniform distribution of points inside a sphere. Therefore it is assumed that this sphere is not degenerate, i.e. it has a positive radius. A fixed number of 1000 tries is performed, after which the sphere center position is returned as a fallback. ParametersLCG &lcgA pre-seeded random number generator object that is to be used by this function to generate random values. See AlsoWork in progress:Todo: in float4 Sphere::RandomPointInside(LCG &lcg): Add Sphere::Point(polarYaw, polarPitch, radius). |