Package org.joml.sampling
Class UniformSampling.Sphere
- java.lang.Object
-
- org.joml.sampling.UniformSampling.Sphere
-
- Enclosing class:
- UniformSampling
public static class UniformSampling.Sphere extends java.lang.Object
Generates uniform samples on a unit sphere.- Author:
- Kai Burjack
-
-
Constructor Summary
Constructors Constructor Description Sphere(long seed, int numSamples, Callback3d callback)
Create a new instance ofUniformSampling.Sphere
, initialize the random number generator with the givenseed
and generatenumSamples
number of sample positions on the unit sphere, and call the givencallback
for each sample generate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate(int numSamples, Callback3d callback)
CreatenumSamples
number of samples which are uniformly distributed on a unit sphere, and call the givencallback
for each sample generated.
-
-
-
Constructor Detail
-
Sphere
public Sphere(long seed, int numSamples, Callback3d callback)
Create a new instance ofUniformSampling.Sphere
, initialize the random number generator with the givenseed
and generatenumSamples
number of sample positions on the unit sphere, and call the givencallback
for each sample generate.- Parameters:
seed
- the seed to initialize the random number generator withnumSamples
- the number of samples to generatecallback
- will be called for each sample generated
-
-
Method Detail
-
generate
public void generate(int numSamples, Callback3d callback)
CreatenumSamples
number of samples which are uniformly distributed on a unit sphere, and call the givencallback
for each sample generated.Reference: http://mathworld.wolfram.com/
- Parameters:
numSamples
- the number of samples to generatecallback
- will be called for each sample generated
-
-