public static class BestCandidateSampling.Sphere extends Object
References:
| Constructor and Description |
|---|
Sphere()
Create a new instance of
BestCandidateSampling.Sphere to configure and generate 'best candidate' sample positions on the unit sphere. |
| Modifier and Type | Method and Description |
|---|---|
BestCandidateSampling.Sphere |
generate(Callback3d callback)
Generate 'best candidate' sample call the given
callback for each generated sample. |
BestCandidateSampling.Sphere |
generate(float[] xyzs)
Generate 'best candidate' sample positions and store the coordinates of all generated samples into the given
xyzs float array. |
BestCandidateSampling.Sphere |
generate(FloatBuffer xyzs)
Generate 'best candidate' sample positions and store the coordinates of all generated samples into the given
xyzs FloatBuffer. |
BestCandidateSampling.Sphere |
numCandidates(int numCandidates)
Set the number of candidates to try for each generated sample.
|
BestCandidateSampling.Sphere |
numSamples(int numSamples)
Set the number of samples to generate.
|
BestCandidateSampling.Sphere |
onHemisphere(boolean onHemisphere)
Set whether to generate samples on a hemisphere around the
+Z axis. |
BestCandidateSampling.Sphere |
seed(long seed)
Set the seed to initialize the pseudo-random number generator with.
|
public Sphere()
BestCandidateSampling.Sphere to configure and generate 'best candidate' sample positions on the unit sphere.public BestCandidateSampling.Sphere generate(float[] xyzs)
xyzs float array.
This method performs heap allocations, so should be used sparingly.
xyzs - will hold the x, y and z coordinates of all samples in the order XYZXYZXYZ....
This array must have a length of at least numSamplespublic BestCandidateSampling.Sphere generate(FloatBuffer xyzs)
xyzs FloatBuffer.
The samples will be written starting at the current position of the FloatBuffer. The position of the FloatBuffer will not be modified.
This method performs heap allocations, so should be used sparingly.
xyzs - will hold the x, y and z coordinates of all samples in the order XYZXYZXYZ....
This FloatBuffer must have at least numSamples remaining elements.
The position of the buffer will not be modified by this methodpublic BestCandidateSampling.Sphere seed(long seed)
seed - the seed valuepublic BestCandidateSampling.Sphere numSamples(int numSamples)
numSamples - the number of samplespublic BestCandidateSampling.Sphere numCandidates(int numCandidates)
numCandidates - the number of candidates to trypublic BestCandidateSampling.Sphere onHemisphere(boolean onHemisphere)
+Z axis.
The default is false, which will generate samples on the whole unit sphere.
onHemisphere - whether to generate samples on the hemispherepublic BestCandidateSampling.Sphere generate(Callback3d callback)
callback for each generated sample.
This method performs heap allocations, so should be used sparingly.
callback - will be called with the coordinates of each generated sample positionCopyright © 2015–2019 JOML. All rights reserved.