TSphereSpecializeSamplingHelper< T, 3 >::ComputeGoldenSpiralPoints

Use the golden spiral method to evenly distribute points on a sphere.

Windows
MacOS
Linux

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Sphere.h

Include

#include "Chaos/Sphere.h"

Syntax

static void ComputeGoldenSpiralPoints
(
    TArray< TVec3< T >> & Points,
    const TVec3< T > & Center,
    const T Radius,
    const int32 NumPoints,
    const bool BottomHalf,
    const bool TopHalf,
    const int32 SpiralSeed
)

Remarks

Use the golden spiral method to evenly distribute points on a sphere.

The "golden" part is derived from the golden ratio; stand at the center, turn a golden ratio of whole turns, then emit a point in that direction.

Points are generated starting from the bottom of the sphere, ending at the top. Contiguous entries in `Points_ generally will not be spatially adjacent.

Points_ to append to. Center is the center of the sphere. `Radius is the radius of the sphere. NumPoints_ is the number of points to generate. BottomHalf causes the bottom half of the sphere to be generated, starting at `Center - (0, 0, Radius_). TopHalf causes the top half of the sphere to be generated, starting at `Center. SpiralSeed_ is the starting index for golden spiral generation. When using this method to continue a spiral started elsewhere, SpiralSeed_ should equal the number of particles already created.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss